-
Shibumi
Hi team,
I’m trying to pull some info from products with the dynamic text block.
In particular I want to display the SKU of a product along with some other product attibutes.I manage to show the SKU for single products using the post meta method with the “_sku” meta key, but it doesn’t work for variable products.
I also would like to get in the same way some attributes.For instance if you go here: https://www.bracocasseforti.it/dierre-serie-type-a-chiave/ I’m trying to create a product specs box (the gray “Informazioni tecniche” box) where I can successfully insert taxonomies and custom field values. What I would like to show is the sku of the selected variation and the dimension.
I have set the dimensions in each variable of the product.Is there a way to do it?
Thanks,
Lorenzo -
Hi Lorenzo,
but it doesn’t work for variable products.
I’m not very familiar with Woocommercer, can you check with Woocommerce’s support on how to pull the sku for variable products?
Once you get the answer, we can see how to achieve it via GB’s dynamic tag.
Thanks and let me know!
-
Shibumi
Hi Ying,
thank you for your reply.I found this article (https://www.businessbloomer.com/woocommerce-easily-get-product-info-title-sku-desc-product-object/) where it gives some hoocks but I don’t know how to use them eventually.
I also found this article (https://community.gravityforms.com/t/populate-field-with-woocommerce-product-variation-sku-via-merge-tag-resolved/12836) where a user is trying to do something similar but related to Gravity Forms. He ended up using jQuery though.
Lastly, I fond this article on Stackoverflow (https://stackoverflow.com/questions/54030358/get-the-product-variations-skus-from-a-variable-product-in-woocommerce) which seems related too. Still I’m unable to understand anything of it.
Hopefully these resources could be of help. Meanwhile I’m trying to contact Woocommerce’s support.
Thanks,
Lorenzo -
Shibumi
Hi Ying,
Here’s the link to Woocommerce’s support reply: https://wordpress.org/support/topic/variable-product-sku-and-info-meta-key/#new-topic-0Thanks,
Lorenzo -
Alvind
Hi Lorenzo,
It looks like you’ll need to create a custom dynamic tag to retrieve the variable product meta data. However, implementing this would require a more complex function and a custom solution, as it involves third-party plugin — which falls outside our support scope.
That said, you can refer to this documentation for guidance on creating a custom dynamic tag. A developer should be able to help you extend it for your specific use case:
https://learn.generatepress.com/developer-doc/dynamic-tag-registration/ -
Shibumi
Dear Alvind,
thank you for your reply!This could be a great implementation for the future 😀
Best,
Lorenzo -
Alvind
No problem 🙂
We’ll see if this can be implemented natively in GB.
- You must be logged in to reply to this topic.