• Resolved alekv

    (@alekv)


    Hi

    Is there a function with which I can get the Google Product Category that has been set in your plugin for a particular product?

    Thanks
    Aleksandar

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author AukeJomm

    (@aukejomm)

    Hello @alekv,

    Not directly in the plugin but we do have a filter you can use in a functions.php

    Check out this little snippet: https://gist.github.com/Auke1810/79d07f66334a192f5e6304d098d45cf6

    So in the $attributes[‘google_product_category’] you find the Google product category.

    Does this help you?

    Thread Starter alekv

    (@alekv)

    But, that only runs if a feed is being generated, right?

    I would need a way to get it for a third party plugin.

    Plugin Author AukeJomm

    (@aukejomm)

    Yes, that is correct.
    So what you could do is store the Google category in a Custom product field when you generate the product feed.

    Then retrieve the category from there because it is stored in the database.

    One other way would be to read out the XML file with code. That way you use the XML as data source.

    • This reply was modified 3 years, 4 months ago by AukeJomm.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get Google Product Category for a product’ is closed to new replies.