Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Puck Holshuijsen 188 posts 751 karma points
    Mar 09, 2023 @ 07:41
    Puck Holshuijsen
    0

    Create Product Attributes programmatically

    Hi Matt,

    I was wondering how to create Product Attributes automatically, I couldn't find any way to do it.

    What I am trying to achieve is to create Multi Product Variants programmatically, and because the attributes can change I need to create it automatically. I have a list of set variants which need to go under a 'master' product, but I dont want it to create variants itself based on attributes.

    Or is there a way to create the complex variants without creating attributes beforehand :)

    Thanks!

    Kind regards,

    Puck

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Mar 09, 2023 @ 08:00
    Matt Brailsford
    100

    Hi Puck,

    There is a product attributes API much the same as every other entity to allow you to automatically create them.

    Unfortunately it’s not possible to create multivariants without them as they are fundamental to its configuration, each variant being a specific combination of each attribute.

  • Puck Holshuijsen 188 posts 751 karma points
    Mar 09, 2023 @ 08:11
    Puck Holshuijsen
    0

    Ahhh found it! Thanks again Matt :D

  • Puck Holshuijsen 188 posts 751 karma points
    Mar 09, 2023 @ 12:10
    Puck Holshuijsen
    0

    Took some time, but finally got the attributes working! Had some troubles with double aliases

Please Sign in or register to post replies

Write your reply to:

Draft