Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Store API doesn't append third party query params to cart item permalink #8119

Closed
bozzmedia opened this issue Jan 7, 2023 · 1 comment · Fixed by #8726
Closed

Store API doesn't append third party query params to cart item permalink #8119

bozzmedia opened this issue Jan 7, 2023 · 1 comment · Fixed by #8726
Assignees
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. focus: rest api Work impacting REST api routes. type: bug The issue/PR concerns a confirmed bug.

Comments

@bozzmedia
Copy link

Describe the bug

When using the new cart and checkout blocks there does not seem to be a way to click the product and edit variations or options as you can in Woo Classic.

To reproduce

Steps to reproduce the behavior:

  1. Use WC Bocks
  2. Use a plugin that relies on appending information to a URL to allow editing of variations/additional info (In my case: Gravity Forms Product Addon)
  3. When using Woo Classic, it works fine, ex:

https://redacted.com/product/product-name/?attribute_frame-color=Light+Red&wc_gforms_cart_item_key=6aceac4da5b55f3b726d18025cc96cef

  1. When using Woo Blocks checkout, the edit URL seems to be different and does not carry that information.
    https://redacted.com/product/product-name/

Full info on slack including an addon dev who has run into issues:
https://woocommercecommunity.slack.com/archives/C1KAZ91E3/p1671566495106139

The dev of Gravity Forms addon also confirms this is an issue with current implementation of the checkout block. They state: "This appears to be a problem with WooCommerce itself. Even using a standard Variable product with nothing else it doesn't allow you to click on the title in the Cart from the cart block and edit it. I'm guessing there is a filter on the cart item link they are not calling when rendering the cart for the block that they do when rendering the "Real" cart. Since they are missing the filter in WC core there's not anything I can do from my end to "hack" around it. "

Expected behavior

WC Blocks should support the same method as classic for allowing this interoperability of editing product options and addon options.

Environment

WordPress (please complete the following information):

  • WordPress version: 6.1.1
  • Gutenberg version (if installed): not installed
  • WooCommerce version: latest production
  • WooCommerce Blocks version: latest production
  • Any other plugins installed: Gravity Forms Product Addons
@bozzmedia bozzmedia added the type: bug The issue/PR concerns a confirmed bug. label Jan 7, 2023
@kmanijak kmanijak added block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. labels Jan 9, 2023
@senadir
Copy link
Member

senadir commented Jan 15, 2023

Hey @bozzmedia ! Thank you for reaching out, I responded to the slack thread but responding here as well.

Store API (and by extension Cart/Checkout block) support adding attributes to the URL of item, this is done via WC_Product_Variation::get_permalink, what you're looking for is third party link params, added via woocommerce_cart_item_permalink, which is a hook present on the Cart/Mini Cart HTML templates, adding it here will impact Store API and so we would rather look into it before doing this.

There's no direct way to do this right now (nothing I'm aware of at least), I will let you know once we tackled this.

@senadir senadir changed the title Checkout Block does not support editing variations / issue with appending URL parameters Store API doesn't append third party query params to cart item permalink Jan 15, 2023
@ralucaStan ralucaStan added the focus: rest api Work impacting REST api routes. label Jan 27, 2023
@mikejolley mikejolley self-assigned this Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. focus: rest api Work impacting REST api routes. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants