cooliyev Posted August 6, 2015 Share Posted August 6, 2015 (edited) Hi everyone! I have a trouble. For example, I have Carrier 1 where I added 0kg-1kg, 1kg-2kg, 2kg-3kg diapasons. And cost of these 10$, 20$, 30$. But the weight of product which I want to buy is 0.320g. And when I add this product to shopping cart the shipping cost appears 10$, mathematically it have to be equal 3,2$. Please help me fix this bug. thank you in advance Edited August 6, 2015 by cooliyev (see edit history) Link to comment Share on other sites More sharing options...
Paulito Posted August 6, 2015 Share Posted August 6, 2015 Hello Sorry if I am not understanding you but: 0.320g fits in between 0kg-1kg So the answer is correct. Am I barking up the wrong tree here, quite possibly Paul Link to comment Share on other sites More sharing options...
cooliyev Posted August 6, 2015 Author Share Posted August 6, 2015 Logically yes it is the correct answer, but mathematically it is not correct. because 0,320g x 10$ = 3,2$ and customer have to pay 3,2$ not 10$ Link to comment Share on other sites More sharing options...
cooliyev Posted August 6, 2015 Author Share Posted August 6, 2015 Because if i need add diapasons from 0kg to 50kg then I have to add 0,1kg-0,2kg, 0,2kg-0,3kg...ets.... It's impossible. It must have some solution Link to comment Share on other sites More sharing options...
DotMedia Posted August 6, 2015 Share Posted August 6, 2015 I think the only way around your problem is to have flat rate in your carriers and add an additional shipping fee inside each product according to the weight of each product.Edit product > shipping tab > Additional shipping fees (for a single item). Please post back so other people know if it worked.DM Link to comment Share on other sites More sharing options...
cooliyev Posted August 6, 2015 Author Share Posted August 6, 2015 It will be correct for one carrier, but many of us use a couple or triple carriers Link to comment Share on other sites More sharing options...
cooliyev Posted August 6, 2015 Author Share Posted August 6, 2015 Specialists where are you? Link to comment Share on other sites More sharing options...
catalin.scaesteanu Posted August 6, 2015 Share Posted August 6, 2015 (edited) Hi everyone! I have a trouble. For example, I have Carrier 1 where I added 0kg-1kg, 1kg-2kg, 2kg-3kg diapasons. And cost of these 10$, 20$, 30$. But the weight of product which I want to buy is 0.320g. And when I add this product to shopping cart the shipping cost appears 10$, mathematically it have to be equal 3,2$. Please help me fix this bug. thank you in advance As I understand it's displaying correctly. The rules are interpreted like this: if the total order weight is between 0kg and 1kg the carrier fee is 10$. if the total order weight is between 1kg and 2kg the carrier fee is 20$. if the total order weight is between 2kg and 3kg the carrier fee is 30$. In your case it's one product but the order may contain multiple products. So if your product has 0.320kg weight it belongs to the first category because it's in between 0kg and 1kg and the carrier fee is $10. This means it adds $10 to the total price, it's not a multiplication. To achieve what you want you should look for a module which calculates the cost of shipping the way you want it to if such exists. And if not I would start by looking at the Carrier class -> classes/Carrier.php method getDeliveryPriceByWeight() Hope this helps Edited August 6, 2015 by Catalin Scaesteanu (see edit history) 1 Link to comment Share on other sites More sharing options...
cooliyev Posted August 7, 2015 Author Share Posted August 7, 2015 As I understand it's displaying correctly. The rules are interpreted like this: if the total order weight is between 0kg and 1kg the carrier fee is 10$. if the total order weight is between 1kg and 2kg the carrier fee is 20$. if the total order weight is between 2kg and 3kg the carrier fee is 30$. In your case it's one product but the order may contain multiple products. So if your product has 0.320kg weight it belongs to the first category because it's in between 0kg and 1kg and the carrier fee is $10. This means it adds $10 to the total price, it's not a multiplication. To achieve what you want you should look for a module which calculates the cost of shipping the way you want it to if such exists. And if not I would start by looking at the Carrier class -> classes/Carrier.php method getDeliveryPriceByWeight() Hope this helps Yes, that's right I fully agree with Prestashop. But! When you add second product (1st product 320g, 2nd - 280g = 600g = 10$) to cart it displaying shipping cost like 20$ not 10$. it is a second problem . Had anybody the problem like this? I understand that it does not matter for people who sell goods locally. But if you sell worldwide this bug is a real big problem, because all of us want to give less money for transportation. Link to comment Share on other sites More sharing options...
cooliyev Posted August 7, 2015 Author Share Posted August 7, 2015 (edited) SOLVED! Thank you very much Catalin Scaesteanu public function getDeliveryPriceByWeight($total_weight, $id_zone) { $cache_key = $this->id.'_'.$total_weight.'_'.$id_zone; if (!isset(self::$price_by_weight[$cache_key])) { $sql = '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)$total_weight.' >= w.`delimiter1` AND '.(float)$total_weight.' < w.`delimiter2` AND d.`id_carrier` = '.(int)$this->id.' '.Carrier::sqlDeliveryRangeShop('range_weight').' ORDER BY w.`delimiter1` ASC'; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); if (!isset($result['price'])) self::$price_by_weight[$cache_key] = $this->getMaxDeliveryPriceByWeight($id_zone); else self::$price_by_weight[$cache_key] = $total_weight * $result['price']; } return self::$price_by_weight[$cache_key]; } Old version were: self::$price_by_weight[$cache_key] = $result['price']; Edited August 7, 2015 by cooliyev (see edit history) Link to comment Share on other sites More sharing options...
weiloong Posted August 8, 2015 Share Posted August 8, 2015 Hi, I have a similar problem. I set my shipping fee cost at $8 if order less than $80, but I found that if I have product A: $20 and product B: $40 to add to the cart, the shipping fee will be $16 instead of $8, I have set the fee to total prices, but it will still charge me based on products total price instead of orders total price, is it possible to solve this issue? But if the total order more than $80, it will auto set as free shipping.... How could I solve this issue? Thank you in advance.. 1 Link to comment Share on other sites More sharing options...
cooliyev Posted August 8, 2015 Author Share Posted August 8, 2015 Hi. Did you set product's weight? It's important. After, you have to set up weight diapasones. Link to comment Share on other sites More sharing options...
weiloong Posted August 8, 2015 Share Posted August 8, 2015 Hi. Did you set product's weight? It's important. After, you have to set up weight diapasones. I have already solved the problem. Previously I ticked on "I want to use the advanced stock management system for this product" even I have already specified the quantity of the product by manually, maybe this is the reason make it duplicate? Anyway, thank you. Link to comment Share on other sites More sharing options...
SieraBaird Posted September 4, 2015 Share Posted September 4, 2015 When filling out the shipping information it ask for additional shipping fees(for a single item). What is this for? I have put in several different amounts trying to figure it out but I see no change when ordering the product. Link to comment Share on other sites More sharing options...
Silvie Posted September 9, 2015 Share Posted September 9, 2015 I think this should add the additional shipping fee to the order when the specific product is ordered. You can use it in case you have just a few products in the shop that require the shipping costs to be higher. For example, if you sell sports shoes and clothes and you decide to sell a fitness machine, too. So you would set an additional fee for that machine, because the shipping for this item will be sure higher than for clothes and shoes... If it does not work like this, I would check if your carrier does not have the "free shipping" option enabled. Link to comment Share on other sites More sharing options...
spc Posted February 20, 2017 Share Posted February 20, 2017 I have the same problem with weight.That is multiple the shipping cost...How did you fix it, can you share ???I use PS 1.6.1.9 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