Jump to content
Sign in to follow this  
equilla

[CONTRIB] Options as Images for MS2

Recommended Posts

Hi All,

 

new Options as Images contrib just released here:

 

http://www.oscommerce.com/community/contributions,1467

 

Note, this is a complete rewrite from scratch and not a rework of the original contrib of similar name. Does exactly what it says on the tin (I hope....!).

 

Should also work with MS1, although this has not been tested.

 

Any comments, bugs, suggestions for improvement, please let me know.

 

Many thanks,

 

 

 

Mark

Share this post


Link to post
Share on other sites

Wooohooo - thanks alot equilla!!!

 

Installing it now - I will let you know how it all goes and report any problems.

 

Great work.

Share this post


Link to post
Share on other sites

I'm having a small problem with the install when I try to upload a file via admin:

 

1054 - Unknown column 'products_options_values_thumbnail' in 'field list'



update products_options_values set products_options_values_thumbnail = 'navy.jpg' where products_options_values_id = '13'



[TEP STOP]

Share this post


Link to post
Share on other sites

Hi,

 

yes, sorry about that. Missed something in the sql file that adds the required field to the products_options_values table.

 

The contrib has now been updated accordingly.

 

Apologies for that.

 

 

Mark

Share this post


Link to post
Share on other sites

It is working fine now - thanks.

 

