Post by coopsgroup » Fri Oct 18, 2024 6:04 pm

Help Changing the Default Size of Product Options Images From 50x50 to ones you can actually see .

All the old ways I have read to do this no longer work? As it seems to generate the Thumbnails sizes when you upload the images but i Can 't find any setting in i order to Change their Size, Ever in the Admin >IMages Options - Their Are no Theme Options Other than ON/Off and IN the Code below I can't seem to change it?

Please Advise Very Simple Mod Taking Hours of Searching with no luck - Should be a simple option really like all the other Image Thumbnails?

Code: Select all

<img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %}{{ option_value.price_prefix }} {{ option_value.price }}{% endif %}" class="img-thumbnail"/>
Tried - option_value.thumb works but doesnt change size?

That Are the option_value options? Shoudl be able to use the 100x100 Thubnail it auto Generates ?
Thanks
Carl

Newbie

Posts

Joined
Tue Mar 01, 2022 9:01 pm

Post by ADD Creative » Fri Oct 18, 2024 7:07 pm

Looks like the option image size is hard coded in the controller.
https://github.com/opencart/opencart/bl ... t.php#L381

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Fri Oct 18, 2024 7:20 pm

coopsgroup wrote:
Fri Oct 18, 2024 6:04 pm
All the old ways I have read to do this no longer work?
Tell us what you've tried so far?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by coopsgroup » Thu Oct 24, 2024 5:30 pm

OK - I looked online and ended up changing the product.twig to load thumb image not the Gernerated one then adding a stylesheet to customize its size -

After the Above post i modifyed the controller to use 100x 100 instead this worked much better and ment less coding.

How ever I do also want to disaply differnt Product Pages deppending on products and I did this by creating -

view/template/product/Producthouse.twig
contoller/product/producthouse.php -Edited Controller to load relevent info
$this->load->language('product/producthouse');
$this->response->setOutput($this->load->view('product/producthouse', $data));

lang ... /producthouse.php
model ... /producthouse.php

Created new layout in CMS - Product house / route = product/producthouse
But that doesnt seem to work to allow me to select it as a differnt layout in the admin - Can this not be done? I didn't want to alter the core product - But want to remove the wishlist and reviews from some products for wholesellers, and display differnt size images on the pages and layouts.

I am not sure this can be done now? any advise
Carl

Newbie

Posts

Joined
Tue Mar 01, 2022 9:01 pm

Post by ADD Creative » Thu Oct 24, 2024 8:05 pm

A layout only controls modules not templates. You would need to modify the product controller and use the template you need in there.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: imager and 2 guests