pierre de LeCyclo Posted September 19, 2016 Share Posted September 19, 2016 (edited) hi guys, I'm working on importing our store on PrestaShop (from Joomla). Now, I'm importing the products' database, with a CSV file. But when I try to import the first file (400 products), an error occurs, in the 51th product: PrestaShopException property stock->price_te is not valid I suppose it's the 51th product because the 50 first are actually on the prestashop's database (and on the prestashop's store), but nothing tell me it is. I don't find any difference between the products that work and the others Even with notepad++, Excel or LibreOffice Calc So please, help me to find out what's wrong in my csv the prestashop exception: the 2 lignes of the CSV file (the last that worked and the one that didn't) Edited September 19, 2016 by pierre de LeCyclo (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 19, 2016 Share Posted September 19, 2016 How are you importing? Using the standard product csv importer? Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 19, 2016 Author Share Posted September 19, 2016 yes Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 20, 2016 Author Share Posted September 20, 2016 Sorry for being impatient, but it's pretty urgent :/ sooo it's an Up Link to comment Share on other sites More sharing options...
rocky Posted September 20, 2016 Share Posted September 20, 2016 The following regular expression is used to validate Stock::price_te: /^[0-9]{1,10}(\.[0-9]{1,9})?$/ Make sure the price you have for that row of your CSV file is a number without a currency sign. Also, make sure you've used a . as the decimal character and that there's between 1 and 10 numbers before the decimal point and between 1 and 9 numbers after the decimal point. Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 20, 2016 Author Share Posted September 20, 2016 a price that worked: 15.82500 the price that makes the exception occurs: 16.65833 I really can't find out the difference between those two values... Link to comment Share on other sites More sharing options...
rocky Posted September 20, 2016 Share Posted September 20, 2016 Can you paste a few lines of the CSV files including the line that doesn't work and some that don't? Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 20, 2016 Author Share Posted September 20, 2016 (edited) line one;ID;active;name;categories;price;"tax rules ID";"wholesale price";"on sale";"discount amount";"discount percent";"discount from";discount_to;reference;"supplier reference";supplier;manufacturer;EAN13;UPC;ecotax;width;height;depth;weight;quantity;"minimal quantity";visibility;"additional shipping cost";unity;"unit price";"short description";description;tags;"meta title";"meta keywords";"meta description";"URL rewrite";"text when in stock";"backorder allowed";"available for order";"available date";"creation date";"show price";"image URLs";"delete images";feature;online_only;condition;customizable;"uploadable files";"text fileds";"out of stock";id_shop;"advanced stock management";"depend on stock";warehouse line two;185;1;"Casque v�lo enfant fus�e Noir";"B�b�, Entre 0 et 3 ans, Transporter les enfants, Casques enfant, Enfants, Enfant - Adolescent, Transporter les enfants, Oxford, Casques";15.82500;1;;0;;;;;LIMSE08003;;;OXFORD;;;;0.0000;0.0000;0.0000;0.5000;2;1;both;;;;"Casque v�lo enfant fus�e Noir";"<h2>Casque b�b� pour v�lo Noir</h2> <div style=""text-align:justify;""> <p class=""article""> Pour votre enfant qui<strong> pratique le v�lo</strong> ou que vous avez l�habitude de transporter sur un <strong>si�ge enfant</strong> ou <strong>dans une remorque</strong>, un casque de protection est indispensable. Ce casque offre une<strong> protection optimale </strong>et est tr�s confortable pour les jeunes cyclistes. <br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/casque_velo_avec_aerations.jpg"" hspace=""6"" alt=""Casque v�lo enfant avec a�rations pour le confort"" title=""casque v�lo b�b� avec grand confort"" align=""left""/><br /><br /></div> Ce casque est �quip� de <strong> 14 trous d�a�rations </strong>. Votre b�b� b�n�ficie ainsi d�une bonne a�ration du cr�ne, d�un cofort optimal.<br /><br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/casque_velo_enfant_avec_protection_insectes.jpg"" hspace=""6"" alt=""Aerations prot�g�es par un filet pour les insectes"" title=""trous prot�g�s des insectes par un filet mesh"" align=""left"" /><br /><br /></div>Les ventilations sur le casque sont <strong>prot�g�es par un filet Mesh</strong>. Les insectes volant n�arrivent donc pas jusqu�� la t�te de votre enfant. <br /><br /><br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/molette_de_reglage_sur_casque_velo_bebe.jpg"" hspace=""6"" alt=""Casque v�lo enfant avec molette r�glable"" title=""Molette de r�glage pour casque v�lo b�b� de 46 � 54 cm"" align=""left"" /><br /></div>Avec sa <strong>molette de r�glage</strong>, ce casque convient � diff�rentes taille de t�te. Ce casque peut ainsi suivre la croissance de votre enfant en s�adaptant parfaitement � son tour de t�te. <br /><br /><br /><br /> Ce casque est aini disponible en deux tailles :<br /> <strong>Small</strong> pour un tour de t�te compris entre 46 et 50 cm<br /> <strong>Medium</strong> pour un tour de t�te compris entre 50 et 54 cm <br /><br /></p> <div align=""center""><img src=""http://www.lecyclo.com/images/ImageProduit/Bandeaux_produits_similaires/housse-anti-pluie-de-casque-enfant-abus.jpg"" hspace=""6"" alt=""Housse de casque pour enfant"" title=""Capuche de casque v�lo enfant Abus"" /> </div> <p class=""article""> Pour prot�ger votre enfant des intemp�ries, une <a href=""http://www.lecyclo.com/velo/securite/casques/visiere-cache-oreille/housse-de-pluie-pour-casque-bebe-velo-abus.html"" title=""Housse de casque v�lo pour B�b�"" target=""blank"">housse de casque imperm�able pour enfant</a> est disponible en option � un tarif pr�f�rentiel. Elle s�adapte parfaitement au casque via son �lastique de serrage. <br /><br /> Pensez �galement � prot�ger les articulations de votre enfant. Une <a href=""http://www.lecyclo.com/velo/securite/casques/visiere-cache-oreille/paire-de-genouilleres-et-coudieres-pour-enfants-a-velo.html"" target=""_blank"" alt=""Genouill�res et coudi�res pour enfant de 2 � 6 ans"" � title=""Set de protections pour enfant � v�lo "" target=""blank"">paire de genouill�res et coudi�res pour enfants de 2 � 6 ans</a> vous est propos�e en option � un tarif pr�f�rentiel. <br /><br /> Retrouvez en option � un tarif pr�f�rentiel <strong>tous les accessoires pour assurer la s�curit�</strong> de votre enfant � v�lo. </p> </div> <p align=""center""><img src=""http://www.lecyclo.com/images/ImageProduit/oxford150.jpg"" hspace=""6"" alt=""Casque v�lo enfant"" title=�casque v�lo pour b�b� /></p> ";;"Casque velo b�b� Noir avec motif fus�e";"Casque, Velo, Garcon, Gar�on, Casque, Enfant, Casque v�lo b�b�, Casque jeune cycliste, Casque enfant";"Casque pour la pratique du v�lo pour jeune gar�on noir avec dessin de fus�e";;disponible;"bientot disponible";1;2014-04-14;2014-09-29;1;"http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-fusee-noir_full.jpg, http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-fusee-noir_full_2.jpg, http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-fusee-noir_full_3.jpg, http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-fusee-noir_full_4.jpg";1;"Mod�le:ZOOM Poppet:999,Type:Casque de v�lo:999,Couleurs:Noir:999,Tour de tete:S : 46 / 47 / 48 / 49 / 50 M : 50 / 51 / 52 / 53 / 54:999,Ajustement du casque:Rapide avec molette crant�e:999,Filet anti-insectes:Oui:999,Aeration:14 fentes:999,Genre:Masculin:999,Prot�ge oreille:Non:999,Prot�ge oreille:Non:999";0;new;0;0;0;;1;1;1;1 line three;186;1;"Casque v�lo enfant Poppet rose";"B�b�, Entre 0 et 3 ans, Transporter les enfants, Casques enfant, Enfants, Enfant - Adolescent, Transporter les enfants, Oxford, Casques";16.65833;1;;0;;;;;LIMSE08004;;;OXFORD;;;;0.0000;0.0000;0.0000;0.3500;2;1;both;;;;"Casque v�lo enfant Poppet rose";"<h2>Casque b�b� pour la pratique du v�lo Oxford</h2> <div style=""text-align:justify;""> <p class=""article""> Ce casque garantit � votre enfant une <strong>s�curit� optimale</strong> lorsqu�il est � v�lo ainsi que lorsqu�il est <strong>transport� dans une remorque</strong> ou <strong>un si�ge enfant</strong>. Il offre ainsi une <strong>protection maximale</strong> ainsi qu�un grand confort au plus jeune cycliste. <br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/casque_velo_avec_aerations.jpg"" hspace=""6"" alt=""Casque v�lo enfant avec a�rations pour le confort"" title=""casque v�lo b�b� avec grand confort"" align=""left""/><br /><br /></div> Avec <strong>14 trous d�a�ration</strong>, ce casque offre � votre enfant un grand confort avec une bonne ventilation du cr�ne. <br /><br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/casque_velo_enfant_avec_protection_insectes.jpg"" hspace=""6"" alt=""Aerations prot�g�es par un filet pour les insectes"" title=""trous prot�g�s des insectes par un filet mesh"" align=""left"" /><br /><br /></div> Les trous de ventilation sont prot�g�s par un <strong>filet Mesh</strong>. Ce dernier prot�ge ainsi la t�te de votre enfant des insectes volants. <br /><br /><br /><br /> <div align=""left""><img src=""http://www.lecyclo.com/images/ImageProduit/molette_de_reglage_sur_casque_velo_bebe.jpg"" hspace=""6"" alt=""Casque v�lo enfant avec molette r�glable"" title=""Molette de r�glage pour casque v�lo b�b� de 46 � 54 cm"" align=""left"" /><br /></div> Ce casque est �quip�e d�une <strong>molette de r�glage</strong>. Il couvre ainsi plusieurs tailles afin de suivre la croissance de l�enfant et permet un ajustement optimal � son tour de t�te. De plus, ce casque est <strong>disponible en deux tailles</strong> : La taille <strong>Small </strong>convient aux enfants ayant un tour de t�te compris entre 46 et 50 cm et le <strong>Medium</strong> entre 50 et 54 cm. <br /></p> <div align=""center""><img src=""http://www.lecyclo.com/images/ImageProduit/Bandeaux_produits_similaires/housse-anti-pluie-de-casque-enfant-abus.jpg"" hspace=""6"" alt=""Housse de casque pour enfant"" title=""Capuche de casque v�lo enfant Abus"" /> </div> <p class=""article""> Pour prot�ger votre enfant des intemp�ries, une <a href=""http://www.lecyclo.com/velo/securite/casques/visiere-cache-oreille/housse-de-pluie-pour-casque-bebe-velo-abus.html"" title=""Housse de casque v�lo pour B�b�"" target=""blank"">housse de casque imperm�able pour enfant</a> est disponible en option � un tarif pr�f�rentiel. Elle s�adapte parfaitement au casque via son �lastique de serrage. <br /><br /> Pensez �galement � prot�ger les articulations de votre enfant. Une <a href=""http://www.lecyclo.com/velo/securite/casques/visiere-cache-oreille/paire-de-genouilleres-et-coudieres-pour-enfants-a-velo.html"" target=""_blank"" alt=""Genouill�res et coudi�res pour enfant de 2 � 6 ans"" � title=""Set de protections pour enfant � v�lo "" target=""blank"">paire de genouill�res et coudi�res pour enfants de 2 � 6 ans</a> vous est propos�e en option � un tarif pr�f�rentiel. <br /><br /> Retrouvez en option � un tarif pr�f�rentiel <strong>tous les accessoires pour assurer la s�curit�</strong> de votre enfant � v�lo. </p> </div> <p align=""center""><img src=""http://www.lecyclo.com/images/ImageProduit/oxford150.jpg"" hspace=""6"" alt=""Casque v�lo enfant"" title=�casque v�lo pour b�b� /></p> ";;"Casque de v�lo pour fille";"Casque, V�lo, Fille, Enfant, Enfants, Velo, S�curit�, Securit�, Si�ge-b�b�, Filles, Casque v�lo fille";"Casque pour la protection de votre enfant � v�lo. Ce casque rose est id�al pour les filles";;disponible;"bientot disponible";1;2010-10-01;2014-09-09;1;"http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-poppet-rose_full.jpg, http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-poppet-rose_full_2.jpg, http://www.lecyclo.com/components/com_virtuemart/shop_image/product/casque-velo-enfant-poppet-rose_full_3.jpg";1;"Mod�le:ZOOM Poppet:999,Type:Casque de v�lo:999,Couleurs:Violet / Rose:0,Tour de tete:S : 46 / 47 / 48 / 49 / 50 M : 50 / 51 / 52 / 53 / 54:999,Ajustement du casque:Rapide avec molette crant�e:999,Filet anti-insectes:Oui:999,Aeration:14 fentes:999,Genre:F�minin:999,Prot�ge oreille:Non:999,Prot�ge oreille:Non:999";0;new;0;0;0;;1;1;1;1 Sorry if it's not so clear, I actually gave in my first post a link to download it (and use it in openOffice, so you can see it clearly), but I understand you don't want to download a file without knowing what's in there are the last product registered, and the product that made the Exception occurs. They are an error in the "feature" row (so much ':'), but it's not a problem as pretty much all the products have this, and 50 products worked EDIT: I added one color per line, and a 'line one', line two'... bold and underlined before every line Edited September 20, 2016 by pierre de LeCyclo (see edit history) Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 22, 2016 Author Share Posted September 22, 2016 (edited) after several tests, it seems like the price is not the reason why the product don't work (I put the exact same price in all the products, and the result was exactly the same: 50 products worked, and after it didn't) In my second file, it worked only for 6 products Can someone help me understanding this? Edited September 22, 2016 by pierre de LeCyclo (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 Sorry, I can't find see anything that could cause an import error. Does it always stop at 50 products, no matter what products are entered? Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 23, 2016 Author Share Posted September 23, 2016 no, I imported 4 different csv files, and the number of product imported were 50, 4, 9 and 16 Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 I don't understand why it isn't working for you. I created test.csv using the three lines you posted above and ran it through the CSV Import on my PrestaShop v1.6.1.7 test site and it worked fine. I see the following imported product: Link to comment Share on other sites More sharing options...
pierre de LeCyclo Posted September 23, 2016 Author Share Posted September 23, 2016 what the f*... I'm in 1.6.1.5, maybe it's the reason? Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 Maybe. Are you able to upgrade to PrestaShop v1.6.1.7? Link to comment Share on other sites More sharing options...
chosie Posted March 11, 2017 Share Posted March 11, 2017 i have the same issue with 1.6.0.8. What I did to make it work is by ignoring the last column (warehouse) and it is able to import. Hope this trick may help whoever has this issue. Link to comment Share on other sites More sharing options...
marvin13 Posted July 25, 2017 Share Posted July 25, 2017 the error occurs when changing form string '0.000001' to float, then we have float value of 1.0E-6 , and passing this 1.0E-6 value to addProduct method instead of floatval(0)I don't understood what purpose has this line, but if you delete this, it would work,so comment out or deleteline 1936 in AdminImportController if ($price == 0) { $price = 0.000001; } and for combinationsline 2406 looks the same if ($price == 0) { $price = 0.000001; } and check if it works, for me it worked Link to comment Share on other sites More sharing options...
tosyn Posted November 4, 2017 Share Posted November 4, 2017 Note that you will get same PrestaShopException described by the OP if you set Depends On Stock value to 1 (meaning use warehouse quantity) and there's no quantity set/defined for the product in warehouse. Simply put, set the value of Depends On Stock to 0 to use product quantity specified in your csv file. Link to comment Share on other sites More sharing options...
Navid esmi Posted December 23, 2018 Share Posted December 23, 2018 hi i have the same problem with my csv file.this topic solved my problem. https://www.prestashop.com/forums/topic/314748-improving-the-new-csv-import-to-warehouse-functionality/ this answer from : --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Samar Rizvi Posted December 8, 2014 Hi @Beluga, The problem there is that when you keep the wholesale price as 0 or keep it empty, it is converted 0.000001 and then validated. During validation it is probably converted to string, and hence the value becomes 1.0E-6 rather than 0.000001 due to which $price_te becomes invalid. Will look into the purifier section of tools. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- this answer solved my problem. 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