tgonzalez Posted May 15, 2019 Share Posted May 15, 2019 Hi, I am trying of create a series of products througth a CSV, when I start a bucle program save firsth product but dont continue doing bucle, why? Here is my code: $product = new Product(); $product->name = [$default_lang=>$description]; $product->link_rewrite = [$default_lang=>$description]; $product->price = $precio1; $product->quantity = 50;//puesto al azar $product->visibility = 'none'; $product->available_for_order = 1; //true $product->description="$description"; $product->description_short="$description"; $product->show_price = 1; $product->id_category = [3,4]; $product->id_category_default = 3; StockAvailable::setQuantity((int)$product->id, 0, $product->quantity, Context::getContext()->shop->id); $product->save(); Greetings and thanks you in advance Link to comment Share on other sites More sharing options...
hakeryk2 Posted May 20, 2019 Share Posted May 20, 2019 $product->link_rewrite = [$default_lang=>$description]; This looks faulty to me. It needs to be transcripted from name to something with - instead of space. That's the first gues. 1 Link to comment Share on other sites More sharing options...
tgonzalez Posted May 23, 2019 Author Share Posted May 23, 2019 thanks you 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