Post by Bobbio999 » Fri Aug 19, 2016 7:14 pm

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

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by Bobbio999 » Wed Aug 24, 2016 5:10 pm

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?

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by cyclops12 » Wed Aug 24, 2016 5:17 pm

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

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by Bobbio999 » Thu Aug 25, 2016 6:56 pm

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

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by cyclops12 » Thu Aug 25, 2016 8:08 pm

Are you using an extension for option images and if so can you not order them by sort order?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by artcore » 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!

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by Bobbio999 » Thu Aug 25, 2016 9:27 pm

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.

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by Bobbio999 » Thu Aug 25, 2016 9:30 pm

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.

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by Bobbio999 » Thu Aug 25, 2016 11:24 pm

Hi Artcore,

FIXED.

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

Bobbio

New member

Posts

Joined
Thu Apr 16, 2015 11:19 pm

Post by artcore » Fri Aug 26, 2016 12:38 am

You're welcome, Bobbio!

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by 3PO2017 » Thu Jun 14, 2018 6:49 pm

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

New member

Posts

Joined
Fri Feb 24, 2017 10:27 pm

Post by imdevlper18 » Fri Aug 30, 2019 9:59 pm

I have created an ocmod from above ( Credits: ArtCore ).
So it can be installed via extension installer.
See attached.

Attachments

Auto Select First Option


Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm
Who is online

Users browsing this forum: No registered users and 31 guests