nughett Posted April 10, 2011 Share Posted April 10, 2011 I think I found a way how to combine combinations with images at once. As you may know you have to combine each combination with image in Admin panel, combination after combination. It is time consuming if you have 2 000 products and 8 000 combinations. This example might not work for everyone, but I'd like to share it with you anyway to help you safe hours of time or buying expensive software. In order to work you must fulfil particular conditions. Your name of the image must be your "Reference #" and each combination you want to change the picture must have different "Reference #" (this # refers to the name of the image). You have already imported your products and combinations.Your gonna have to put this to admin/tabs/AdminImport.php file on line 768 (replace $image->legend = self::createMultiLangField($product->name[$defaultLanguageId]); with folowing code). // If your path goes something like this: http://www.something.com/images/imagename.jpg, this is gonna get "imagename" string out of it. $url1 = explode("/",$url); $pocet_url = count($url1); $url2 = $url1[$pocet_url-1]; $url1 = explode(".",$url2); $url2 = $url1[0]; $image->legend = self::createMultiLangField($url2); Then upload attached file to your web directory, edit it as necessary and launch it in your browser.I've test it and works great for me. Hope it helps. If you have any questions PM me.P.S.: I am sorry if my php programming looks awful - I am not a pro. combine.php Link to comment Share on other sites More sharing options...
ubergirl Posted April 29, 2011 Share Posted April 29, 2011 Hi there,I'm not a programmer, but I think your solution could work for me:My case:I have a site with 2 languages (let's say lang1 and lang2). I used the import tool in the back office. The name of the images (i.e. the legend) is taken automatically from the item name, but is stored separately, in another table (ps_image_lang). When we import, we have to specify which language we are importing, so we cannot import both langages at the same time. So we import lang1 first. What it does is fill the blanks of lang2 with lang1 in order not to leave any blanks.My problem:When I import lang2, it replaces the text that was filled with lang1 by default everywhere, but not the image names, stored in ps_image_lang.If your solution could work for me, can you explain in a more "dumb-proof" way?Thanks 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