Jump to content

Recommended Posts

Hi, Finally I get the method how to insert the product using the module. but now the problem with product name and description and short description. these are not inserted when I check with my database. How to insert the following for product, 

 

Name, Description, Short description, tags, meta details

 

here id my code: 

 

$product = new Product();
$image = new Image(); 
$name = Tools::getValue('txt_product_name');
$product->name = array($langId => $name);
$product->id_manufacturer = 1; 
$product->id_supplier = 1; 
$product->id_category_default=3;
$product->id_shop_default = 3; 
$desc_prdt = Tools::getValue('txtr_prod_desc');
$product->description = array($langId => $desc_prdt); 
$desc_short = Tools::getValue('txtr_shrt_desc');
$product->description_short = array($langId => $desc_short); 
$product->minimal_quantity = 1; 
$product->available_now = 0 ;  
$product->quantity = Tools::getValue('txt_product_qty');
$product->price = Tools::getValue('txt_product_price');  
$product->condition = Tools::getValue('sel_product_stat');  
$product->weight = Tools::getValue('txt_product_weight');
$product->height = Tools::getValue('txt_product_height');
$product->reference = "Product by Customer".$id_customer;
$product->active  = true;
$product->link_rewrite = array($langId => Tools::link_rewrite($name));
 
 
 
Any one can help me pls ... 
Link to comment
Share on other sites

you created array with languages for these variables?

for example, you've got two languages english, spanish

 

english - id 1

spanish - id 3

 

your variable with description must be array with;

 

$description[1]='this is english description';

$description[3]='this is spanish description';

Link to comment
Share on other sites

×
×
  • Create New...