alinlup Posted October 28, 2015 Share Posted October 28, 2015 I had to export the products from database in the format used by CSV import and even it's not a complete version of the code i thought it might be useful if anyone has to do the same and doesn't want to buy any modules. SELECT DISTINCT pl.id_product AS 'ID', p.active AS 'Active (0/1)', pl.name AS 'Name *', pcl.name AS 'Categories (x,y,z...)', p.price AS 'Price tax excluded or Price tax included', p.id_tax_rules_group AS 'Tax rules ID', p.wholesale_price AS 'Wholesale price', p.on_sale AS 'On sale (0/1)', 'Reduction Amount', sp.reduction AS 'Reduction percent', sp.from AS 'Discount from (yyyy-mm-dd)', sp.to AS 'Discount to (yyyy-mm-dd)', p.reference AS 'Reference #', p.supplier_reference AS 'Supplier Reference #', s.name AS 'Supplier', m.name AS 'Manufacturer', p.ean13 AS 'EAN13', p.upc AS 'UPC', p.ecotax AS 'Ecotax', p.width AS 'Width', p.height AS 'Height', p.depth AS 'Depth', p.weight AS 'Weight', p.quantity AS 'Quantity', p.minimal_quantity AS 'Minimal quantity', p.visibility AS 'Visibility', p.additional_shipping_cost AS 'Additional shipping cost', p.unity AS 'Unity', p.unit_price_ratio AS 'Unit price', pl.description_short AS 'Short description', pl.description AS 'Description', 'Tags', pl.meta_title AS 'Meta title', pl.meta_keywords AS 'Meta keywords', pl.meta_description AS 'Meta description', pl.link_rewrite AS 'URL rewritten', pl.available_now AS 'Text when in stock', pl.available_later AS 'Text when backorder allowed', p.available_for_order AS 'Available for order (0 = No, 1 = Yes)', p.available_date AS 'Product available date', p.date_add AS 'Product creation date', p.show_price AS 'Show price (0 = No, 1 = Yes)', '.jpg') AS 'Image URL', 'Delete existing images', (select distinct group_concat(concat(name, ',', value, ',', f.position) SEPARATOR ';') FROM sw_feature_product pf LEFT JOIN sw_feature_lang fl ON fl.id_feature = pf.id_feature and fl.id_lang = 6 LEFT JOIN sw_feature f ON f.id_feature = pf.id_feature LEFT JOIN sw_feature_value_lang fvl ON fvl.id_feature_value = pf.id_feature_value and fvl.id_lang = 6 WHERE pf.id_product = p.id_product ORDER BY pf.id_product, f.position ASC) as 'Features', p.online_only AS 'Available online only (0 = No, 1 = Yes)', p.condition AS 'Condition', p.customizable AS 'Cusomizable', p.uploadable_files AS 'Uploadable Files', p.text_fields AS 'Text Fields', p.out_of_stock AS 'Out of Stock', p.id_shop_default AS 'ID / Name of shop', p.advanced_stock_management AS 'Advanced stock management', psa.depends_on_stock AS 'Depends On Stock' FROM sw_product p INNER JOIN sw_product_lang pl ON pl.id_product = p.id_product LEFT JOIN sw_specific_price sp ON sp.id_product = p.id_product LEFT JOIN sw_category_lang pcl ON pcl.id_category = p.id_category_default LEFT JOIN sw_stock_available psa ON psa.id_product = p.id_product LEFT JOIN sw_supplier s ON p.id_supplier = s.id_supplier LEFT JOIN sw_manufacturer m ON p.id_manufacturer = m.id_manufacturer LEFT JOIN sw_configuration conf ON conf.name = 'PS_SHOP_DOMAIN' WHERE pl.id_lang = 6 1 Link to comment Share on other sites More sharing options...
musicmaster Posted October 28, 2015 Share Posted October 28, 2015 Thanks. Looks useful. Could it be that something is missing in the middle? p.show_price AS 'Show price (0 = No, 1 = Yes)', '.jpg') AS 'Image URL', 'Delete existing images', (select Link to comment Share on other sites More sharing options...
alinlup Posted November 3, 2015 Author Share Posted November 3, 2015 Indeed. It's concat(, ifnull(conf.value, 'examplet.com'), '/img/p/', p.id_product,'.jpg') AS 'Image URL' 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