Skip to main content

Create full product with variants in php

10 years 2 months ago #247921 by RG
-- HikaShop version -- : 3.5
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.5.2

Hey,

Can you provide some example code where you create a product and a variants with specific from php code?

Thanks,

RG

Please Log in or Create an account to join the conversation.

10 years 2 months ago #247925 by Jerome
Hi,

Here some code to create a product :
Code:
$product = new stdClass(); $product->product_code = 'my product code'; $product->product_quantity = -1; $productClass = hikashop_get('class.product'); $productClass->save($product);
For the variant part, it is far more complicated and I can't provide you any example code ; the easier would be to read directly the HikaShop source code for the product class.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

Time to create page: 0.039 seconds
Powered by Kunena Forum