useCartRemoveAttributes

A cart hook that helps you easily remove cart-level custom attributes.

// import
import { useCartRemoveAttributes } from '@backpackjs/storefront';

// instantiation
const { cartRemoveAttributes, ...removeAttrStatus } = useCartRemoveAttributes();

// use
const customAttributes = await cartRemoveAttributes({
  attributeKeys: ['AttributeKeyToRemove', ...]
});

attributeKeys

An array of custom attributes keys to delete ['acceptedTAndCs', 'withGiftWrap']

For line_item custom attributes see useCartAddItems, or useCartUpdateItems

Last updated