- 🇮🇹Italy apaderno Brescia, 🇮🇹
I am replacing the duplicate issue tags used in the past. I apologize for bumping this issue.
The Commerce module version 7.x-1.11 contains a fix Remove the default product entity from the form state just prior to caching → . A side effect of this update is, that the price on the Add to cart page is no longer updating, when changes are made in the form on that page.
The problematic bit of code introduced by that change:
* After build callback for Add to Cart forms
*/
function commerce_cart_add_to_cart_form_after_build(&$form, &$form_state) {
// Remove the default_product entity to mitigate cache_form bloat and performance issues.
if (isset($form_state['default_product'])) {
$form_state['default_product_id'] = $form_state['default_product']->product_id;
unset($form_state['default_product']);
}
return $form;
}
...is in conflict with the submit function of the Commerce Pricing Attributes module:
function commerce_pricing_attributes_add_to_cart_submit($form, $form_state){
if (isset($form_state['default_product'])) {
$current_product = $form_state['default_product'];
}
elseif (isset($form_state['products'])) {
$current_product = reset($form_state['products']);
}
else {
return;
}
.............
}
So changing a value, or clicking the add to card button does not change the product price.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I am replacing the duplicate issue tags used in the past. I apologize for bumping this issue.