Cart block form shows remove button on child elements

Created on 10 October 2023, 9 months ago

Problem/Motivation

Cart block form is not working correctly. Shows children remove buttons thus allowing to decouple vado order items.

Steps to reproduce

1. Add vado product with at least 2 child variations to the cart.
2. Expose cart form in a block (view has both tags: commerce_cart_form and commerce_cart_block)
3. Click remove one of vado children order items from cart form in block.

Proposed resolution

Change line ~23 in commerce_vado.module from

    if ($view->storage->get('tag') == 'commerce_cart_form' && !empty($view->result)) {

to

    if (strpos($view->storage->get('tag'), 'commerce_cart_form') !== FALSE && !empty($view->result)) {

So cart blocks (original and custom) and any other commerce_cart_form in future are included in proper form alter.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇵🇱Poland gravisrs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024