[Skip to main content](#vessel-content)

#   Select the most expensive shipping method when several products are in the cart

##

- **[bellaidea](/forum/user/65058-bellaidea "View bellaidea's Profile")**
- [![bellaidea's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/65058-bellaidea "View bellaidea's Profile") Topic Author
- [ Offline](/forum/user/65058-bellaidea)

Less More

- Posts: 34
- Thank you received: 6
-
-

2 years 11 months ago [\#356980](#356980) by [bellaidea](/forum/user/65058-bellaidea "View bellaidea's Profile")  *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#356980 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")* was created by *[bellaidea](/forum/user/65058-bellaidea "View bellaidea's Profile")*

Hi,
I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.

For example, the customer orders three items:
Item 1: shipping cost 4 €
Item 2: shipping cost: 4 €
Item 3: shipping cost 6 €

I'd like to have the customer pay only 6 € of shipping for all the items, only once.
Note: shipping costs have been set using different Warehouses.

How to do it?
Thank you
Kind regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

2 years 10 months ago [\#356985](#356985) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#356985 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")*

Hi,

You can't do this with warehouses.
The goal of warehouses is to provide different shipping costs for different groups of products and sum the shipping costs of each group into one total shipping costs.
So first you need to undo what you did with warehouses: unselect the warehouse selection in your products and shipping method and then delete the warehouses.

There is actually no mechanism to work the way you want with the manual shipping plugin included with HikaShop at the moment.
So this would require the creation of a custom field of the table "product" via the menu Display&gt;Custom fields, so that you could enter the shipping price of each product when you edit them in the backend. And then, a custom shipping plugin would need to be developed to take into account the value entered there for each product in the cart and use the higher one as the shipping fee.

Actually, that capability is quite easy to add on our end so we'll work to add it for the next version of HikaShop (in the 5.0.2 to be released in January).
If you want to use it right now, what you can do is to change the line: Code:

$price += $rate_prices['price'] * $row-&gt;cart_product_quantity;

to: Code:

if($price &lt; $rate_prices['price']) $price = $rate_prices['price'];

in the file administrator/components/com_hikashop/helpers/shippingplugin.php
Then, create a manual shipping method and activate its "shipping price per product" setting.
Then, in each product, you'll have an extra "shipping prices" area where you can enter the shipping price for the current product.
Without the code change, HikaShop would use the sum of the shipping price of each product in the cart. With that change, it will only use the highest.
We'll add an option in shipping methods to select between both modes so that no code modification will be necessary going forward.

The following user(s) said Thank You: [bellaidea](/forum/user/65058-bellaidea "View bellaidea's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[navarre](/forum/user/52450-navarre "View navarre's Profile")**
- [![navarre's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/52450-navarre "View navarre's Profile")
- [ Offline](/forum/user/52450-navarre)

Less More

- Posts: 18
- Thank you received: 7
-
-

2 years 1 month ago [\#363328](#363328) by [navarre](/forum/user/52450-navarre "View navarre's Profile")  Replied by *[navarre](/forum/user/52450-navarre "View navarre's Profile")* on topic *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#363328 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")*

Hello Nicolas
I have the same requirement as the OP - can you please advise on the status for the change on your side - has it been included into the code?

I don't find the mechanism for switching\choosing which mode to use (Sum of the items costs Versus Highest cost in the cart)

Many thanks
Len

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[navarre](/forum/user/52450-navarre "View navarre's Profile")**
- [![navarre's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/52450-navarre "View navarre's Profile")
- [ Offline](/forum/user/52450-navarre)

Less More

- Posts: 18
- Thank you received: 7
-
-

2 years 1 month ago [\#363329](#363329) by [navarre](/forum/user/52450-navarre "View navarre's Profile")  Replied by *[navarre](/forum/user/52450-navarre "View navarre's Profile")* on topic *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#363329 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")*

Mea-Culpa - 100% PICNIC issue (Problem In Chair Not in Computer)

I realised what I did wrong in my preproduction site - to my embarrassment:oops: :oops:

Many thanks for your ongoing works

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[navarre](/forum/user/52450-navarre "View navarre's Profile")**
- [![navarre's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/52450-navarre "View navarre's Profile")
- [ Offline](/forum/user/52450-navarre)

Less More

- Posts: 18
- Thank you received: 7
-
-

2 years 1 month ago [\#363363](#363363) by [navarre](/forum/user/52450-navarre "View navarre's Profile")  Replied by *[navarre](/forum/user/52450-navarre "View navarre's Profile")* on topic *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#363363 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")*

Hello Nicolas

Unfortunately I am still experiencing an issue - after activating the setting for "Select the Highest Shipping Price"

My shipping method price is set at 8.50

When I add an item which has a higher shipping price defined at the product - the shipping is calculated at the 8.50 + the Product shipping of 12.50 and shows the value as 21.00

Any ideas where my mistake is ?

I am using HikaShop Business 5.1.1 [2409191121]

- [ ![2024-09-21&#95;18h23&#95;18.png](/forum/attachment/59771) ](/forum/attachment/59771 "...1&#95;18h23&#95;18.png") [ ](/forum/attachment/59771?download=1 "...1&#95;18h23&#95;18.png")
- [ ![2024-09-21&#95;18h25&#95;28.png](/forum/attachment/59772) ](/forum/attachment/59772 "...1&#95;18h25&#95;28.png") [ ](/forum/attachment/59772?download=1 "...1&#95;18h25&#95;28.png")
- [ ![2024-09-21&#95;18h27&#95;32.png](/forum/attachment/59773) ](/forum/attachment/59773 "...1&#95;18h27&#95;32.png") [ ](/forum/attachment/59773?download=1 "...1&#95;18h27&#95;32.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

2 years 1 month ago [\#363370](#363370) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Select the most expensive shipping method when several products are in the cart](/forum/28-shipping-methods/907346-select-the-most-expensive-shipping-method-when-several-products-are-in-the-cart#363370 "Hi, I need to charge to the customer only one shipping method when he chooses several products with different shipping costs, applying only the most expensive one.  For example, the customer orders three items: Item 1: shipping cost 4 € Item 2: shipping cost: 4 € Item 3: shipping cost 6 €  I'd like to have the customer pay only 6 € of shipping for all the items, only once. Note: shipping costs have been set using different Warehouses.  How to do it? Thank you Kind regards")*

Hi,

I don't see a problem with your screenshots.
As I said 9 months ago:

> Without the code change, HikaShop would use the sum of the shipping price of each product in the cart. With that change, it will only use the highest.

So, if you have a shipping method with a price of 5€, and that you have two products in the cart, one with a shipping price of 1€ and one with a shipping price of 2€, the total shipping cost will be calculated at 5+2=7€ instead of 5+2+1=8€.

There is no option where the base shipping price of the shipping method is ignored.
If you don't want that, then just set a base shipping price of 0 in the shipping method, and set that shipping price in each product for which there is is no extra cost than what you had as a base shipping price.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3NoaXBwaW5nLW1ldGhvZHMvOTA3MzQ2LXNlbGVjdC10aGUtbW9zdC1leHBlbnNpdmUtc2hpcHBpbmctbWV0aG9kLXdoZW4tc2V2ZXJhbC1wcm9kdWN0cy1hcmUtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.238 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
