uvtya Posted August 10, 2011 Share Posted August 10, 2011 Presta 1.4 The file classes / Carrier.php is a function of: public function getDeliveryPriceByWeight ($ totalWeight, $ id_zone) { $ Cache_key = $ this-> id .'_'.$ totalWeight .'_'.$ id_zone; if (! isset (self:: $ priceByWeight [$ cache_key])) { $ Result = Db:: getInstance (_PS_USE_SQL_SLAVE_) -> getRow (' SELECT d. `price` FROM `'. _DB_PREFIX_.' Delivery` d LEFT JOIN `'. _DB_PREFIX_.' Range_weight` w ON (d. `id_range_weight` = w. `id_range_weight`) WHERE d. `id_zone` = '. (Int) ($ id_zone).' AND '. (Float) ($ totalWeight).' > = W. `delimiter1` AND '. (Float) ($ totalWeight).' <W. `delimiter2` AND d. `id_carrier` = '. (Int) ($ this-> id).' ORDER BY w. `delimiter1` ASC '); if (! isset ($ result ['price'])) self:: $ priceByWeight [$ cache_key] = $ this-> getMaxDeliveryPriceByWeight ($ id_zone); else self:: $ priceByWeight [$ cache_key] = $ result ['price']; } return self:: $ priceByWeight [$ cache_key]; } I need this function to include the amount of goods from the basket (excluding shipping amount). Tell me how? or where to get this variable. Link to comment Share on other sites More sharing options...
Paul C Posted August 11, 2011 Share Posted August 11, 2011 I'm not sure why you would want or need to do such a thing. Are you sure you don't need to create a new Carrier module? That function is in the Carrier class and affects all carriers, rather than a specific one. In fact doesn't Carrier::getDeliveryPriceByPrice() do what you're describing already? If you really need to change the core behaviour (potentially affecting all carrier modules) then you would override the class (and that specific member function). Paul Link to comment Share on other sites More sharing options...
uvtya Posted August 13, 2011 Author Share Posted August 13, 2011 Thank you for your reply. The problem has been resolved. (I needed it to calculate shipping Russian Post) Link to comment Share on other sites More sharing options...
Richard S Posted August 14, 2011 Share Posted August 14, 2011 Mark your post as solved then. Thank you for your reply. The problem has been resolved. (I needed it to calculate shipping Russian Post) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now