Dcsecsei1984 Posted July 21, 2015 Share Posted July 21, 2015 So I use SQL querie to export all of my products with name, url, image link. What I need is prices in additional. Here is my code what is works but missing prices: select p.`id_product` ,pl.`name` ,concat('http://kerteszetigeparuhaz.hu/',cl.`link_rewrite`,'/',pl.`link_rewrite`,'.html') as "ProductURL" ,case when length(im.`id_image`)=6 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),10,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=5 then concat('http://http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=4 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=3 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=2 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(im.`id_image`,2,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=1 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(im.`id_image`,2,0,'/'),im.`id_image`,'.jpg') else '' end as "ImgURL_1" FROM `ps_product` p join `ps_product_lang` pl on pl.`id_product`= p.`id_product` join `ps_category_lang` cl on cl.`id_category`= p.`id_category_default` join `ps_image` im on im.`id_product`= p.`id_product` where pl.`id_lang`=1 and cl.`id_lang`=1 and im.`cover`=1 and p.`active`=1 Can anybody help me, what I need to add to the code for prices? Link to comment Share on other sites More sharing options...
Dcsecsei1984 Posted July 21, 2015 Author Share Posted July 21, 2015 I got this error when I try this: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.`price` ,pl.`name` ,concat('http://kerteszetigeparuhaz.hu/,cl.`link_rewrite`,' at line 3 Link to comment Share on other sites More sharing options...
Dcsecsei1984 Posted July 21, 2015 Author Share Posted July 21, 2015 (edited) Ohh my fault Here is the code with your help: select p.`id_product` ,p.`price` ,pl.`name` ,concat('http://kerteszetigeparuhaz.hu/',cl.`link_rewrite`,'/',pl.`link_rewrite`,'.html') as "ProductURL" ,case when length(im.`id_image`)=6 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),10,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=5 then concat('http://http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=4 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=3 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=2 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(im.`id_image`,2,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=1 then concat('http://kerteszetigeparuhaz.hu/img/p/',insert(im.`id_image`,2,0,'/'),im.`id_image`,'.jpg') else '' end as "ImgURL_1" FROM `ps_product` p join `ps_product_lang` pl on pl.`id_product`= p.`id_product` join `ps_category_lang` cl on cl.`id_category`= p.`id_category_default` join `ps_image` im on im.`id_product`= p.`id_product` where pl.`id_lang`=1 and cl.`id_lang`=1 and im.`cover`=1 and p.`active`=1 Is there any solution to show price with tax? Edited July 21, 2015 by Dcsecsei1984 (see edit history) Link to comment Share on other sites More sharing options...
Dcsecsei1984 Posted July 21, 2015 Author Share Posted July 21, 2015 One more thing the price is not important but the category is yes Pls. last push. 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