[5.x]: How to create a Product in Craft Commerce 5 (Controller) #3458
-
Please help, Craft Commerce 5 have new Inventory logic and I can figure out how to programmatically create new Products with one variant and 1 item in stock. Looks like after new Variant element is getting saved
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
made it work by re-querying variants again after creating new and saving as above.
|
Beta Was this translation helpful? Give feedback.
-
This is the full code, a bit repetitive use of
|
Beta Was this translation helpful? Give feedback.
made it work by re-querying variants again after creating new and saving as above.