KilitX adlı üyeden alıntı: mesajı görüntüle
https://www.opencart.com/index.php?r...nsion_id=14078 pro sürümüne eklemiş % indirimi, demosunu inceleyebilirsiniz.
for($i=1;$i<=12;$i++) {
               $xfee_total=(float)$total_xfee_fees['total'.$i];
               if(empty($xfee_total))$xfee_total=0;
               
               $xfee_total_max=(float)$total_xfee_fees['total_max'.$i];
               
               
               if(!$total_xfee_fees['name'.$i]) continue;
               if($xfee_total>$this->cart->getSubTotal()) continue;
               if($xfee_total_max && $xfee_total_max<$this->cart->getSubTotal()) continue;
               
              
               if($total_xfee_fees['payment'.$i] && $total_xfee_fees['payment'.$i]!=$payment_method) continue;
               
               if($total_xfee_fees['shipping'.$i] && $total_xfee_fees['shipping'.$i].'.'.$total_xfee_fees['shipping'.$i]!=$shipping_method && $total_xfee_fees['shipping'.$i]!=$shipping_method) continue;
                
               if($total_xfee_fees['geo_zone_id'.$i] && $address) {
                  
                   $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id='".(int)$total_xfee_fees['geo_zone_id'.$i]."' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')"); 
                   if ($query->num_rows==0) continue;
                                       
                }
              
                $tax_vat=0;
                if ($total_xfee_fees['tax_class_id'.$i]) {
                    $tax_rates = $this->tax->getRates($total_xfee_fees['cost'.$i], $total_xfee_fees['tax_class_id'.$i]);
                    
                    foreach ($tax_rates as $tax_rate) {
                        if (!isset($total['taxes'][$tax_rate['tax_rate_id']])) {
                            $total['taxes'][$tax_rate['tax_rate_id']] = $tax_rate['amount'];
                            $tax_vat+=$tax_rate['amount'];
                        } else {
                            $total['taxes'][$tax_rate['tax_rate_id']] += $tax_rate['amount'];
                            $tax_vat+=$tax_rate['amount'];
                        }
                    }
                }
                
                $total['totals'][] = array( 
                    'code'       => 'xfee',
                    'title'      => $total_xfee_fees['name'.$i],
                    'value'      => $total_xfee_fees['cost'.$i],
                    'sort_order' => !$total_xfee_fees['sort_order'.$i] ? $default_order : (int)$total_xfee_fees['sort_order'.$i]
                );
                
                $total['total'] *= $total_xfee_fees['cost'.$i];
          
           }
        }
    }
}
?>
Hocam bende mevcut toplama kısmını toplam*0.01*girdiğim değer şeklinde düzenlemeye çalışıyordum