Update cart using Ajax for update quantity

  • Posts: 29
  • Thank you received: 0
12 years 4 months ago #32674

Hi,

Using your great tool i could implement an good website for a restaurant. The work is almost done except the main requirement from client. They are ok with all the features and facilities but they need to update the quantity in product page and in cart using AJAX. They didnt like the option of refreshing the page while updating the quantity.

So kindly help me in solving this issue. Please let me know how we can implement this even if the requested feature is not available in your system.

Regards,
Binoy

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
12 years 4 months ago #32702

Hi,

On the product page, there is a + and - sign to change the value in the quantity input field. That doesn't require any modifications.

For the quantity of the products in the cart module, you will have to edit the file "cart" of the view "product" via the menu Display->Views and add you AJAX code there. You can just call the add to cart in AJAX so that it returns the new content of the HikaShop cart and replace the module with that new content.
You can look at the file adminsitrator/components/com_hikashop/helpers/cart.php to see how we did it for the product page add to cart button.

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

  • Posts: 29
  • Thank you received: 0
12 years 4 months ago #33154

Hi Nicolas,

I tried the option you have tried but i am not sure how we will pass the new selected value to the displayButton function. Please give some more clarity on the method.
I have checked the helper function also but i couldnt make out the logic that you have used in it much. So please guide me to solve this issue.

Regards,
Binoy

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
12 years 4 months ago #33192

The displayButton function is a PHP function.
The code you want to look at is the javascript code in the getJS function of that file.

That's where there is the ajax request made to the server to add the product to the cart and where the new cart module HTML is returned and put in place of the old HTML.

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

  • Posts: 28
  • Thank you received: 0
8 years 4 months ago #223519

Hi there !

I just read this topic and realize it was an old one. Is there any other solutions since the last answer ? Or coming soon ?

The ajax "add to cart" is awesome, but I can't find any option for a real ajax cart (updating quantity etc.).

Any idea on this ?

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
8 years 4 months ago #223560

Hi,

We're currently working on a new cart and checkout system which will allow for that.
You can see a sneak peek of that here:
twitter.com/Obsidev

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

  • Posts: 28
  • Thank you received: 0
8 years 4 months ago #224207

Great news !!

Do you know when it will be ready ? My client is asking me again and again.... ;)

Regards,
F

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

  • Posts: 12953
  • Thank you received: 1778
8 years 4 months ago #224212

Hello,
We are currently working on it to do it as fast as we can. The new cart and checkout system will probably be available through the following months.

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

  • Posts: 112
  • Thank you received: 3
8 years 2 months ago #228813

There is some functionality needed in the cart that is being requested by a client of ours. I am not sure if these features are available or not. So, your help is appreciated:

1. The product names are showing in the the cart as product name:variant1name variant2name. I do not want the variant name to show. The setting "Display the characteristics name" is already set to "NO".
2. Is there a way to get the price totals in the cart to update automatically when a change to the quantity is made? If not, is there a refresh button that can be added like the one in the checkout?

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
8 years 2 months ago #228823

Hi,

1. You should be able to hide the variant name with a bit of CSS code. Just look at it with your browser HTML inspector to get the CSS class to use.

2. It's already the case. Change the quantity in the quantity field and click somewhere else on the page. That will refresh the cart module. You can always add a refresh img tag to the cart module by editing the file "cart" of the view "product" via the menu Display>Views so that the users click there. It will do the refresh automatically like when the user click somewhere else.

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

  • Posts: 28
  • Thank you received: 0
8 years 1 month ago #232321

Hi there !

Any news about the new cart system? Will it be ready soon ? I'm working for a client and finishing it's website at the end of the month and I want to be able to give him an answer about that option.

Thanks !

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

  • Posts: 81562
  • Thank you received: 13071
  • MODERATOR
8 years 1 month ago #232322

Hi,

We still have work on it. It won't be for the end of the month.

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

Time to create page: 0.113 seconds
Powered by Kunena Forum