Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Checkout UI] Add removeAttribute interface #650

Open
gil-- opened this issue Dec 12, 2022 · 11 comments
Open

[Checkout UI] Add removeAttribute interface #650

gil-- opened this issue Dec 12, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@gil--
Copy link
Member

gil-- commented Dec 12, 2022

Please list the related package(s)

checkout-ui-extensions

If this related to specific APIs or components, please list them here

Is your feature request related to a problem? Please describe.

Unless I'm overlooking something, we can't remove cart attributes currently. Only updateAttribute is exposed which means even using an empty string keeps the attribute and we can't set null since string is expected.

Describe the changes you are looking for

Add removeAttribute interface which has a payload like:

{
  /**
   * The type of the `AttributeRemoveChange` API.
   */
  type: 'removeAttribute';

  /**
   * Key of the attribute to add or update
   */
  key: string;
}

Similar to the removeMetafield or removeNote change apis.

Describe alternatives you’ve considered

Tried setting to null or empty string but cart attribute remains.

Additional context

See https://github.com/Shopify/ui-extensions/blob/main/packages/checkout-ui-extensions/src/extension-points/api/standard/index.ts#L167

@gil-- gil-- added the enhancement New feature or request label Dec 12, 2022
@yuzushioh
Copy link

+1 for this 👍🏻

@IntegralParts
Copy link

This is a necessary feature since the alternative is empty attributes in the order, which is not great. +1

@cargix1
Copy link

cargix1 commented Oct 7, 2023

+1

@patryk-smc
Copy link

According to the latest AMA, adding this API is not planned

https://discord.com/channels/842813079926603828/1159538499070984243

@awd
Copy link

awd commented Nov 4, 2023

+1

@julien-mamalian
Copy link

+1, empty attributes can cause issue for some merchants

@Job-madi
Copy link

+1

4 similar comments
@antonbelinskiy
Copy link

+1

@w-schwier
Copy link

+1

@MCPWebdesign
Copy link

+1

@yosef-grant
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests