Post by jonah » Tue Apr 24, 2012 9:34 pm

Hi I have products that users need to upload a file or small image to on the the product page and then order.

The only problem is when you upload an image and click ok you're back on the product page which doesn't show what you have uploaded or a filename etc so it can be confusing.

Is there a way that I can display the successfully uploaded image filenames next to the upload boxes on my product template page in the options section?

Thanks for any help, I think someone was trying this or similar here: http://forum.opencart.com/viewtopic.php?f=20&t=56460 - but they haven't replied to the thread in a while and I'm not sure they wanted the same end result.

Thanks again :)

Website Design, hosting, seo and online marketing visit: http://www.yorkcreative.co.uk


New member

Posts

Joined
Sun Feb 19, 2012 12:54 am

Post by Avvici » Wed Apr 25, 2012 3:36 am

by uksitebuilder » Tue Mar 20, 2012 3:40 pm
Well your first problem is getting the customer to upload when viewing the cart or during checkout as there is no default functionality to do this.

It will most likely require custom coding by a developer ( your best bet is to post on the commercial support forum or contact a partner from the partners page)

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by jonah » Wed Apr 25, 2012 3:51 am

Hi thanks.

I'm already using the functionality of a file option for the upload and it uploads ok on the product page. I don't need to do this at checkout, just with the product options which seems to be working fine. I just need to show the filename next to the upload to confirm it...

thanks again if anyone can help with this.

Website Design, hosting, seo and online marketing visit: http://www.yorkcreative.co.uk


New member

Posts

Joined
Sun Feb 19, 2012 12:54 am

Post by 4thdesign » Tue Nov 06, 2012 2:18 am

Would be nice for some support here. He isnt the only one wanting a fix or a workaround for this.

Its such a shame as the product is brilliant, but have noticed there is a lot of support that goes unanswered...... this is CRUCIAL for users and developers alike to help each other out and make the product even better.

It even puts people off when they soon realise, support seems to be lacking.

However..... I will say, you're all doing a great job for a great product.... please if you have time, users need a bit of help now and then.

Thanks :)

Newbie

Posts

Joined
Sun Oct 28, 2012 10:39 pm

Post by Avvici » Tue Nov 06, 2012 2:50 am

Does it not already give you an alert (success message) telling you that it was succesful?

Code: Select all

if (json.success) {

			alert(json.success);

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by 4thdesign » Tue Nov 06, 2012 3:30 am

Yes sorry, my fault.

But would be nice to see a thumbnail of the image file thats been uploaded just for a "good feel factor" and confirmation the customer is happy that they selected the correct file to upload.

Is this possible to do?

Newbie

Posts

Joined
Sun Oct 28, 2012 10:39 pm

Post by Avvici » Tue Nov 06, 2012 7:02 am

Certainly. For 1.5.4.1, Open product.tpl and find this code:

Code: Select all

<input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
Right beneath it add this:

Code: Select all

<div id = "upload-message"></div>

Now find this line:

Code: Select all

alert(json['success']);
Below it add this:

Code: Select all

$('#upload-message').html(file + ': was uploaded');
And lastly find this:

Code: Select all

onComplete: function(file, json) {
Below it add this:

Code: Select all

$('#upload-message').html("");
If you want something fancier then you have the code to go to town with it.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by 4thdesign » Wed Nov 07, 2012 5:41 am

Thank you very much.

That worked brilliantly..... very much appreciated :)

Newbie

Posts

Joined
Sun Oct 28, 2012 10:39 pm

Post by Avvici » Wed Nov 07, 2012 7:55 am

yw

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by iomedesimo » Tue Nov 19, 2013 4:33 am

works really well ... but if there are more than one file to upload it writes only the last loaded ... can you solve it?

New member

Posts

Joined
Thu Dec 08, 2011 6:33 pm

Post by iomedesimo » Tue Nov 19, 2013 4:39 am

iomedesimo wrote:works really well ... but if there are more than one file to upload it writes only the last loaded ... can you solve it?
I've already solved ....
instead of

Code: Select all

<div id = "upload-message"></div>
i write

Code: Select all

<div id = "<?php echo $option['product_option_id']; ?>"></div>
and instead of

Code: Select all

$('#upload-message').html(file + ': was uploaded');
i write

Code: Select all

$('#"<?php echo $option['product_option_id']; ?>').html(file + ': was uploaded');

New member

Posts

Joined
Thu Dec 08, 2011 6:33 pm

Post by miradoro » Thu Feb 13, 2014 10:00 pm

the first code block worked great on 1.5.6.1 but will the info appear on the order email notification?

New member

Posts

Joined
Tue May 03, 2011 9:43 pm

Post by Sokonomi » Mon Mar 30, 2015 10:09 pm

Ive tried applying this to my 2.0.1.1 build, but unfortunately they tweaked the ajax code a little so it doesnt seem to work. Any chance of taking a crack at 2.0.1.1 to make it do the same stuff?

Active Member

Posts

Joined
Sun Sep 30, 2012 4:52 am

Post by anand2064 » Thu Mar 03, 2016 4:50 am

Can someone help with OC2 method please?

Newbie

Posts

Joined
Sun Feb 14, 2016 11:16 pm

Post by okeystm » Fri Mar 27, 2020 4:45 am

Yes me too. I'm struggling with OC2 .. Please someone help us to get this done.

Newbie

Posts

Joined
Fri Mar 27, 2020 4:41 am
Who is online

Users browsing this forum: No registered users and 36 guests