Question

I need to move the button order in cart.phtml. I explain that with code: This button is the order button on the page link.phtml:

<?php if ($this->isPossibleOnepageCheckout()):?>                                                                                                                                                                                                                            
 <button type="button" title="<?php echo $this->__('Commander') ?>"           
 class="button btn-proceed-checkout btn-checkout                              
 <?php if ($this->isDisabled()):?> no-checkout                                
 <?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"        
 <?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';">
 <span><span><?php echo $this->__('Commander') ?></span></span></button>      
<?php endif?>

The buttons UpdateShoppingCart and ClearShopping are in page cart.phtml like this:

<?php endif; ?>¬                                                                                                                                                                                                                                                        
<button type="submit" name="update_cart_action" value="update_qty"¬           
   title="<?php echo $this->__('Update Shopping Cart'); ?>" ¬                   
     class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?>¬
     </span></span></button>¬                                                     
    <button type="submit" name="update_cart_action" value="empty_cart"¬           
      title="<?php echo $this->__('Clear Shopping Cart'); ?>" ¬                   
     class="button btn-empty" id="empty_cart_button"><span><span>¬               
    <?php echo $this->__('Clear Shopping Cart'); ?></span></span></button>¬

Now i will like to integrate the button order button juste under the UpdateShoppingCart button but when i copy and past the order button code in cart.phtml my page generate an error:

Exception printing is disabled by default for security reasons.

Error log record number: 719365419413

Does anyone have an idea ?

Thanks.

Was it helpful?

Solution

you can accomplish this by copying the codes from link.phtml to cart.phtml but with a slight modification.

<?php if ($this->isPossibleOnepageCheckout()):?>                                                                                                                                                                                                                            
 <button type="button" title="<?php echo $this->__('Commander') ?>"           
 class="button btn-proceed-checkout btn-checkout                              
 <?php if ($this->isDisabled()):?> no-checkout                                
 <?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"        
 <?php endif; ?> onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';">
 <span><span><?php echo $this->__('Commander') ?></span></span></button>      
<?php endif?>

Change this to the following:

<?php $block = $this->getLayout()->createBlock('checkout/onepage_link');
      if ($block->isPossibleOnepageCheckout()):?>
          <button type="button" title="<?php echo $block->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($block->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($block->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="window.location='<?php echo $block->getCheckoutUrl() ?>';"><span><span><?php echo $block->__('Proceed to Checkout') ?></span></span></button>
     <?php endif?>

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top