Home Forums WoodMart support forum How to send "Color" for attribute swatches term via Woocommerce API

How to send "Color" for attribute swatches term via Woocommerce API

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #152200

    GDNETWORK
    Participant

    I’m using the Woocommerce API to create products for my website.

    How should I send the color hex code to the attribute term and turn on “Enable swatch”.

    Here’s a preview of what I’m trying to do through the API:
    Preview

    #152312

    Hello,

    Sorry I did not understand what you want to achieve. What do you mean by the color hex code?

    If you want to send or get the hex code of attribute then try the below code that might works in your case:

    $color = get_term_meta( $term->term_id, 'color', true );
    $image = get_term_meta( $term->term_id, 'image', true );

    Or if you just want to use the color swatches then let me know I will guide you.

    Best Regards.

Viewing 2 posts - 1 through 2 (of 2 total)