VM 2.6.8.
File: plugins/vmshipment/weight_countries/weight_countries/tmpl/default.php
Code:
<?php
//vmdebug('we have here ',$viewData['product']->prices,$viewData['method']);
$currency = $viewData['currency'];
if(!empty($viewData['method']->countries) and is_array($viewData['method']->countries) and count($viewData['method']->countries)>0){
$countryM = VmModel::getModel('country');
echo 'We ship to ';
foreach($viewData['method']->countries as $virtuemart_country_id){
$country = $countryM->getData($virtuemart_country_id);
echo $country->country_name;
//vmdebug('my country ',$country);
}
}
echo '</br>';
echo 'With shipment '.$viewData['method']->shipment_name.' for '.$currency->priceDisplay($viewData['product']->prices['shipmentPrice']);
?>
Result in productdetail page:
<div class="spacer-buy-area">
<br>
With shipment Почтой России – вся Россия for 490 руб
<br>
<div class="addtocart-area">
............................................
A few facts:
- This line will appear on all sites using standard shipping after the upgrade to VM 2.6.8.
- This line can not be hidden by CSS.
- This line can not be removed without hacking the plugin, since the layout of this plugin is not overridden.
Guys, how was it possible to write such bad code? Sorry.
For those who do not want the shipment method/cost display it is simple to use a template override. http://forum.virtuemart.net/index.php?topic=125307.msg428964
No hacking required.
yepp and the option is already added in svn. A small mistake, either the layouts dont support it anyways or you can use a simple empty file as override.
But if you're already using a 3rd party template that's overriding the file, and you make the edits in that override, then when you update the template, it gets overridden right? What is best practice in that case?
(If the devs could just wrap the shipment display in a css class, it would be a much easier override with display: none).
Thanks,
Phil
the template update can't over write a file that doesn't exist in it's update.. the instruction is to make a new file.. it will remain unless your "update" deletes everything before updating - highly unlikely
and anyway, I added an option, so you can disable the shipment prices in the productdetails by a simple click.
Quote from: Milbo on November 23, 2014, 13:24:44 PM
and anyway, I added an option, so you can disable the shipment prices in the productdetails by a simple click.
Ah yes, I see that now. Thank you very much. (For anyone else looking for it, it's under each shipment method's configuration page.)