【问题标题】:Move order button from one template to the other magento将订单按钮从一个模板移动到另一个 magento
【发布时间】:2014-03-06 15:27:22
【问题描述】:

我需要在 cart.phtml 中移动按钮顺序。我用代码解释: 这个按钮就是页面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?>

UpdateShoppingCart 和 ClearShopping 按钮位于页面 cart.phtml 中,如下所示:

<?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>¬

现在我想在 UpdateShoppingCart 按钮下集成按钮订单按钮,但是当我复制并粘贴 cart.phtml 中的订单按钮代码时,我的页面会生成错误:

出于安全原因,默认情况下禁用异常打印。

错误日志记录号:719365419413

有人有想法吗?

谢谢。

【问题讨论】:

    标签: php magento templates cart magento-1.8


    【解决方案1】:

    您可以通过将代码从 link.phtml 复制到 cart.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?>
    

    将其更改为以下内容:

    <?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?>
    

    希望对你有帮助。

    【讨论】:

    • 很高兴知道它有帮助。 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-03
    相关资源
    最近更新 更多