ZangZang Posted January 25, 2015 Share Posted January 25, 2015 Hi, I cant get the cheapest carrier to display at the shoppingcart, instead is takes the most expensive one. Only when I checkout with adress, name etc I got all the alternatives. prereq: - Carrier A (cheapest at 0-2kg, max 2kg), activated - Carrier B (most expensive all ranges, max 100kg), activated - Default carrier: Best price - Both carriers assigned to the test product. - Adding the product as visitor(non logged in) Someone got a clue? Thanks! Zang Link to comment Share on other sites More sharing options...
NemoPS Posted January 26, 2015 Share Posted January 26, 2015 Is the cheapest one active for visitors? If it is already, you can try with a small trick: disable the expensive one for the visitor group, it will be forced to pick up the other Link to comment Share on other sites More sharing options...
ZangZang Posted January 26, 2015 Author Share Posted January 26, 2015 The problem is if I do that then the countries that exits only in the expensive one will got no carrier. Link to comment Share on other sites More sharing options...
ZangZang Posted January 26, 2015 Author Share Posted January 26, 2015 I'm not very well versed in PHP and prestashop, but are there a function that returns all available carriers with specfic zone_id as input parameter? I could then "getDeliveryPriceByWeight" to achieve what I need. Link to comment Share on other sites More sharing options...
ZangZang Posted January 26, 2015 Author Share Posted January 26, 2015 (edited) I found some useful stuff but not sure if this is used correctly: in Cart.php in function getPackageShippingCost: $result = Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true, false, (int)$id_zone); foreach($result as $x) { echo "<script>alert('". $x->name ."')</script>"; //<----- name is empty!!! } Cant seem to get any carriers... Edited January 26, 2015 by ZangZang (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted January 28, 2015 Share Posted January 28, 2015 Check result first: var_dump($result) Link to comment Share on other sites More sharing options...
Recommended Posts