Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    how to insert configurable products programmatically

    General Discussion
    2
    6
    365
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AnthonySica last edited by

      Re: How to insert configurable product programmatically?

      Greetings - I did some research on inserting configurable products and variants and could not find a distinct list of data required for parents and the variant....

      a, Do we need to have add super_attributes for the configurable product identifying attribute for variant?
      b. is the configurable product inactive?

      any thoughts?

      Thank you

      Tony

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        You need super attributes for variants identification.

        1 Reply Last reply Reply Quote 0
        • A
          AnthonySica last edited by

          So the variants are connected via the parent_id field?
          Is there a function already available for the super_attributes or a new one is required?

          Also, when the configurable record is created, do we need to assign a min and max price?

          Thank you

          Tony

          1 Reply Last reply Reply Quote 0
          • devansh-webkul
            devansh-webkul last edited by

            super_attributes is for the attributes which differentiate the variants like color, size, etc.

            parent_id is for catching the parent model.

            1 Reply Last reply Reply Quote 0
            • A
              AnthonySica last edited by

              Hi - I was able to navigate through setting up configurable and variants from api results...

              wondering if there is a way to insert the default variant id into the "additional" field in the products tables.. seems that the field is setup a bit differently.... it is format like: '{"default_variant_id":"1357"}'.

              thank you for all your help.

              1 Reply Last reply Reply Quote 0
              • devansh-webkul
                devansh-webkul last edited by

                You can add one more key in the request i.e.,
                {"selected_configurable_option" : <default-id>}

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post