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

#   Auto selected shipping method

##

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

Less More

- Posts: 51
- Thank you received: 0
-
-

8 years 11 months ago [\#281458](#281458) by [Bower](/forum/user/31321-bower "View Bower's Profile")  *[Auto selected shipping method](/forum/28-shipping-methods/892563-auto-selected-shipping-method#281458 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.8.1 -- PHP version -- : 5.6.36 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : None  We are sending out products from one of 2 distribution centers. Same products from both centers. I have set up 2 manual shipping options - one for each distribution center. I have also set up a custom checkbox field for each user to determine which distribution center their delivery will be shipped from. What I need is a way to automatically select the shipping method depending on the user field - I appreciate this may need some custom coding but if you point me in the right direction to which files I would need to edit - that would be a lot of help - thanks!")* was created by *[Bower](/forum/user/31321-bower "View Bower's Profile")*

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.8.1
-- PHP version -- : 5.6.36
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : None

We are sending out products from one of 2 distribution centers. Same products from both centers.
I have set up 2 manual shipping options - one for each distribution center. I have also set up a custom checkbox field for each user to determine which distribution center their delivery will be shipped from.
What I need is a way to automatically select the shipping method depending on the user field - I appreciate this may need some custom coding but if you point me in the right direction to which files I would need to edit - that would be a lot of help - thanks!

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

8 years 11 months ago [\#281464](#281464) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Auto selected shipping method](/forum/28-shipping-methods/892563-auto-selected-shipping-method#281464 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.8.1 -- PHP version -- : 5.6.36 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : None  We are sending out products from one of 2 distribution centers. Same products from both centers. I have set up 2 manual shipping options - one for each distribution center. I have also set up a custom checkbox field for each user to determine which distribution center their delivery will be shipped from. What I need is a way to automatically select the shipping method depending on the user field - I appreciate this may need some custom coding but if you point me in the right direction to which files I would need to edit - that would be a lot of help - thanks!")*

Hi,

The auto selection of the shipping method is done by a call to the checkCartMethods function of administrator/components/com_hikashop/classes/shipping.php when loading the cart in the getFullCart function of the administrator/components/com_hikashop/classes/cart.php file.
So you could directly change the checkCartMethods function code.
However, I would recommend either:
- creating a class override of the shipping class, extending the default class and implementing your own checkCartMethods function
- or event better, create your own hikashop plugin implementing the onAfterCartProductsLoad trigger to set the shipping id yourself in the $cart object and saving it in the database with the updateShipping function.

With the trigger solution, you'll have a more stable solution for future updates as it's not likely to change in the future.

The following user(s) said Thank You: [Bower](/forum/user/31321-bower "View Bower's Profile")

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

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

Less More

- Posts: 51
- Thank you received: 0
-
-

8 years 11 months ago [\#281657](#281657) by [Bower](/forum/user/31321-bower "View Bower's Profile")  Replied by *[Bower](/forum/user/31321-bower "View Bower's Profile")* on topic *[Auto selected shipping method](/forum/28-shipping-methods/892563-auto-selected-shipping-method#281657 "-- HikaShop version -- : 3.2.0 -- Joomla version -- : 3.8.1 -- PHP version -- : 5.6.36 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : None  We are sending out products from one of 2 distribution centers. Same products from both centers. I have set up 2 manual shipping options - one for each distribution center. I have also set up a custom checkbox field for each user to determine which distribution center their delivery will be shipped from. What I need is a way to automatically select the shipping method depending on the user field - I appreciate this may need some custom coding but if you point me in the right direction to which files I would need to edit - that would be a lot of help - thanks!")*

Thanks Nicolas

I will attempt the trigger solution!

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

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

[](#top)
