'Bigcommerce: Can_modify field in Cart.yml
In bigcommerce we have this content.html we have this code for the x(close) button in the cart page:
{{#or can_modify (if type '==' 'GiftCertificate')}}
<button class="cart-remove icon"
data-cart-itemid="{{id}}"
data-confirm-delete="{{lang 'cart.confirm_delete'}}"
aria-label="{{lang 'cart.remove_item' name=name}}"
>
<svg><use xlink:href="#icon-close"></use></svg>
</button>
{{/or}}
Some products doesnt have the close button in it and I wonder where can I set the can_modify variable as it seems it is the reason. Any thoughts?
Solution 1:[1]
The can_modify conditional was added to Cornerstone 7 years ago in a commit titled "Hide modify buttons for child products". However, I have worked on hundreds of BigCommerce sites, and I have no idea what it means by "child products". As far as I know, any line item should be removable from the cart, at least in the new products V3 setup. Looking at the can_modify property in the cart stencil object doc, it appears there is no info on this.
I would argue that the can_modify property is deprecated, and can essentially be ignored. There is no way to control it from the admin, and it is not a property that can be adjusted via the cart API.
In conclusion, I would say if you want the remove button to appear on every item in the cart, simply delete the conditional altogether.
I will separately open an issue on the Cornerstone repository to ask about this item!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Matt Coy |
