Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
One-page-checkout progress knocks out javascript ssl seal
 
zillion
Jr. Member
 
Total Posts:  5
Joined:  2009-08-12
 

I’d like to place my dynamically generated security cert seal under the one-page-checkout progress block.

It works on the first “page” but as I proceed through the checkout process the seal disappears. It’s as if the page update renders the cert script null.

Any ideas on how to forced the script to load with each update?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Track 23
Member
 
Total Posts:  50
Joined:  2008-03-19
 

I’m having this same issue. Does anyone know how to do this?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikesanz
Jr. Member
 
Total Posts:  2
Joined:  2009-11-28
 

I needed to do something similar to this. After searching for days (probably weeks), I came across this work around.

The trick is to place the progress.phtml code inside a new div (my-custom-right-column) and override the optcheckout.js to update this new div, instead of the whole right side column. You could then place your JavaScript before the div and it doesn’t get overwritten when the progress block gets refreshed.

In my situation, I needed a radio button in the Billing step so the customer can choose Pick Up or Delivery. When the option is selected, a hidden field stores the value and a call is made to function updateMyHeader() which displays the choice above the billing step in the progress block. You should be able to modify what I have done for your situation.

Here’s the changes I made to get it working:

skin/frontend/default/yourtheme/js/optcheckout.js

//REPLACE THIS:
/*
reloadProgressBlock: function(){     
       var request = new Ajax.Request(this.progressUrl, {method: 'get', onFailure: this.ajaxFailure.bind(this), onSuccess: function(transport) { $$('.one-page-checkout-progress').first().replace(transport.responseText);}});
        
     },
*/

//WITH THIS:
reloadProgressBlock: function(){
    
var updater = new Ajax.Updater(
        
'my-custom-right-column'
        
this.progressUrl
        
{method'get'onFailurethis.ajaxFailure.bind(this)}
    
);
},

design/frontend/default/yourtheme/template/checkout/onepage/progress.phtml

//Add any custom JavaScript or your own Div's in the beginning of the file, immediately after the license agreement
<script
function 
updateMyHeader()
{
/* I removed the if/elses in this function which determine what to set the innerHTML to, for clarity */
document.getElementById("puOrDelHeader").innerHTML "<div class='box2 one-page-checkout-progress2'><ol><li><h4 class='complete'>Pick Up or Delivery<span class='separator'>|</span> <a href='#billing' onclick=\"checkout.accordion.openSection(\'opc-billing\'); return false;\">Change</a></h4><div class='content'><b>Delivery</b></div></li></ol></div>";
}
</script>
 
<div id='puOrDelHeader'>
     <!-- 
My Content Gets Updated In Here -->
</
div>
 
<
div id="my-custom-right-column">   <!-- This is the new divEverything inside of this div will get refreshed -->
<
div class="box one-page-checkout-progress">

   <
h3><?php echo $this->__('Your Order Progress'?></h3>
    <
ol>
......
......
</
div>
</
div> <!-- Close the new divmy-custom-right-column -->

I duplicated the CSS classes (box2 one-page-checkout-progress2), because the Progress Update would duplicate my new Progress Header for some reason. You probably don’t not have to do this, though.

Credits to Szymon Switala for his blog post detailing many of these changes:  http://blog.baobaz.com/en/blog/magento-checkout-progress-with-custom-layout

 
Magento Community Magento Community
Magento Community
Magento Community
 
mikesanz
Jr. Member
 
Total Posts:  2
Joined:  2009-11-28
 

Correct to my previous post..

The original reloadProgressBlock function that you need to replace in opcheckout.js is actually:

/* Original function. Remove this */
    reloadProgressBlock: function(){
        
var updater = new Ajax.Updater($$('.col-right')[0]this.progressUrl{method'get'onFailurethis.ajaxFailure.bind(this)});
    
},

/* New function. Replace with this */
reloadProgressBlock: function(){
    
var updater = new Ajax.Updater(
        
'my-custom-right-column'
        
this.progressUrl
        
{method'get'onFailurethis.ajaxFailure.bind(this)}
    
);
},

I forgot that I had previously over written the function trying to get this working..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Track 23
Member
 
Total Posts:  50
Joined:  2008-03-19
 

Thank you, mikesanz! Based on the instructions you gave I didn’t even have to create an extra DIV - I simply gave an ID to the existing DIV in the progress.phtml file and then changed the pointer in the opcheckout.js file to point to the ID of that DIV instead of the class of the parent DIV. Then you can include whatever code you want above or below the DIV tag in progress.phtml. Here’s it is more explicitly:

In the progress.phtml file I changed this:

<div class="box one-page-checkout-progress">
to this:
<div class="box one-page-checkout-progress" id="customProgressBlock">

...and in the opcheckout.js file I changed this:

var updater = new Ajax.Updater($$('.col-right')[0]this.progressUrl{method'get'onFailurethis.ajaxFailure.bind(this)});
to this:
var updater = new Ajax.Updater($$('#customProgressBlock')[0]this.progressUrl{method'get'onFailurethis.ajaxFailure.bind(this)});

And that was it!

Thank you again for pointing this out - I can’t believe it was that easy. I don’t know why the Magento team didn’t handle it that way in the first place. Why would you target the parent of the container DIV? Strange behavior.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Liviu Jianu
Jr. Member
 
Total Posts:  7
Joined:  2010-05-11
 

Hello
I am having the same problem you had, i did what you said, but still nothing works.
If i try to click Continue i can`t go to step 3.
Please help

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|864 users currently online|497309 forum posts