lamka02sk Posted November 20, 2017 Share Posted November 20, 2017 (edited) Hello, I am having trouble with creating new product in PS 1.6 from module. Basically I am working on import module, so it will automatically add or update product in e-shop. I have tried literally everything I found on web. Here is my code: $product = new ProductCore; $product->price = $price; $product->name = [(int)ConfigurationCore::get('PS_LANG_DEFAULT') => 'name']; $product->quantity = $quantity; $product->minimal_quantity = 1; $product->show_price = 1; $product->wholesale_price = $basePrice; $product->weight = $weight; $product->reference = $itemID; $product->tax_rate = $this->getVatID($vat); $product->id_manufacturer = $this->getManufacturer($brand); $product->manufacturer_name = $brand; $product->ean13 = $ean; $product->active = 1; I also tried to remove all unneccessary line so it looked like this > $object = new ProductCore(); $object->name = [(int)$this->context->language->id => 'name']; $object->add(); It still return error 500. What am I supposed to do? Edited November 20, 2017 by lamka02sk accidental submit (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now