Jump to content

Order history "showOrder" not working correctly


Recommended Posts

We're using the 'Blank Canvas' theme ( http://www.prestashop.com/forums/topic/175497-prestashop-theme-boilerplate-a-blank-canvas-theme-for-developers/ ) and have been adapting it for our needs and fixing issues here and there, but we're stumped on this one.

 

On the Order History page where it lists the customer's orders, when you click one of the orders, the order details do not appear.

 

Just installed it on another Prestashop installation and it suffers the same issue.

 

What's strange though, is if you have the Blank Canvas theme enabled and go to the Order History page, then change the theme to the default, then click the order details, it DOES display the information (after un-hiding the div via browser developer tools).

 

So far we've been able to solve all the issues with some searching and trial and error, but this one has us especially confused.

 

If someone knows what javascript/other files are referenced when clicking the view details link, I'm sure that would give us a solid starting point for solving the issue.

 

Any pointers would be much appreciated!

Thanks.

Link to comment
Share on other sites

Appears the issue lies within the history.js file, where it calls this bit of code:

$(this).html(data);

In the default theme, it contains the exact div + contents we expect to see (div #block-order-detail).

In the blank canvas theme it contains the entire page HTML, plus the div that we expect.

 

Any advise on how to manipulate that? :\

Link to comment
Share on other sites

  • 5 weeks later...

Rh1nO

I have the same problem. The case is I am not a expert like you in Prestashop.

Could you tell us the solution you have implemented? Tks.

The fix involved the following changes, from what I can remember at least...

In order-detail.tpl

Find:

{if count($messages)}

Add this after:

<!--openComment-->

Also add this to the very bottom of the file:

<!--closeComment-->

In history.js

Find the following code:

function sendOrderMessage()
{
paramString = "ajax=true";
$('form#sendOrderMessage').find('input, textarea').each(function(){
 paramString += '&' + $(this).attr('name') + '=' + encodeURI($(this).val());
});
$.ajax({
 type: "POST",
 url: $('form#sendOrderMessage').attr("action"),
 data: paramString,
 success: function (msg){
  $('#block-order-detail').fadeOut('slow', function() {
   $(this).html(msg);
   //catch the submit event of sendOrderMessage form
   $('form#sendOrderMessage').submit(function(){
 return sendOrderMessage();
   });
   $(this).fadeIn('slow');
  });
 }
});
return false;
}

And replace it all with the following:

function sendOrderMessage()
{
paramString = "ajax=true";
$('#sendOrderMessage').find('input, textarea').each(function(){
 paramString += '&' + $(this).attr('name') + '=' + escape($(this).val());
});
$.ajax({
 type: "POST",
 url: $('#sendOrderMessage').attr("action"),
 data: paramString,
 success: function (msg){
  $('#block-order-detail').fadeOut('slow', function() {
   ind1 = msg.indexOf("<!--openComment-->");
   if (ind1 > 1){
 msg = msg.substr(ind1);
 ind2 = msg.indexOf("<!--closeComment-->");
 msg = msg.substr(0,ind2);
   }
   $(this).html(msg);
   //catch the submit event of sendOrderMessage form
   $('#sendOrderMessage').submit(function(){
 return sendOrderMessage();
   });
   $(this).fadeIn('slow');
  });
 }
});
return false;
}

 

As usual, please make backups before attempting any of the above changes. Hopefully that works for you, I forget if that's all that needed to be changed as it was so long ago now, and have found and fixed so many other things since then, as well as some things still unsolved that we just decided to remove. :P

Link to comment
Share on other sites

  • 2 weeks later...

Did you try my proposed fix?

 

Unfortunately, the support here isn't very helpful at times - as hard as they try, it's hard to get to everything. I found out the hard way you have to get your hands dirty. Things don't often fix themselves. ;)

Link to comment
Share on other sites

Hi rhin0Yes a tried your proposal but it did not work for me.

 

Thank you even for writing me :D , I was feeling very stupid talking to the wind.

 

Today I am going to try to download the new prestashop and change those files you changes ....I will back up first because I really dont know waht I am doing

 

thank you, if you ever need help with a recipe like paella, cookies or brownie, contact me, with presatshop I wont be any help

Link to comment
Share on other sites

  • 10 months later...

I've had the same problem. My solution:

 

Open header.php and add:

 

_THEME_JS_DIR_.'history.js',

 

$js_files = array(
    __PS_BASE_URI__.'js/jquery/thickbox-modified.js',
    __PS_BASE_URI__.'js/jquery/jquery.idTabs.modified.js',
    __PS_BASE_URI__.'js/jquery/jquery.scrollto.js',
    __PS_BASE_URI__.'js/jquery/jquery.serialScroll.js',
    _THEME_JS_DIR_.'tools.js',
    _THEME_JS_DIR_.'history.js',
    _THEME_JS_DIR_.'product.js'
);
 
 
Link to comment
Share on other sites

  • 3 months later...

 

I've had the same problem. My solution:

 

Open header.php and add:

 

_THEME_JS_DIR_.'history.js',

 

$js_files = array(
    __PS_BASE_URI__.'js/jquery/thickbox-modified.js',
    __PS_BASE_URI__.'js/jquery/jquery.idTabs.modified.js',
    __PS_BASE_URI__.'js/jquery/jquery.scrollto.js',
    __PS_BASE_URI__.'js/jquery/jquery.serialScroll.js',
    _THEME_JS_DIR_.'tools.js',
    _THEME_JS_DIR_.'history.js',
    _THEME_JS_DIR_.'product.js'
);

 

how header.php ? what folder ? it can't be the one in root...

Link to comment
Share on other sites

  • 3 months later...

I had this issue again after our SEO company told us to get our pages loading faster, which involved some of the cache/minifying options in Advanced Parameteres - > Performance, looks like, for me at least, Minify HTML after "smarty compile" execution causes the order details to break - have reverted to Keep HTML as original.

 

I did also find in my searches that others experienced problems with template cache or the cache option in general, in some cases just disabling cache and testing, then re-enabling cache fixed it - for whatever reason. Prestashop is weird, as I'm sure we all know.  ;)

 

Hope that helps someone.

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...