Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alexli126

    (@alexli126)

    Hello,

    I noted the following tutorial:
    https://woocommerce.com/document/google-for-woocommerce/attribute-mapping/use-cases/

    Could you please let me know how to create multiple custom attributes like color and gender?

    Is the following way right please?

    add_filter(
    ‘woocommerce_gla_attribute_mapping_sources_custom_attributes’,
    function( $values ) {
    return array_merge( $values, [‘Color’, ‘Gender’]);
    }
    );

    Plugin Support Reynier C. (woo-hc)

    (@reynierc)

    Hi @alexli126 ,

    I understand that you’re looking to create product-specific attributes and have found that the current system supports global attributes but not the product level ones. For custom attributes like ‘Color’ and ‘Gender’, by the looks of it, your approach with the code snippet should allow you to add these attributes. The only thing I see that needs to be changed is the use of straight quotes ' rather than curly quotes

    If you need further support, please note that we are unable to provide code customization as per our support policy. Still, if you need customization, we do our best to offer advice and direct you to appropriate resources. Based on the feedback we get from our customers we highly recommend contacting one of the services on our Customization page.

    Hope this helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.