• Resolved cargoodrich

    (@cargoodrich)


    Hello,

    I want to set the [age_group] attribute to kids for any products which are assigned to my Children's category, but then set to adult for any products that are not.

    How can I achieve this? I’ve looked into the Attributes section as well as setting up a feed rule but neither seems to let me do the above.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi cargoodrich,

    This should be fairly simple but requires you to create a ‘fake’ or empty custom attribute that you can use for this.

    So I am going to assume here you created a custom attribute with the name ‘age_group’. There is no need to actually start filling that attribute for your products.

    In the configuration of your product feed you than map Google’s g:age_group field (hit the + add field mapping button on the attribute mapping page and select Age group) to the new custom attribute you created.

    Now go to the Feed filters and rules section and create a new rule that says:

    If category contains ‘Children’s’ (case-sensitive) then (new custom attribute) is kids.

    Now you have to create an extra rule that says:

    If category doesn’t contains ‘your categoryname’ (case-sensitive) then (new custom attribute) is adult.

    We have tested this set-up and it seems to work perfect.

    Let me know if it worked out for you.

    All the best,
    Eva

    Thread Starter cargoodrich

    (@cargoodrich)

    Excellent thanks Eva, so presumably the plugin then automatically populates this custom field for all products accordingly?

    It will in the product feed yes

    Thread Starter cargoodrich

    (@cargoodrich)

    Great thanks!

    Thread Starter cargoodrich

    (@cargoodrich)

    Hi Eva,

    I’ve tried implementing as you suggested above but neither the age_group nor gender attributes I’ve setup are outputting in the .xml.

    I did also try changing Children\'s to Children but this didn’t work either.

    See screenshot here

    What am I doing wrong? I setup the age_group and gender attributes as custom ACF fields for the products.

    Hi cargoodrich,

    Please do not add the age_group attribute with AFC but the normal WooCommerce way via ‘Products -> Attributes -> Add new attribute’.

    That should work as we have tried that on our development environment.

    Best,
    Eva

    Thread Starter cargoodrich

    (@cargoodrich)

    Ok I’ve got that working, thanks ??

    ????

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to set age_group based on certain category?’ is closed to new replies.