After installing this I realise a problem that I have. I am using this for clothing (so I can have colours as attributes and now these colours will just appear automatically.

 

The problems is that, I also have fabric and sizing attributes. Obviously I don't need pictures for different sizes (or really fabrics). How difficult would it be to add an additional section in the admin where you could enabled/disable displaying options?

 

What do you think?

 

But congrats on getting this out - I'm sure it will be useful for a lot of people (and hopefully my idea is a gerneral progression and not too difficult)

Share this post


Link to post
Share on other sites

Hi,

 

I am having the same problems as the guy above had!

 

Could anyone tell me how I get rid of the data that I input and replace it with the new data. I think I may have used table prefixes with this install as well though.

 

Any help appreciated!

 

I have PHPAdmin btw, but am not sure how to overwrite the data!

 

Cheers :shock:

Share this post


Link to post
Share on other sites

lol, under "Configuration" I have "Options as Images"

 

And it has the headings of:

 

Title, Value, Action

 

But the page is blank, I have no buttons etc.

 

And the products attributes are no longer working properly! Ideas?

Share this post


Link to post
Share on other sites

it is all working fine here.

 

Sounds like you didn;t insert the SQL file in or you haven't upped all the files.

 

Check everything again.

Share this post


Link to post
Share on other sites

Hi Bren

 

sounds like you're missing some entries in your 'configuration' table. Click Browse and then click on configuration_id a couple of times to sort the table on that column in reverse. Have a look at the most recent entries - you should have 4 entries, all with configuration_group_id of 735.

 

If they are missing, just use the relevant 4 lines from the .sql file to insert them.

 

On the question of selectively using images for some options and not other, per product, this is definitely doable (already considered that this might come up). I'm going to have a look over the next week and see if I can come up with the goods on this one. It should only require an update to /catalog/admin/options_images.php and addition of one more database field.

 

Cheers,

 

 

 

Mark

Share this post


Link to post
Share on other sites

Oops! Better add /catalog/options_images.php to the list of files that would need to be updated.

 

Note to self - switch brain on before clicking submit. :o

 

Cheers,

 

 

Mark

Share this post


Link to post
Share on other sites

Hi,

 

All the files are there and i think the codes correct!

 

heres my modified sql file, i am using table prefix of "cdstor"

 

ALTER TABLE `cdstorproducts_options_values` ADD `products_options_values_thumbnail` VARCHAR(60) NOT NULL ;

 

INSERT INTO cdstorconfiguration_group VALUES (735, 'Options as Images', 'Configuration for the Options as Images Function', 20, 1);

 

INSERT INTO configuration VALUES ('', 'Use Images for Product Options?', 'OPTIONS_AS_IMAGES_ENABLED', 'true', 'Do you wish to enable images for options?', 735, 1, '2003-08-18 22:19:45', '0000-00-00 00:00:00', NULL, 'tep_cfg_select_option(array('true', 'false'),');

INSERT INTO configuration VALUES ('', 'Maximum number of images per row', 'OPTIONS_IMAGES_NUMBER_PER_ROW', '2', 'Enter the maximum number of images shown per row', 735, 2, '2003-08-20 12:58:16', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Options as Images - Image Width', 'OPTIONS_IMAGES_WIDTH', '80', 'Set width of option value images', 735, 3, '2003-08-20 12:55:16', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Options as Images - Image Height', 'OPTIONS_IMAGES_HEIGHT', '100', 'Options Images Height', 735, 4, '2003-08-20 12:55:22', '0000-00-00 00:00:00', NULL, NULL);

INSERT INTO configuration VALUES ('', 'Click to Enlarge Function', 'OPTIONS_IMAGES_CLICK_ENLARGE', 'true', 'Do you wish to enable the Click to Enlarge Function?', 735, 5, '2003-08-21 12:59:58', '0000-00-00 00:00:00', NULL, 'tep_cfg_select_option(array('true', 'false'),');

Share this post


Link to post
Share on other sites

I am no expert with MySQL or PHP (am still learning) - but if you are using a table prefix of CDSTOR then shouldn;t all entried have their prefix?

 

The bottom half of the statement doesn't have the CDSTOR prefix?

Share this post


Link to post
Share on other sites

Hi,

 

I have looked and I dont have the 4 entries :(

 

Is it the SQL file that i have put in wrong then? Any ideas what I have done wrong and how I can over write whats wrong?

Share this post


Link to post
Share on other sites

cant u edit your posts on this forum?

 

Fiscus, you will have to excuse me, programming really isnt my thing at all! I wasnt sure if I needed it there, as the prefix is only on the top tables? I'm lost lol!

Share this post


Link to post
Share on other sites

No editing on forum - i beleive it is because it is linked to a newgroup.

 

I was going to mention that about the prefix - but wasn;t sure of your setup. Basically the SQL file that comes with the latest version of the contribution will work fine.

 

Just use PHPMyadmin to insert it and you should be fine - no need to edit anything in it.

Share this post


Link to post
Share on other sites

Hi Bren,

 

don't panic. I remember what it was like when I started out messing with this stuff too!

 

Yes, you do need to put cdstor in front of those other entries too - assuming that your configuration table is called cdstorconfiguration - so they should become for example:-

 

INSERT INTO cdstorconfiguration VALUES ('', 'Use Images for Product Options?', 'OPTIONS_AS_IMAGES_ENABLED', 'true', 'Do you wish to enable images for options?', 735, 1, '2003-08-18 22:19:45', '0000-00-00 00:00:00', NULL, 'tep_cfg_select_option(array('true', 'false'),');

 

and so on....

 

Cheers,

 

 

 

Mark

 

Cheers,

 

 

Mark

Share this post


Link to post
Share on other sites

Cheers for the help!

 

I did what you said and couldnt work out why it wasnt working. It was because I had a space at the end of a line :roll:

 

Thanks once again for your help, it was starting to do my head in haha! :D

Share this post


Link to post
Share on other sites

Thanks to fiscus for testing this out for me.... a new version has just been posted which allows Options as Images or traditional dropdowns to be selected for each option type.

 

So, you can have Option as Images for Colour, a dropdown for size, etc, etc.

 

Instructions for upgrade from previous version (easy!) and full install from scratch are included.

 

As always, comments much appreciated.

 

Cheers,

 

 

 

Mark

Share this post


Link to post
Share on other sites

Hi,

 

Can someone show me a demo of this modules?? I really like to see it before i install it I don't want to mess up anything on my shop..

 

thanks

Share this post


Link to post
Share on other sites

Just a small problem!

 

I have 3 colours for a certain product.

 

I have all 3 pictures on the same line, the spacing between the 2nd and 3rd pictures is cocked up for some reason, it is fine if i make the images really small?

 

heres a screen shot to show what I mean...

 

http://www.indigoonline.co.uk/spacing.jpg

 

cheers for any information!

Share this post


Link to post
Share on other sites

Hi Bren,

 

couldn't see the problem to start with, but I think I know what's causing it now. Are you running the latest version of this mod? (I posted a newer one a few days back).

 

The original version put all the images for all options in one big table. The result is that the (+?70.50) in the second row is pushing the table column wider all the way up.

 

If you get the new version of the mod there is a new /catalog/options_images.php that now uses separate tables for each option and also accomodates a mixture options as images and dropdown selectors. To install the new version there are just 2 replacement files to copy up and an additional database field to add (upgrade instructions are included).

 

Cheers,

 

 

 

Mark

Share this post


Link to post
Share on other sites

I love this contribution, just one question though. I saw a similar contribution from a while ago that also provided groups of the attributes so you could apply groups to a product rather than each attribute to individual products - any hopes of doing that with this one too?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×