Jump to content

Nextlevel131

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • First Name
    Petkan
  • Last Name
    Divaka

Nextlevel131's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello I have 100k product to import, but I have to import them through PHP and I have to update them each day. I am using prestashop class products.php to add a product and my code is like this: <?php echo dirname(__FILE__); include_once 'config/config.inc.php'; include(dirname(__FILE__).'/init.php'); $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); /* Add a new product */ $object = new Product(); $object->price = 22; $object->id_tax_rules_group = 1; $object->name[Configuration::get('PS_LANG_DEFAULT')] = 'ssssssssss'; $object->reference= 'hbvvh'; $object->quantity = 5; $object->id_manufacturer = 0; $object->id_supplier = 0; $object->minimal_quantity = 1; $object->additional_shipping_cost = 0; $object->wholesale_price = '100'; $object->ecotax = 0; $object->width = 0; $object->height = 0; $object->depth = 0; $object->weight = 0; $object->out_of_stock = 0; $object->active = 1; $object->link_rewrite = array((int)Configuration::get('PS_LANG_DEFAULT') => 'test-importu'); $object->id_category_default = 18; $object->category = 18; $object->available_for_order = 0; $object->show_price = 1; $object->on_sale = 0; $object->online_only = 1; $object->meta_keywords = 'test'; $object->add(); echo "product added"; exit; ?> But I dont know how to add sizes variation. Each product has a size which can be, S, M, L, 40, 41, 42 and etc can you help me ? Thanks.
×
×
  • Create New...