AJAX Add to cart - ajax

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 :)

Related

After update theme options how to update Woocommerce Cart Session?

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

Ajax Cart empty Prestashop 1.6

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!!

Simple configurable product conflict with ajax add to cart (Magento)

I have a problem with my site being once you click on add to cart and select a custom option this sets the price to 0.00 it will add the product with the options but uses the lowest priced product instead of the one selected i have browsed for the last few days and think I’ve narrowed it down to another plugin AJAX Excellence i think conflicting with SCP i got my info from this link but have no idea what I’m looking for.
This problem doesnt happen if you go through the product description page only on the product listing pages which brings up a pop up of options to add to cart
Your help will be appreciated.
Magento ver. 1.7.0.2

Magento Shopper Theme add to cart not working

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 .

Magento - Configurable products not visible until manually saved in admin panel

I have a script that is creating a lot of configurable products and their associated simple products.
Everything goes ok and when inspecting the products in the admin section, everything is linked up and looks great.
The problem is that the products are not visible until I manually go to the admin section and save the configurable product - without changing any options - and then each simple product that is associated with it. After each simple product is saved, its option becomes available on the from end for the configurable product.
Does anyone have any ideas on this?
Solved this by going through the saveAction in the Mage_Adminhtml_Catalog_ProductController.
I wasn't setting the websiteIds correctly so the new products were never getting added to the site correctly.
Magento uses this piece of code to get the correct website:
$product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
Drew's answer above worked for me. For those using the REST API, this option is under extension_attributes like so:
"extension_attributes": {
"website_ids": [1]
}
Where 1 (for me) was the id of the website where I wanted the product to appear.

Resources