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

Product tags not working with Google attributes on variable products #2071

Closed
sukafia opened this issue Aug 25, 2023 · 2 comments · Fixed by #2074
Closed

Product tags not working with Google attributes on variable products #2071

sukafia opened this issue Aug 25, 2023 · 2 comments · Fixed by #2074
Assignees
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.

Comments

@sukafia
Copy link

sukafia commented Aug 25, 2023

Describe the bug:

The attribute mapper supports mapping tags to Google product attributes. For instance, mapping tags as brand attributes. However, mapping tags to product attributes only works with simple products, the tags' taxonomy data isn't passed for variable products.

Steps to reproduce:

  1. Create a variable product with multiple variants and use tags to specify the brand (e.g. Woo)
  2. Create a brand attribute rule and assign product tags

ACDMVt.png

  1. Allow the product to sync to Google Merchant Center and notice the brand isn't synced. (This causes the product to be flagged as missing brand attribute)
  2. Repeat the above step for a simple product and notice the brand attribute is correctly synced.

Expected behavior:

Mapping tags to Google product attributes should work for both simple and variable products.

Actual behavior:

It only works for simple products.

Affected users

6632964-zd-a8c
6666355-zd-a8c

@sukafia sukafia added the type: bug The issue is a confirmed bug. label Aug 25, 2023
@eason9487
Copy link
Member

Thanks for reporting this issue!

I can reproduce it with the given steps.

After a brief investigation, it's suspected the processing of the following code fragment may need adjustment.

protected function get_product_taxonomy( $taxonomy ) {
$product = $this->get_wc_product();
if ( $product->is_type( 'variation' ) ) {
$values = $product->get_attribute( $taxonomy );
if ( ! $values ) {
$parent = wc_get_product( $product->get_parent_id() );
$values = $parent->get_attribute( $taxonomy );
}
$values = explode( ', ', $values );

Both results of $product->get_attribute( $taxonomy ) and $parent->get_attribute( $taxonomy ) don't have associated product tags.

@eason9487 eason9487 added the priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. label Aug 25, 2023
@eason9487
Copy link
Member

Set to high priority as all taxonomies have the same issue with variable products.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants