Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter csss

    (@csss)

    Thanks, it is working now, except the array needed to be used for the variable product, not the variations, eg:

    array(‘name’ => ‘Colour’,
    ‘id’=> 83,
    ‘slug’ => ‘colour’,
    ‘variation’ => false,
    ‘visible’ => true,
    ‘taxonomy’ => ‘pa_colour’,
    ‘options’ => array($colours)),

    then the matching variation:

    array(‘name’ => ‘Colour’,
    ‘id’=> 83,
    ‘slug’ => ‘colour’,
    ‘visible’ => true,
    ‘taxonomy’ => ‘pa_colour’,
    ‘option’ => ‘Red’,

    Thread Starter csss

    (@csss)

    The latest thing I have tried is setting the main product attributes like this, I’ve tried many other ways:

    array(‘name’ => ‘Colour’,
    ‘slug’ => ‘colour’,
    ‘variation’ => false,
    ‘visible’ => true,
    ‘taxonomy’ => ‘colour’,
    ‘options’ => $colour),

    Then the variations like this

    array(‘name’ => ‘Colour’,
    ‘slug’ => ‘colour’,
    ‘visible’ => true,
    ‘taxonomy’ => ‘colour’,
    ‘option’ => $colour),

    I’m creating the attributes and terms with the api too, but it makes no difference if I create them manually or not, the same with creating the variation attributes manually if I am creating them for the api generated products. The filters only work if I create both the attributes, the terms and the products attributes manually and select the terms.

    I’ve treid getting the attribute id’s and term id’s and adding these too, but that makes things worse.

    Thread Starter csss

    (@csss)

    I created attributes for the variations, but I think the filters are only meant for the main product, not the attributes of the variation. Like if I create the attribute basic colour: red for the variation and it is not used for a variation, then can it be filtered?

    • This reply was modified 1 year, 3 months ago by csss.
    Thread Starter csss

    (@csss)

    I am using Taxonomy =>true now too, but the filters are still not being applied. I am creating a variable product first and then adding simple products with attributes. The simple products appear on the product list, but I still can’t filter them unless I create them manually.

    Are there any guides online with examples on how to do this. I’m using chat gpt at the moment, but I couldn’t find any info on how to create a product and then create the variable. Because I would need to create the product and then get the id of that product before adding variables to that ID.

    Thread Starter csss

    (@csss)

    ok thanks I will post it on that forum

Viewing 5 replies - 1 through 5 (of 5 total)