Hello there,
Do you have any idea when we use the option to upload the picture and can immediately show the upload picture???
if our customer cannot see the picture when they upload the file, it seems not user friendly.
Do you have any idea?
<!–Here is the box for holding the returned image–>
<!–Show Photo Thmub–>
<div style=”width:100px;height:100px;”>
Write Something!
</div>
<!–Show Photo Thmub–>
<!—->
<script type=”text/javascript”><!–
new AjaxUpload(‘#button-option-<?php echo $option['product_option_id']; ?>’, {
action: ‘index.php?route=product/product/upload’,
name: ‘file’,
autoSubmit: true,
responseType: ‘json’,
onSubmit: function(file, extension) {
$(‘#button-option-<?php echo $option['product_option_id']; ?>’).after(‘<img src=”catalog/view/theme/default/image/loading_black.gif” style=”padding-left: 5px;” />’);
/*I place this*/
$(“.content”).html(‘<img src=”‘ + file + ‘”>’ + file + ‘</img>’);
},
onComplete: function(file, json) {
$(‘.error’).remove();
if (json.success) {
$(‘input[name=\'option[<?php echo $option['product_option_id']; ?>]\’]').attr(‘value’, json.file);
}
if (json.error) {
$(‘#option-<?php echo $option['product_option_id']; ?>’).after(‘<span>’ + json.error + ‘</span>’);
}
$(‘.loading’).remove();
}
});
//–></script>
I got maximum 4 images may upload from customer, but I tried to put it into product_option.tpl and it won’t work, I hope you can help.
Thank you very much
Regards
Ken
|
|
Hi Ken,
Is this some kind of a third party plugin?
As far as we know, OpenCart and Shoppica by default are not showing the uploaded images.
|
|