Created
December 13, 2014 23:11
-
-
Save bouassaba/561c7075c533c7da2fe4 to your computer and use it in GitHub Desktop.
magento update cart and checkout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($this->isPossibleOnepageCheckout()):?> | |
<script type="text/javascript"> | |
// <![CDATA[ | |
function updateAndGoto(url) { | |
var cartForm = $$('.cart form').first(); | |
var action = cartForm.readAttribute('action'); | |
if (action.indexOf('return_url') < 0) { | |
var glue = action.indexOf('?') < 0 ? '?' : '&'; | |
action += glue + 'return_url=' + url; | |
cartForm.writeAttribute('action', action); | |
} | |
cartForm.submit(); | |
} | |
// ]]> | |
</script> | |
<button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="updateAndGoto('<?php echo $this->getCheckoutUrl() ?>');"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button> | |
<?php endif?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment