come ??? The meter is currently counted by using the table rates for an online store, but I have to customize how I need to customize.
At the moment, the postal charge is determined by the total weight of the order, but like the calculation to determine the cost of the post by the most expensive item of purchase, I want the car.
Do you know how can I override calculations made by this module? Help
Override Magento will be really grateful to me in advance
Thank you. The class is used to calculate these rates The information here is that we minimize the amount of code changed and our modules can be removed cleanly (and we can also upgrade Magento!) Of low risk with. Hope that helps! Thanks, Jo Mage_Shipping_Model_Shipping . When a rate is requested, this class is called using the '
collectRates method using a
Mage_Shipping_Model_Rate_Request object, which is full of objects and weight first. However, by that class subclassification with our override, we can be fraudulent and we can get the rate
class MyNamespace_MyModule_Model_Shipping extends Mage_Shipping_Model_Shipping {public function collectRates (Mage_Shipping_Model_Rate_Request $ request) {$ maxWyight = 0. Foreach ($ request & gt; getAllItems () as $ item) {$ maxWeight = Max ($ maxWeight, $ item, & gt; getRowWeight ()); } $ Request- & gt; Set packageware (maximum $ maxWeight); Return Parent :: Collect rates ($ request); }}
Comments
Post a Comment