Page 1 of 1

Image Options - Default To First Option

Posted: Fri Aug 19, 2016 7:14 pm
by Bobbio999
Hi,

Is there anyway to default to the first image option when a customer opens the Product page?

I've looked high and low for the answer to this and can't believe nobody else has had this issue.

Kind Regards

Re: Image Options - Default To First Option

Posted: Wed Aug 24, 2016 5:10 pm
by Bobbio999
Is there no solution to this?

I'm amazed it's not as simple as a simple admin function in the Options themselves.

Not being a PHP guru I don't have the skills to write this myself, but I would imagine it's a bit of additional code around the image part of the product.tpl file.

Any gurus out there?

Re: Image Options - Default To First Option

Posted: Wed Aug 24, 2016 5:17 pm
by cyclops12
Not quite sure i understand the question....

How have you added images for the products ??

A link to your site where the problem is or a screenshot will be helpful if possible

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 6:56 pm
by Bobbio999
Hi,

Yes, I have products with many mandatory image options. Every option carries an additional charge.

Therefore the Price of a product updates automatically when a mandatory option is chosen.

The problem is, some customers feel a little cheated as the price they see before adding mandatory options is not yet the final price.

If I could default all my Options to the first (cheapest) option, then the real price would be shown and the customer can then go for more expensive options should they wish.

Please see where this is happening now http://envelopesprinted.com

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 8:08 pm
by cyclops12
Are you using an extension for option images and if so can you not order them by sort order?

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 8:35 pm
by artcore
Hi,
I like the colorful design :)

You can activate all first options automatically using this:

Code: Select all

<script>$('[id^=input-option]').find('input[type=radio]:first').trigger('click');</script>
Add it to the product.tpl just above the <?php echo $footer; ?> and refresh the modification cache!

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 9:27 pm
by Bobbio999
Hi,

I'm not using an extension for the Image Options and yes I can order them using Sort Order.

BUT

I wish the first one (Order Id 1) to default to being chosen.

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 9:30 pm
by Bobbio999
Hi Artcore,

Thanks for the positive feedback on the site.

I shall try your line of new code out of business hours today, but it looks like this will work a treat.

Thank you so much.

Re: Image Options - Default To First Option

Posted: Thu Aug 25, 2016 11:24 pm
by Bobbio999
Hi Artcore,

FIXED.

This little piece of codes works perfectly. A million thanks.

Bobbio

Re: Image Options - Default To First Option

Posted: Fri Aug 26, 2016 12:38 am
by artcore
You're welcome, Bobbio!

Re: Image Options - Default To First Option

Posted: Thu Jun 14, 2018 6:49 pm
by 3PO2017
artcore wrote:
Thu Aug 25, 2016 8:35 pm
Hi,
I like the colorful design :)

You can activate all first options automatically using this:

Code: Select all

<script>$('[id^=input-option]').find('input[type=radio]:first').trigger('click');</script>
Add it to the product.tpl just above the <?php echo $footer; ?> and refresh the modification cache!
Thanks man, it work for me on oc 3

Re: Image Options - Default To First Option

Posted: Fri Aug 30, 2019 9:59 pm
by imdevlper18
I have created an ocmod from above ( Credits: ArtCore ).
So it can be installed via extension installer.
See attached.