Create full product with variants in php

  • Posts: 71
  • Thank you received: 1
8 years 3 months ago #247921

-- 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.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247925

Hi,

Here some code to create a product :

$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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum