Magento. 如何编辑订单确认页面
August 24, 2015
本教程展示了如何 编辑订单确认页在Magento:
-
Navigate to app/design/frontend/ /基地/违约/模板checkout/success.phtml inside your site directory on the server via FTP or on your hosting cPanel and copy the success.phtml file to the app/design/frontend/ /默认/ themeXXX /模板checkout folder.
-
In order to test the changes,请执行以下步骤:
-
If your payment method is not Saved CC, set it to it in System -> Configuration -> Sales -> Payment Methods in your dashboard and use a test credit card 签出并显示成功页面. Visa测试卡号为4111111111111111:
- 临时编辑Magento Core代码文件以禁用清除 session 注释掉第227行周围的代码 app/code/core/Mage/Checkout/控制器/ OnepageController.php:
replace
$session->clear();
with:
//$session->clear();
-
-
In app/design/frontend/ /默认/ themeXXX /模板checkout/success.phtml 您可以编辑订单确认页代码.
我们强烈建议 编辑前备份文件:
-
To 编辑默认文本,将单引号之间的文本替换为您的. For example:
Replace
__('Your order has been received.') ?>
with
__('Great, we got your order!!!') ?>
-
For 显示收货地址 add this code:
Shipping Details
getLastRealOrderId();?> loadByIncrementId($order_id);?> _data["shipping_description"];?> getShippingAddress();?> " . 美元shipping_address_data(“firstname”);?> " . 美元shipping_address_data(“街”);?> " . 美元shipping_address_data(“城市”);?> " . 美元shipping_address_data [' country_id '];?> -
下面的代码将显示 订单汇总金额:
Order Amounts
Subtotal:' . Mage::helper("core")->currency($order_details->subtotal) . "";?> Tax:' . Mage::helper("core")->currency($order_details->tax_amount) . "";?> Discount:' . Mage::helper("core")->currency($order_details->discount_amount) . "";?> Amount Paid:' . Mage::helper("core")->currency($order_details->total_paid) . "";?> -
In order to display a custom static CMS block, for example social-buttons-block, use this code:
getLayout()->createBlock('cms/block')->setBlockId('social-buttons-block')->toHtml();?>
-
你可能也需要 clear the cache.
请随时查看下面的详细视频教程: