Jump to content

Problem with shipping cost


Recommended Posts

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 by cooliyev (see edit history)
Link to comment
Share on other sites

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

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 by Catalin Scaesteanu (see edit history)
  • Like 1
Link to comment
Share on other sites

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

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 by cooliyev (see edit history)
Link to comment
Share on other sites

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..

  • Like 1
Link to comment
Share on other sites

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

  • 4 weeks later...

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

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...