jorozco Posted March 4, 2015 Share Posted March 4, 2015 (edited) Hi PrestaShop hackers! This week i have been playing a lot with the import features that PrestaShop provides, super useful. But I was wondering, there exist an easy way to add the hexadecimal value for a color within the combinations_import.csv file? Currently, all the combinations from my testing side are imported right, but without the hexadecimal color value. Thanks for your time and happy hacking! Edited March 4, 2015 by jorozco (see edit history) Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted March 18, 2018 Share Posted March 18, 2018 up Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted March 23, 2018 Share Posted March 23, 2018 my own python code import csv field_names = ['color_name', 'hex'] start_id = 946 with open('colors_hex.csv', mode='r') as infile: reader = csv.reader(infile, delimiter=';') next(reader, None) # skip the headers for i, rows in enumerate(reader): print("INSERT INTO `ps_attribute_lang` (`id_attribute`, `id_lang`, `name`) VALUES ('{1}', '1', '{0}'), ('{1}', '2', \"{0}\");".format(rows[0], i+start_id)) print("INSERT INTO `ps_attribute` (`id_attribute`, `id_attribute_group`, `color`, `position`) VALUES ('{2}', '3', '{0}', '{1}');".format(rows[1], i, i+start_id)) print("INSERT INTO `ps_attribute_shop` (`id_attribute`, `id_shop`) VALUES ('{0}', '1');".format(i+start_id)) Link to comment Share on other sites More sharing options...
Massimo333 Posted April 10, 2019 Share Posted April 10, 2019 How can I use this python code? Link to comment Share on other sites More sharing options...
fancy|modules Posted September 1, 2019 Share Posted September 1, 2019 for importing colors codes using csv file you can use this module: https://addons.prestashop.com/en/combinaisons-customization/46318-bulk-colors-import.html 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