Magento-进入主题中的“结账”按钮位置


Magento - Proceed to Checkout button location in theme

我正在寻找在Magento购物车中生成"继续结账"按钮的文件(及其位置)。

尝试将产品添加到购物车中,然后转到购物车。"继续结账"按钮位于购物车的右侧。

我正在使用一个关于空白主题的变体,如果这有什么不同的话。

提前感谢您的帮助。

生成Proceed to Checkout链接的代码位于templates/Checkout/onepage/link.phtml 中

默认情况下,它的块位于checkout.xml中;

            <block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
                <label>Payment Methods After Checkout Button</label>
                <block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/>
                <block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping" template="checkout/multishipping/link.phtml"/>
            </block>
app/design/frontend/your_package/your_theme/template/checkout/onepage/link.phtml

导致单页结账的"继续结账"按钮是使用以下模板生成的:checkout/onepage/link.phtml

通过查看checkout.xml布局文件的checkout_cart_index句柄,您应该能够知道哪些按钮与哪些模板一起添加。名为checkout.cart.methods的块包含所有按钮,两个基本签出按钮应直接添加到同一文件中。

转到系统->配置->开发人员当前配置范围更改为某些网站或商店,然后转到Debug部分,并将Template Path Hints设置更改为"是"。现在,在前端,您将看到文件系统中渲染的每个块的模板文件的完整路径,因此现在您可以看到模板(渲染链接)所在的位置。

在根目录中打开此路径

/app/design/frontend/base/default/template/checkout/onepage/link.phtml

找到这个代码

<?php if ($this->isPossibleOnepageCheckout()):?>
    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($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="window.location='<?php echo $this->getCheckoutUrl() ?>';"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
<?php endif?>