I have a custom theme options page ( In WordPress Site ) and in that option I have a couple of options for WooCoommerce Mini Cart Customization.
Everything works fine as expected but every time I update some option from backend I can't see that changes right way in frontend due to WooCommerce Cart Session.
As you know WooCommerce mini cart Or custom cart won't be updated automatically if that cart is going through add_to_cart_fragments, So, every time after changing the options I need to update cart session by doing add to cart, remove cart item or update cart item etc.
Honestly, I'm little clueless here, All I want to do is after an update my theme options from backend I want to clear WooCommerce cart session/cache, So, I can see the changes right way without updating or adding anything.
I know WooCommerce cart session can be updated through an ajax But if I going to update theme options in the backend I how can run an ajax in the frontend that will clear WooCommerce cart session for me?
Or have anyone have an idea about it. let me know if you guys don't get me what really I want to do.
Hope it makes sense.
Thanks
Related
I've got an issue with AJAX add to cart button on single-product.php.
By now everything works as it should, but with last woocommerce update i've got a problem with variable products.
Everything is fine on simple products, on variable i can also add product to cart, but unfortunetly there is no variation picked while all attributes is selected.
Here You got an example of issue: Product page.
If You add product to cart it will apear there, but as a simple product not variation.
I'm using X for Woocommerce plugin for swatches - when i disable it, everything works fine, but with no AJAX. I need it not only for swatches, but also minicart is powered by AJAX and after reloading page it doesn't work.
I hope someone could help me.
Best regards, Kuba
Please check your DevTools console (F12). There are multiple errors about jQuery being not loaded and "add to cart" scripts mentioned.
I bet that hidden field containing the selected variation ID does not change when you select some variation because there is a problem with jQuery. It stays with the default value which is the parent product ID. So the parent product is added to your cart.
There's a bug in WPML plug-in:
https://wpml.org/errata/wp-6-0-issues-with-terms-assigned-to-posts,
pozdrawiam :)
I am having issue with add to cart ajax functionality after Woocommerce plugin update. It does add product in the cart but do not show in the counter without refreshing a page.
I have checked at server side there is no cache on.
Can anyone help me in this?
Thanks in Advance.
In prestashop 1.6
Using Ajax-cart
If i log-in as a Customer and add products to the cart and checkout the order all work.
Then the ajax cart stop working.
If I add a product to the cart and refresh the page the cart return
empty.
If i add a product to the cart and click "go to cart" the cart return empty.
If i log out and log in again, the cart return working for an order, then if i checkout the new order the problem return.
seem to be a problem whith Cookie the is overwritter in some ajax call in ajax-cart.js
I've look this but is not my case :Cart products dissapear on refresh page Prestashop
If i disable ajax cart all work fine.
EDIT
On Google i've found something and seem to be an ajax problem but all the solution suggested don't work.
I was also facing the same issue. You should try the following module and try last two options from the module's configuration and this issue will be gone:
https://github.com/PrestaShop/pscleaner
IMPORTANT: If you are trying it on live site make sure you do not enable first options in this module i.e. Clean up Customers, Clean up Catalog & Orders.
Reply back if you still face the issue.
Cheers!!
I'm going to be starting a E-Commerce project and the client is interested in using Magento. In this project, when a customer adds something to the cart, I'll need to pull them out of the flow, where they'll proceed through a custom wizard-esque area.
They basically design a document using a drag and drop interface. After they finish, that document will be saved as a PDF, and I want them redirected to checkout
So my questions are
Does Magento have hooks available for after an item is added to the
cart ?
If I pull them away to this other section of the site (Wizard
portion), changes they make will potentially add costs to
their cart. Would I still have access to products, prices, and the
cart so that I can continue to modify their cart until they return
to checkout ?
Magento users Event-Observer pattern, where you can hook into virtually any action which is performed and execute your custom code,
Refer to below links,
http://inchoo.net/category/ecommerce/magento/events-observers/
https://gist.github.com/peterjaap/6973324
http://huztechbuzz.wordpress.com/2014/04/26/complete-list-of-all-events-in-magento/
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
So you have to figure out which event you can use and plugin your custom code.
As long as i remember all the cart info ( products/prices ) is stored in the $_SESSION. So you can get all the information from there you need, modify it via your so-called wizzard and udpate the session information after that!
Cheers! :)
I'm using the Magento Shopper Theme (http://shopper.queldorei.com/).
When I add a product to cart, cart doesn't update and show the products added to cart. But if I refresh the page, then it shows the products added in the cart.
Does anybody have an idea of what to do to fix this?
This is your problem. Use chromes debugger to debug ajax requests. Also, you are including jquery but it doesn't exist at the URL specified.
Please Check you have included more that 1 jquery files .