I have read many posts and tried many snippets, but I can't seem to make this work ????
We have the WooCommerce Google Product Feed plugin, but we need more control over the <title> in the xml feed, so we found a snippet filter:
When we set the return to "test", it displays in the xml, so the code works.
However, we are unable to return the value of our custom field 'google-merchant-product-title', it is empty.
That’s a bit strange, may be this is related to your case: hidden link
If above is not sufficient still, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and check this. Please note that we do not debug custom code or custom requirements much as per our support policy (https://toolset.com/toolset-support-policy/) but I would like to take a look and see what I can find.
Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
✙ Please also let me know where the xml file or php file is located for this particular function, and if there is any page or CPT related to that where I can find that Custom field, please share all that needed info.
Thanks, but still not able to login. On first attempt to login, it says "Too many login attempts locked out"
Please disable your Security plugin (e.g. Wordfence plugin) or this security system temporary OR provide us access to an easily accessible staging site hopefully.
My network also having dynamic IPs and I often switch between my networks. Thanks
I have thoroughly checked this issue and tried to get the ID for variable product but I am not succeeded in that. When I check with Simple products it does get correct ID.
When I add variations for the Variable product, it does show variations Title in this format:
Product Title (Variation name) Product's Variation ID
Test product I created: hidden link
But it does not return custom field value in the title with the given hooks of the plugin and this is true even for Standard WP fields (non Toolset fields).
I also checked WooCommerce api and that feed plugin’s API doc but I can't find anything that talks about getting variable product ID like we need it.
Since the issue also occurs with Standard WP Custom fields and standard WooCommerce variable products, it is mainly between WooCommerce + WooCommerce Feed plugin, this falls out of our support. I would suggest to please contact that plugin author and ask them if they have any such hook that can allow to modify Product Title in the feed for Variable products and replace that with a Custom field (native one), as this is not documented yet.
I assume they will probably have some internal hook for this. I will also try tomorrow and see if I can get it by any workaround but I am not certain on this at moment.