Is there any way to add or remove product manually using AJAX

  • Posts: 29
  • Thank you received: 0
7 years 2 weeks ago #290713

I want to know way I can add an item to cart manually using AJAX, and get modules corresponding modules to be refreshed automatically using AJAX.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
7 years 2 weeks ago #290716

Hi,

You want to use the window.hikashop.addToCart and window.hikashop.deleteFromCart functions that you can find in media/com_hikashop/js/hikashop.js
These functions automatically refresh the cart modules on the page so you don't have to worry about that.

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

  • Posts: 29
  • Thank you received: 0
7 years 2 weeks ago #290795

Is there any way I can have "Add to Cart" button instead of "Choose option" in case of product option for "Gift Wrap", as it require one additional step for customer to add item to cart.
Is any I can have "Add to Cart" button instead of or with the "Choose option" to add specific item to cart with default value of option.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
7 years 2 weeks ago #290796

Hi,

Not with just the options.
You would have to edit the view file displaying the add to cart button to add hidden input fields similar to the input fields for the options on the product page so that the javascript add to cart would be able to take it into account.

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

  • Posts: 29
  • Thank you received: 0
7 years 2 weeks ago #290848

Will it be not a great feature to give ability "Add to Cart" button along with the "Choose Option" button that make it easy to add item to cart with default option value.

Hope you like the idea.

Thanks

Last edit: 7 years 2 weeks ago by manoj.infowind.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
7 years 2 weeks ago #290858

Wouldn't it be better in that case to have the options directly on the listing in that case ?

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

  • Posts: 29
  • Thank you received: 0
7 years 2 weeks ago #290923

No because in that user have to do two selection like quantity and option. I feel user wont like that.

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
7 years 2 weeks ago #290933

Hi,

For your case, maybe, but I'm talking about any kind of shops you could make with HikaShop. When we add a feature, we need to think about the big picture.

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

  • Posts: 29
  • Thank you received: 0
7 years 1 week ago #291006

BTW I have implemented it on my site.

Thanks for support.

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

Time to create page: 0.071 seconds
Powered by Kunena Forum