De Dokta Posted June 9, 2015 Share Posted June 9, 2015 Hi Is it possible to change the article images with the selection of options? I have found several addons, tested them, but could not get to work one of them.So, I tried myself to find a simple solution:I added a new column 'options_values_image' to table 'products_attributes', an ajax script to product_info.php and wrote a new file to select the appropriate image for each option.Work half done: In the frontend, apart from some minor (cosmetic) issues the image change works as intended - with a single product image the change is really easy (demo: http://www.video-stuff.de/demo/bootstrap/matrox-g200-p-1.html- option: Model), with a set of images it was a bit more complicated but also possible (demo: http://www.video-stuff.de/demo/bootstrap/samsung-galaxy-p-28.html - option:case). And the colorbox also works. But where I currently really stuck, is the question how to get the options images into the database in the admin area? It's surely possible to add something for that to the products_attributes menu. But is the products_attributes really worth the effort? You can use it if you have a handful of products with some attributes - but with hundreds of articles with a lot of different options using this menu is really a nightmare!Integrating the image upload into the Ajax AttributesManager (which I really like) would be perhaps a better solution, but not all store owners have this tool in use.Or would it a better idea to create a separate file for that purpose? I'm not sure!Any ideas? J.J. Link to comment Share on other sites More sharing options...
♥Tsimi Posted June 9, 2015 Share Posted June 9, 2015 I think most of us agree that the an overhaul for the attributes page is long overdue. There were a few discussions in the past but no solution emerged from it. An AJAX solution would be very nice. At the moment the page loads every single time you click on a button which really is very annoying especially when you have many attributes to handle. If I am not mistaken the Attributes Manager by surfalot requires you to access each product to edit anything right? I personally like the solution in the AAS (Alternative Administration System). At this very moment the admin area is not officially bootstrapped yet but once that is done why not use a mix of modals and AJAX, like you used in your shipping quotes addon. Or a separate page as it is now but instead of keeping them open use the collapse or tabs class to open/close/switch the Options, Option Values and Product Attributes Areas combined with AJAX. Link to comment Share on other sites More sharing options...
clustersolutions Posted July 7, 2015 Share Posted July 7, 2015 @dedokta...for about 10 years I did it like you had suggested, so for multiple images per attribute I would just find them based on a file name convention. It served its purpose and it was a quick fix... During my BS upgrade, I had added a product attribute image table instead and just stored image names in that table like you would the main product images. mysql> desc products_attributes_images; +------------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | products_attributes_id | int(11) | NO | MUL | NULL | | | image | varchar(256) | YES | | NULL | | | htmlcontent | text | YES | | NULL | | | sort_order | int(11) | NO | | NULL | | | view_type | int(11) | YES | | NULL | | +------------------------+--------------+------+-----+---------+----------------+ Now, as for the admin side, I hadn't the time to do anything yet as I use a php script to load csv data and I do most of the product management in the frontend instead. So I guess that's on the back burner. It's kinda hard to develop based on a you know soon to be obsolete code base.... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.