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

Fix product name, sku, url, ... #2

Open
webdados opened this issue Oct 1, 2019 · 2 comments · May be fixed by #3
Open

Fix product name, sku, url, ... #2

webdados opened this issue Oct 1, 2019 · 2 comments · May be fixed by #3

Comments

@webdados
Copy link

webdados commented Oct 1, 2019

Shouldn't we also fix the product variation name, sku, and url on the markup?

I'm in doubt if we should do it at the product or the offer level.

Product level:
(...) if ( ! empty( $variation ) ) { $markup['name'] = $variation->get_name(); $markup['sku'] = $variation->get_sku() != '' ? $variation->get_sku() : $markup['sku']; $markup['url'] = $variation->get_permalink(); $price_valid_until = date( 'Y-12-31', current_time( 'timestamp', true ) + YEAR_IN_SECONDS ); (...)

Offer level:
(...) $markup_offer['priceValidUntil'] = $price_valid_until; $markup_offer['name'] = $variation->get_name(); $markup_offer['sku'] = $variation->get_sku() != '' ? $variation->get_sku() : $markup['sku']; $markup_offer['url'] = $variation->get_permalink(); (...)

I would risk and say we should do it at the product level if we want Google to see this as an individual product.

@webdados
Copy link
Author

webdados commented Oct 1, 2019

Github messed up my code...

I can submit a PR of you want to.

@leewillis77
Copy link
Owner

A PR might be helpful to see exactly what you're proposing.

@webdados webdados linked a pull request Oct 1, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants