wayann Posted January 30, 2015 Share Posted January 30, 2015 (edited) Hi there, can someone point me where I should hook my mod so I can import colours with value:position:hex for example White:0:#ffffff who's in charge for that task? the AttributeGroup class? the Attribute class? the Combination class? I've looked in there and I can hack a quick sql query but I was wondering if there is a more elegant way to do it... and which class I should override. that would be very handy for my purpose, Edited January 30, 2015 by wayann (see edit history) Link to comment Share on other sites More sharing options...
wayann Posted January 30, 2015 Author Share Posted January 30, 2015 I see you can upload texture also, but wouldn't be wicked to have White:0:#ffffff, Texture:1:http://localhost/prestashop/p/texture.jpg and once defined on the first product others just need the specify the name value. 1 Link to comment Share on other sites More sharing options...
jorozco Posted March 4, 2015 Share Posted March 4, 2015 Hi Guys! I was wondering, there exist an easy way to add and import hexadecimal colors in product combinations from a CSV file? Thanks for your help! Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted March 18, 2018 Share Posted March 18, 2018 up plz 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...
fancy|modules Posted September 1, 2019 Share Posted September 1, 2019 for import color codes in color attribute group via 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