hello
i see a warning "Undefined variable: percentage in line 166" on the product page of Vm also the template use this cod to show Percentage
<?php if(($isSaleLabel != 0) && $vm_labels_sales) : ?>
<div class="label-pro status-sale"><span><?php echo $percentage; ?></span></div> //line 166
<?php endif; ?>
and this is the daclaration of the Percentage
// Percentage
if ($isSaleLabel) {
$dtaxs = array();
if($product->prices["DATax"]) $dtaxs = $product->prices["DATax"];
if($product->prices["DBTax"]) $dtaxs = $product->prices["DBTax"];
foreach($dtaxs as $dtax){
if(!empty($dtax)) {
$discount = rtrim(rtrim($dtax[1],'0'),'.');
$operation = $dtax[2];
$percentage = "";
switch($operation) {
case '-':
$percentage = "-".$discount;
break;
case '+':
$percentage = "+".$discount;
break;
case '-%':
$percentage = "-".$discount."%";
break;
case '+%':
$percentage = "+".$discount."%";
break;
default:
return true;
}
}
}
}
// End Percentage
how can i fix this please ?
thanks
amine
In default VM3.2.15 $percentage is only used in the Paypal plugin ( paypalstd.php ). So I guess the issue is with your template or overrides.
move
$percentage = "";
before
if ($isSaleLabel) {
thank you very much , the issue is fixed now