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

#   How to refresh a module with ajax based on checkout shipping method?

##

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

Less More

- Posts: 282
- Thank you received: 42
-
-

5 years 7 months ago -  5 years 7 months ago [\#331120](#331120) by [oxido](/forum/user/29793-oxido "View oxido's Profile")  *[How to refresh a module with ajax based on checkout shipping method?](/forum/31-development/902249-how-to-refresh-a-module-with-ajax-based-on-checkout-shipping-method#331120 "-- url of the page with the problem -- : -- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25  Hi, I have create a module which is taking his details from the cart. I configurated this module to be visible in Hikashop Checkout, using the text view, by adding this tag to load the module. . And now, i need the module to refresh himself when the shipping method is changed, how can I do this? Please give me as many details, javascript it's not my strong point. Loading the module in checkout  Visible in Front-page")* was created by *[oxido](/forum/user/29793-oxido "View oxido's Profile")*

-- url of the page with the problem -- : This message contains confidential information

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25

Hi,
I have create a module which is taking his details from the cart.
I configurated this module to be visible in Hikashop Checkout, using the **text view**, by adding this tag to load the module. Code:

{module id="116:Hikashop Custom Module" showtitle="false"}

.
And now, i need the module to refresh himself when the shipping method is changed, how can I do this?
Please give me as many details, javascript it's not my strong point.
**Loading the module in checkout**
[ ![oxido&#95;custom&#95;module.jpg](/forum/attachment/52364) ](/forum/attachment/52364 "...tom&#95;module.jpg")

**Visible in Front-page**
[ ![oxido&#95;ajax&#95;module.jpg](/forum/attachment/52365) ](/forum/attachment/52365 "...jax&#95;module.jpg")

- [ ![oxido&#95;custom&#95;module.jpg](/forum/attachment/52364) ](/forum/attachment/52364 "...tom&#95;module.jpg") [ ](/forum/attachment/52364?download=1 "...tom&#95;module.jpg")
- [ ![oxido&#95;ajax&#95;module.jpg](/forum/attachment/52365) ](/forum/attachment/52365 "...jax&#95;module.jpg") [ ](/forum/attachment/52365?download=1 "...jax&#95;module.jpg")

Last edit: 5 years 7 months ago by [oxido](/forum/user/29793-oxido "View oxido's Profile"). Reason: I have attached the module.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjI0OS1ob3ctdG8tcmVmcmVzaC1hLW1vZHVsZS13aXRoLWFqYXgtYmFzZWQtb24tY2hlY2tvdXQtc2hpcHBpbmctbWV0aG9kP3RtcGw9bWFya2Rvd24=) 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: 86289
- Thank you received: 14265
-
-

5 years 7 months ago [\#331146](#331146) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to refresh a module with ajax based on checkout shipping method?](/forum/31-development/902249-how-to-refresh-a-module-with-ajax-based-on-checkout-shipping-method#331146 "-- url of the page with the problem -- : -- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25  Hi, I have create a module which is taking his details from the cart. I configurated this module to be visible in Hikashop Checkout, using the text view, by adding this tag to load the module. . And now, i need the module to refresh himself when the shipping method is changed, how can I do this? Please give me as many details, javascript it's not my strong point. Loading the module in checkout  Visible in Front-page")*

Hi,

Well, a simple solution would be to add the code of your module directly in one of the view files which is refreshed when the shipping method is changed.
For example, you have the "status" view which just displays the selected shipping and payment methods. If you don't use it, you could repurpose it with your own code to display your custom content on the checkout and the show_block_status where you would add your code already has the javascript code to refresh itself when the shipping method is changed: Code:

&lt;script type="text/javascript"&gt; if(!window.checkout) window.checkout = {}; window.Oby.registerAjax(['checkout.shipping.updated','checkout.payment.updated'], function(params){ window.checkout.refreshStatus(&lt;?php echo (int)$this-&gt;step; ?&gt;, &lt;?php echo (int)$this-&gt;module_position; ?&gt;); }); window.checkout.refreshStatus = function(step, id) { return window.checkout.refreshBlock('status', step, id); }; &lt;/script&gt;

Now if you want to stick to your solution with the loadposition in the "text" view, you would need to add such similar javascript to the show_block_text view file via the menu Display&gt;Views.

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

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

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

Less More

- Posts: 282
- Thank you received: 42
-
-

5 years 5 months ago [\#332041](#332041) by [oxido](/forum/user/29793-oxido "View oxido's Profile")  Replied by *[oxido](/forum/user/29793-oxido "View oxido's Profile")* on topic *[How to refresh a module with ajax based on checkout shipping method?](/forum/31-development/902249-how-to-refresh-a-module-with-ajax-based-on-checkout-shipping-method#332041 "-- url of the page with the problem -- : -- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25  Hi, I have create a module which is taking his details from the cart. I configurated this module to be visible in Hikashop Checkout, using the text view, by adding this tag to load the module. . And now, i need the module to refresh himself when the shipping method is changed, how can I do this? Please give me as many details, javascript it's not my strong point. Loading the module in checkout  Visible in Front-page")*

For future me and others:

edit the view: checkout / show_block_status.php Code:

// Create a position for module: checkout-position // prepare content to be rendered corectly with "content.prepare". echo JHtml::_('content.prepare', '{loadposition checkout-position}');

Now you can set any module to be visible to this position, and it will be refreshed by ajax.

*PS. Thx nicolas!*

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

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

[](#top)
