Open jbeales opened 7 years ago
Confirmed that this is a regression from #2295. I imagine when we're syncing the product model, we need to be passing the expected variation data if it exists. Though it seems we've made some effort to do that...so....hmmm. This is where I beg @jtsternberg to take a look 😂
Additional comment, (probably related, but it could be dealt with in a separate issue): When selecting a variation on the product page, we the price is no longer updated like it used to be in TEv1.
Just my thoughts on this.
re the additional comment, i believe its not working at the moment because the new theme engine is not ajaxified yet.
On the first issue, i found it confusing to see the issue cause i know for a fact the variations are working on our website wpecommerce.org and are visible on the checkout page.
Did some digging and i found (and tested locally and on wpec.org) that with this line of code added in the themes functions.php file disables the notifications BUT also fixes the issue reported in this issue
add_filter( 'wpsc_do_cart_notifications', '__return_false' );
Enabling the filter seems to "break" it as john has reported.
Re: product-dom-to-model.js, we really need to do away with that hack, and instead pass any product data as a proper model to the JS. This means that whenever a product is fetched on the frontend, we need to queue it as a model that should be localized for JS. This would be far more reliable than trying to parse from the dom. We would need to tie the products to those models. IIRC, I did add a product id data attribute to most of the products output, so that would definitely be the best way to map them.
The other option is do the model fetching via JS/ajax whenever a product is interacted with (via adding to cart).
When using TEv2, and adding a product with variations to the cart, the variation information does not get saved, only the root product gets added to the cart.
The mostly-correct variation information is shown in the "Added to Cart" dialog box, but the cart total is shown as zero, and if the variation modifies the price of the product that modification is not displayed, (the price of the root product is displayed), however, when I get to the Checkout page only the root product is in the cart.