Hi, does any of you have any idea how to replace the spinning upload wheel with a progress bar?
Have googled to the moon and back but failed to find an answer.
many thanks!
I found a solution for this (and do not want to post a new topic because this one is the first you will find while searching for "opencart upload progess bar" or similar)...
The following is tested with 2.0.3.1!
Edit "template\product\product.tpl":
Add the following code between "processData: false," and "beforeSend: function() {" where the JavaScript file upload things are done:
Do not forget/ignore the commas! Take a look on how they are placed in the other lines!
Add the following code before "$('.date').datetimepicker({":
Now you need to add the following HTML stuff at the position where you want the progress bar to be shown (for example right under the upload button):
Upload the modified product.tpl and do not forget to click the "Refresh" button in the backend (Extensions -> Modifications).
That's it!
PS: I am not a programmer, I found some suggestions in this stackoverflow topic (http://stackoverflow.com/questions/1662 ... chronously) and did some try-and-error. It seems that there are some problems with "older" IE versions.
The following is tested with 2.0.3.1!
Edit "template\product\product.tpl":
Add the following code between "processData: false," and "beforeSend: function() {" where the JavaScript file upload things are done:
Code: Select all
xhr: function() {
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload){
myXhr.upload.addEventListener('progress',progressHandlingFunction, false);
}
return myXhr;
},
Add the following code before "$('.date').datetimepicker({":
Code: Select all
function progressHandlingFunction(e){
if(e.lengthComputable){
$('progress').attr({value:e.loaded,max:e.total});
}
}
Code: Select all
<progress class="progress-bar" role="progressbar" style="width:100%;background-color:#EFEFEF;" value="0"></progress>
That's it!
PS: I am not a programmer, I found some suggestions in this stackoverflow topic (http://stackoverflow.com/questions/1662 ... chronously) and did some try-and-error. It seems that there are some problems with "older" IE versions.
Who is online
Users browsing this forum: No registered users and 76 guests