- Posts: 29
- Thank you received: 0
Update cart using Ajax for update quantity
14 years 9 months ago #32674
by binoy_p_v
Update cart using Ajax for update quantity was created by binoy_p_v
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
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.
14 years 9 months ago #32702
by nicolas
Replied by nicolas on topic Re: Update cart using Ajax for update quantity
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.
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.
14 years 9 months ago #33154
by binoy_p_v
Replied by binoy_p_v on topic Re: Update cart using Ajax for update quantity
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
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.
14 years 9 months ago #33192
by nicolas
Replied by nicolas on topic Re: Update cart using Ajax for update quantity
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.
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.
10 years 9 months ago #223519
by AntinJH
Replied by AntinJH on topic Re: Update cart using Ajax for update quantity
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 ?
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.
10 years 9 months ago #223560
by nicolas
Replied by nicolas on topic Re: Update cart using Ajax for update quantity
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
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.
10 years 9 months ago #224207
by AntinJH
Replied by AntinJH on topic Re: Update cart using Ajax for update quantity
Great news !!
Do you know when it will be ready ? My client is asking me again and again....
Regards,
F
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.
Less
More
- Posts: 12953
- Thank you received: 1778
10 years 9 months ago #224212
by Mohamed Thelji
Replied by Mohamed Thelji on topic Re: Update cart using Ajax for update quantity
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.
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.
Less
More
- Posts: 112
- Thank you received: 3
10 years 7 months ago #228813
by tbroderick
Replied by tbroderick on topic Re: Update cart using Ajax for update quantity
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?
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.
10 years 7 months ago #228823
by nicolas
Replied by nicolas on topic Re: Update cart using Ajax for update quantity
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.
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.
10 years 6 months ago #232321
by AntinJH
Replied by AntinJH on topic Re: Update cart using Ajax for update quantity
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 !
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.
10 years 6 months ago #232322
by nicolas
Replied by nicolas on topic Re: Update cart using Ajax for update quantity
Hi,
We still have work on it. It won't be for the end of the month.
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.241 seconds