I need Ajax response code on checkout

  • Posts: 95
  • Thank you received: 0
6 years 1 month ago #288403

-- url of the page with the problem -- : test.drtuba.eu/shop/cart/checkout
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.3
-- PHP version -- : 5.6.26
-- Browser(s) name and version -- : mozila firfox
-- Error-message(debug-mod must be tuned on) -- : I need to modify ajax response of checkout.

Hello Team,

I want to update some fields at the time of ajax response but I unable to find ajax code where it is updating html elements.

So Please let me know where I can get it and how I can change values so my custo html elemnt can get values. (LIKE TOTAL PRICE after change shipping method.

Please have a look this website url.
test.drtuba.eu/shop/

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
6 years 1 month ago #288404

Hi,

You can use such javascript code:

window.Oby.registerAjax(['checkout.shipping.updated'], function(params){
	// your code for when shipping method selection is updated
});
If you check the different show_block_ view files of the view "checkout", you'll find similar pieces of code which register javascript code to do stuff when something changes (mainly refresh some of the blocks when some other blocks are changed).

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 0
6 years 1 month ago #288528

Hi,
I know about it, But I need place where I can replace value after ajax responded.
But here values getting before ajax responded. So please let me know file where ajax making or code that is called last.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
6 years 1 month ago #288531

Hi,

No, this code is triggered after the AJAX call, not before.... but maybe we're not talking about the same thing ?
What javascript code do you need to run exactly ? For what purpose ?

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 0
6 years 1 month ago #288561

But when I am adding some code after ajax it is calling before ajax response.

I want to update bottom price that is showing top of Place order Button,
I have added it. SO I want to do when any event change like qunatiry update, shipping method or any other what changes total price I want to update bottom price as well.
Please have a look screenshot :http://prntscr.com/ij1ic8

My website URL : test.drtuba.eu/shop/

Thanks in advance.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
6 years 1 month ago #288567

Hi,

So from what I understand, you want to add your javascript at the end of the "show_block_cart" view file via the menu Display>Views. That way, your javascript will be executed each time the cart view is refreshed. And it will refresh each time the full total changes.

Please Log in or Create an account to join the conversation.

  • Posts: 95
  • Thank you received: 0
6 years 1 month ago #288573

Hello ,
Please reply me I need your help.

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288588

Hello,

I'm sorry but Nicolas did reply ; so I don't know what you're asking...


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
5 years 8 months ago #296001

Hi,

How could i add some javascript after checkout guest user information submit?

Basically i need to execute some js after this button submit:

<button type="submit" onclick="window.checkout.submitLogin(2,1, 'register'); return false;" class=" btn btn-primary  btn-xs-wide hikabtn_checkout_login_register" id="hikashop_register_form_button">Next</button>

Couldn't find any register ajax for this.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
5 years 8 months ago #296002

Please ignore found it :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum