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

#   Shipping price

##

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

Less More

- Posts: 75
- Thank you received: 4
-
-

3 years 1 day ago [\#356527](#356527) by [Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")  *[Shipping price](/forum/28-shipping-methods/907254-shipping-price#356527 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.1  Hello, I would like to make a dynamic shipping plugin which connect to the shipping company through an API, send there the number and size of packages and get back a shipping price.  My question is how I can implement this funuctionality to a one page checkout page.  So the shipping price will be depends on the customers address. If the customer fill up the address and country I would need to run the API query to get the shipping price. Which funcion can I use for this? Or should I add a custom button like &quot;Calculate shipping&quot; and runu my function on click?  What I need to modify to add the calculated shipping price to the cart?  Thanks")* was created by *[Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")*

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 4.4.0
-- PHP version -- : 8.1

Hello,
I would like to make a dynamic shipping plugin which connect to the shipping company through an API, send there the number and size of packages and get back a shipping price.

My question is how I can implement this funuctionality to a one page checkout page.

So the shipping price will be depends on the customers address. If the customer fill up the address and country I would need to run the API query to get the shipping price.
Which funcion can I use for this? Or should I add a custom button like "Calculate shipping" and runu my function on click?

What I need to modify to add the calculated shipping price to the cart?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvOTA3MjU0LXNoaXBwaW5nLXByaWNlP3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14296
-
-

3 years 1 day ago [\#356529](#356529) 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](/forum/28-shipping-methods/907254-shipping-price#356529 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.1  Hello, I would like to make a dynamic shipping plugin which connect to the shipping company through an API, send there the number and size of packages and get back a shipping price.  My question is how I can implement this funuctionality to a one page checkout page.  So the shipping price will be depends on the customers address. If the customer fill up the address and country I would need to run the API query to get the shipping price. Which funcion can I use for this? Or should I add a custom button like &quot;Calculate shipping&quot; and runu my function on click?  What I need to modify to add the calculated shipping price to the cart?  Thanks")*

Hi,

Well, let's first talk about the current situation of the HikaShop checkout and shipping.

HikaShop already comes with several shipping plugins which connect to a shipping company through an API providing the address of the user, the number and size of packages, etc and get back the shipping fee. You can find these in the folder plugins/hikashopshipping/ of your website. I would recommend looking at the ups2 one, which is the latest we developed, and the cleanest, but it's only there if you have HikaShop 5.0.0 installed.

You can also have a one page checkout with HikaShop (the checkout is actually configured as a one page checkout by default).
However, if you have a shipping method for a plugin which requires the address of the user to calculate the shipping fee, like these plugins, the customer will have to first validate the guest shipping address so that the shipping fees can be updated before finishing the checkout.

Finally, note that our marketplace also has a shipping estimation plugin available here:
[ www.hikashop.com/marketplace/product/244...tion-by-obsidev.html](https://www.hikashop.com/marketplace/product/244-shippingestimation-by-obsidev.html)
With it, you can allow customers to directly pre caclulate their shipping fee for a particular product even before they have it in the cart, or provided their full address. The plugin will just ask the customer for the necessary information (like the post code and the country) to be able to retrieve the information.

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

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

Less More

- Posts: 75
- Thank you received: 4
-
-

2 years 11 months ago [\#356973](#356973) by [Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")  Replied by *[Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")* on topic *[Shipping price](/forum/28-shipping-methods/907254-shipping-price#356973 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.1  Hello, I would like to make a dynamic shipping plugin which connect to the shipping company through an API, send there the number and size of packages and get back a shipping price.  My question is how I can implement this funuctionality to a one page checkout page.  So the shipping price will be depends on the customers address. If the customer fill up the address and country I would need to run the API query to get the shipping price. Which funcion can I use for this? Or should I add a custom button like &quot;Calculate shipping&quot; and runu my function on click?  What I need to modify to add the calculated shipping price to the cart?  Thanks")*

I made a multi step cart, connected to shipping company API inside the onShippingDisplay.
I have the API response, and saved the shipping price in a variable $shippingPrice

How can I display this price next to the shipping method name and add this value as shipping price before the customer pays.
Looks like it's a one last step, but can't figure it out.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvOTA3MjU0LXNoaXBwaW5nLXByaWNlP3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86359
- Thank you received: 14296
-
-

2 years 11 months ago [\#356977](#356977) 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](/forum/28-shipping-methods/907254-shipping-price#356977 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.4.0 -- PHP version -- : 8.1  Hello, I would like to make a dynamic shipping plugin which connect to the shipping company through an API, send there the number and size of packages and get back a shipping price.  My question is how I can implement this funuctionality to a one page checkout page.  So the shipping price will be depends on the customers address. If the customer fill up the address and country I would need to run the API query to get the shipping price. Which funcion can I use for this? Or should I add a custom button like &quot;Calculate shipping&quot; and runu my function on click?  What I need to modify to add the calculated shipping price to the cart?  Thanks")*

Hi,

In the parameters of the onShippingDisplay method, you have the parameters $methods and $usable_methods Code:

onShippingDisplay(&amp;$order,&amp;$methods,&amp;$usable_methods,&amp;$messages)

In $methods you have all the shipping methods prefiltered by HikaShop.
In $usable_methods you have an empty array.
So what you need to do is to make a copy of your shipping method data from $methods, overwrite the shipping_price with the fee retrieved from your shipping company and then add that copy in $usable_methods so that HikaShop can use it as an available shipping method on the checkout.

The following user(s) said Thank You: [Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")

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

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