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

#   shipping price based on one of the products

##

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

Less More

- Posts: 18
- Thank you received: 0
-
-

9 years 4 months ago [\#272234](#272234) by [schipperskwartier](/forum/user/36743-schipperskwartier "View schipperskwartier's Profile")  *[shipping price based on one of the products](/forum/25-install-update/890778-shipping-price-based-on-one-of-the-products#272234 "-- url of the page with the problem -- :   ramblas.rocks/  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.7 -- Browser(s) name and version -- : chrome 59.0.3071.104  Ramblas is a big street festival in Antwerp. The stands are to be rented in different settings. Two of the most important differences are: FOOD and NONFOOD. Every standholder - who rents an stand - pays a deposit. They have to leave their place clean, otherwise they will lose their deposit. FOOD-Standholders pay a different deposit than NONFOOD-Standholders: FOOD=100€, NONFOOD=30€. This is per order, not per product. The deposit will be the shipping cost, standard 30€.  Every standholder can rent multiple stands. So, par example, a standholder can rent 2 stands; 1 FOOD and 1 NONFOOD.  If a standholder has rented ANY FOOD-stand in the order, then he has to deposit 100€. If the order contains no FOOD stands, then the deposit is 30€  Now comes the hard part :) I can make a foreach to traverse the order, searching for a FOOD stand and break when found. If found, then I have to change the shipping costs (=deposit) into 100€.  EXAMPLE. Standholder rents 1 stand FOOD (type S) and 1 stand NONFOOD (type H). In the foreach the FOOD-type S is found, so the shipping cost has to be altered in 100€.  I did that in the checkout (/templates/&#91;the&#95;template&#95;name&#93;/html/com&#95;hikashop/checkout/cart.php. So far so good; Hikashop shows the corect shipping cost. But it does not change the values in the order.  Where/how can I change the shipping cost AND the total cost in the MySQL-order table? Or is there a more intelligent way to accomplish what I'm trying to do?  Thanks!")* was created by *[schipperskwartier](/forum/user/36743-schipperskwartier "View schipperskwartier's Profile")*

-- url of the page with the problem -- : [ ramblas.rocks/](http://ramblas.rocks/)
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.7
-- Browser(s) name and version -- : chrome 59.0.3071.104

Ramblas is a big street festival in Antwerp. The stands are to be rented in different settings.
Two of the most important differences are: FOOD and NONFOOD.
Every standholder - who rents an stand - pays a deposit. They have to leave their place clean, otherwise they will lose their deposit.
FOOD-Standholders pay a different deposit than NONFOOD-Standholders: FOOD=100€, NONFOOD=30€. This is **per order**, not per product. The deposit will be the shipping cost, standard 30€.

Every standholder can rent multiple stands. So, par example, a standholder can rent 2 stands; 1 FOOD and 1 NONFOOD.

If a standholder has rented ANY FOOD-stand in the order, then he has to deposit 100€.
If the order contains no FOOD stands, then the deposit is 30€

Now comes the hard part ![:)](/media/kunena/emoticons/8.png ":)")
I can make a foreach to traverse the order, searching for a FOOD stand and break when found.
If found, then I have to change the shipping costs (=deposit) into 100€.

EXAMPLE.
Standholder rents 1 stand FOOD (type S) and 1 stand NONFOOD (type H).
In the foreach the FOOD-type S is found, so the shipping cost has to be altered in 100€.

I did that in the checkout (/templates/[the_template_name]/html/com_hikashop/checkout/cart.php.
So far so good; Hikashop shows the corect shipping cost.
But it does not change the values in the order.

Where/how can I change the shipping cost AND the total cost in the MySQL-order table?
Or is there a more intelligent way to accomplish what I'm trying to do?

Thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg5MDc3OC1zaGlwcGluZy1wcmljZS1iYXNlZC1vbi1vbmUtb2YtdGhlLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

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

9 years 4 months ago [\#272239](#272239) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[shipping price based on one of the products](/forum/25-install-update/890778-shipping-price-based-on-one-of-the-products#272239 "-- url of the page with the problem -- :   ramblas.rocks/  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.7 -- Browser(s) name and version -- : chrome 59.0.3071.104  Ramblas is a big street festival in Antwerp. The stands are to be rented in different settings. Two of the most important differences are: FOOD and NONFOOD. Every standholder - who rents an stand - pays a deposit. They have to leave their place clean, otherwise they will lose their deposit. FOOD-Standholders pay a different deposit than NONFOOD-Standholders: FOOD=100€, NONFOOD=30€. This is per order, not per product. The deposit will be the shipping cost, standard 30€.  Every standholder can rent multiple stands. So, par example, a standholder can rent 2 stands; 1 FOOD and 1 NONFOOD.  If a standholder has rented ANY FOOD-stand in the order, then he has to deposit 100€. If the order contains no FOOD stands, then the deposit is 30€  Now comes the hard part :) I can make a foreach to traverse the order, searching for a FOOD stand and break when found. If found, then I have to change the shipping costs (=deposit) into 100€.  EXAMPLE. Standholder rents 1 stand FOOD (type S) and 1 stand NONFOOD (type H). In the foreach the FOOD-type S is found, so the shipping cost has to be altered in 100€.  I did that in the checkout (/templates/&#91;the&#95;template&#95;name&#93;/html/com&#95;hikashop/checkout/cart.php. So far so good; Hikashop shows the corect shipping cost. But it does not change the values in the order.  Where/how can I change the shipping cost AND the total cost in the MySQL-order table? Or is there a more intelligent way to accomplish what I'm trying to do?  Thanks!")*

Hi,

Why not simply use the weight or volume restrictions of your shipping methods:
You create two shipping methods, one with a max volume of 0.5 with a price of 30 and one with a min volume of 0.5 with a price of 100.
Then, for the products for which the shipping price need to be 100, set dimensions of 1, 1, 1 and otherwise keep the dimensions at 0 for the other products.
And then, the system will switch between both shipping methods automatically based on the products in the cart without one line of custom code.

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

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

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

Less More

- Posts: 18
- Thank you received: 0
-
-

9 years 4 months ago [\#272261](#272261) by [schipperskwartier](/forum/user/36743-schipperskwartier "View schipperskwartier's Profile")  Replied by *[schipperskwartier](/forum/user/36743-schipperskwartier "View schipperskwartier's Profile")* on topic *[\[SOLVED\] shipping price based on one of the products](/forum/25-install-update/890778-shipping-price-based-on-one-of-the-products#272261 "-- url of the page with the problem -- :   ramblas.rocks/  -- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.2 -- PHP version -- : 7.0.7 -- Browser(s) name and version -- : chrome 59.0.3071.104  Ramblas is a big street festival in Antwerp. The stands are to be rented in different settings. Two of the most important differences are: FOOD and NONFOOD. Every standholder - who rents an stand - pays a deposit. They have to leave their place clean, otherwise they will lose their deposit. FOOD-Standholders pay a different deposit than NONFOOD-Standholders: FOOD=100€, NONFOOD=30€. This is per order, not per product. The deposit will be the shipping cost, standard 30€.  Every standholder can rent multiple stands. So, par example, a standholder can rent 2 stands; 1 FOOD and 1 NONFOOD.  If a standholder has rented ANY FOOD-stand in the order, then he has to deposit 100€. If the order contains no FOOD stands, then the deposit is 30€  Now comes the hard part :) I can make a foreach to traverse the order, searching for a FOOD stand and break when found. If found, then I have to change the shipping costs (=deposit) into 100€.  EXAMPLE. Standholder rents 1 stand FOOD (type S) and 1 stand NONFOOD (type H). In the foreach the FOOD-type S is found, so the shipping cost has to be altered in 100€.  I did that in the checkout (/templates/&#91;the&#95;template&#95;name&#93;/html/com&#95;hikashop/checkout/cart.php. So far so good; Hikashop shows the corect shipping cost. But it does not change the values in the order.  Where/how can I change the shipping cost AND the total cost in the MySQL-order table? Or is there a more intelligent way to accomplish what I'm trying to do?  Thanks!")*

Thanks Nicolas! Man... I feel really awkward by not thinking of this simple solution!
But since dimensions are already in use (for the dimensions of the stand), I took the product_**weight** instead, with the same principle:

- max weight 0.5g = 30€
- min weight 0.5g = 100€

Made a short test: works!
Thanks again!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg5MDc3OC1zaGlwcGluZy1wcmljZS1iYXNlZC1vbi1vbmUtb2YtdGhlLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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.176 seconds

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

[](#top)
