Post by chriswhill » Wed Mar 28, 2018 5:00 pm

OC version: 3.0.2.0
Is there a way or work around to display the filename or thumbnail of an image that is uploaded in a product option? Or even just change the upload button to read "uploaded" once a file is uploaded. There is a success dialog box by default, but once closed its not clear the file is there and it could be a little confusing to customers.

Any help is greatly appreciated.

Kind regards,
Chris.
Last edited by chriswhill on Thu Mar 29, 2018 5:28 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Dec 06, 2017 3:54 am

Post by straightlight » Thu Mar 29, 2018 1:59 am

In catalog/controller/tool/upload.php file,

find:

Code: Select all

$json['success'] = $this->language->get('text_upload');
replace with:

Code: Select all

$json['success'] = sprintf(htmlspecialchars_decode($filename), $this->language->get('text_upload'));
In catalog/language/en-gb/tool/upload.php file,

replace:

Code: Select all

$_['text_upload']    = 'Your file was successfully uploaded!';
with:

Code: Select all

$_['text_upload']    = 'The file: %s was successfully uploaded!';
This should resolved the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by DigitCart » Thu Mar 29, 2018 2:32 am

Hi,
You can keep success message bellow upload button.
File:

Code: Select all

catalog\view\theme\default\template\product\product.twig
Find:

Code: Select all

$('.text-danger').remove();
Replace with:

Code: Select all

$('.text-danger, .text-success').remove();
Find:

Code: Select all

alert(json['success']);
Replace with:

Code: Select all

$(node).parent().find('input').after('<div class="text-success">' + json['success'] + '</div>');

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by chriswhill » Thu Mar 29, 2018 4:58 am

Thank you so much both of you. I wen't with DigitCart's method as it seemed like the simplest fix, works perfectly.

Newbie

Posts

Joined
Wed Dec 06, 2017 3:54 am

Post by DigitCart » Thu Mar 29, 2018 12:01 pm

You're welcome!

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by tingwing » Mon Dec 05, 2022 4:52 pm

two suggestions together works perfectly

Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm
Who is online

Users browsing this forum: Bing [Bot], sidclel and 81 guests