- Posts: 6
- Thank you received: 0
Understanding the "Add to Cart" AJAX call...
- webjocky
- Topic Author
- Offline
- New Member
-
Less
More
10 years 3 months ago #54796
by webjocky
Understanding the "Add to Cart" AJAX call... was created by webjocky
From an EShop Product module, when clicking on "Add to Cart" and then selecting "Continue shopping" from the resulting popup - the Shopping Cart mini view is completely overwritten with new HTML for the updated cart information.
I need to modify the HTML that this AJAX call uses to overwrite the cart's mini view - where can I find it?
I need to modify the HTML that this AJAX call uses to overwrite the cart's mini view - where can I find it?
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
-
- Offline
- Administrator
-
10 years 3 months ago #54810
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Understanding the "Add to Cart" AJAX call...
Hello,
You can find the cart mini view in the file: components/com_eshop/themes/default/views/cart/mini.php
Sincerely, Giang
You can find the cart mini view in the file: components/com_eshop/themes/default/views/cart/mini.php
Sincerely, Giang
Please Log in or Create an account to join the conversation.
- webjocky
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
10 years 3 months ago - 10 years 3 months ago #54843
by webjocky
Replied by webjocky on topic Understanding the "Add to Cart" AJAX call...
Yes, I already created a custom theme and I have edited that file - it looks great! However, every time you add an item to the cart, the mini view is overwritten with the default HTML again - until page refresh... this is what I need to fix
I guess the AJAX call is not pulling from the same file?
I found this in the eshop.js file:
Is there a variable missing to use the proper theme or something else?
I guess the AJAX call is not pulling from the same file?
I found this in the eshop.js file:
Code:
Line 49:
jQuery.ajax({
url: site + 'index.php?option=com_eshop&view=cart&layout=mini&format=raw'
Last edit: 10 years 3 months ago by webjocky.
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
-
- Offline
- Administrator
-
10 years 3 months ago #55061
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Understanding the "Add to Cart" AJAX call...
Hi again,
You should to update the mini cart module layout and the mini ajax layout from the EShop component:
1. components/com_eshop/themes/default/views/cart/mini.php
Sincerely, Giang
2. modules/mod_eshop_cart/tmpl/default.php
Hope that this will help.
Sincerely, Giang
You should to update the mini cart module layout and the mini ajax layout from the EShop component:
1. components/com_eshop/themes/default/views/cart/mini.php
Sincerely, Giang
2. modules/mod_eshop_cart/tmpl/default.php
Hope that this will help.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
- webjocky
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 6
- Thank you received: 0
10 years 2 months ago - 10 years 2 months ago #56450
by webjocky
Replied by webjocky on topic Understanding the "Add to Cart" AJAX call...
I finally found the file I was looking for. It took me forever!
Once something is added to the cart, the same AJAX call I referenced above is also in the following file:
components/com_eshop/assets/js/eshop.js
So to clarify for anyone else that needs to modify the minicart layout/functionality, you must edit all three of these files:
1. components/com_eshop/themes/default/views/cart/mini.php
2. modules/mod_eshop_cart/tmpl/default.php
3. components/com_eshop/assets/js/eshop.js
Giang, can you consolidate these AJAX calls (add to cart, remove from cart) for the cart mini view into the same file? It seems very redundant to have the same exact code in three different files all called at different times for the same purpose. Very difficult to find and troubleshoot mini cart view problems.
Thank you for your great support!
Once something is added to the cart, the same AJAX call I referenced above is also in the following file:
components/com_eshop/assets/js/eshop.js
So to clarify for anyone else that needs to modify the minicart layout/functionality, you must edit all three of these files:
1. components/com_eshop/themes/default/views/cart/mini.php
2. modules/mod_eshop_cart/tmpl/default.php
3. components/com_eshop/assets/js/eshop.js
Giang, can you consolidate these AJAX calls (add to cart, remove from cart) for the cart mini view into the same file? It seems very redundant to have the same exact code in three different files all called at different times for the same purpose. Very difficult to find and troubleshoot mini cart view problems.
Thank you for your great support!
Last edit: 10 years 2 months ago by webjocky.
Please Log in or Create an account to join the conversation.
- Giang Dinh Truong
-
- Offline
- Administrator
-
10 years 2 months ago #56514
by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Understanding the "Add to Cart" AJAX call...
Hello,
Actually, with ajax call to update the cart so I must put them in mini layout of component. The mini cart is updated from ajax call from module, ajax call from component so we have no other way to put them all in module.
Sincerely, Giang
Actually, with ajax call to update the cart so I must put them in mini layout of component. The mini cart is updated from ajax call from module, ajax call from component so we have no other way to put them all in module.
Sincerely, Giang
Please Log in or Create an account to join the conversation.
Moderators: Giang Dinh Truong
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.