Magento 修改toplink 的方法
7天成为Magento系统架构师,现在开始学习Magento全栈开发!
《Magento2.X企业级开发实战》
在magento 默认模板里面的顶部链接toplinks 在前台显示为
* My Account
* My Wishlist
* My Cart
* Checkout
* Log In
那么如何把它们修改成自己想要的链接呢?下面提供一个比较简单的方法:首先你必须找到文件header.phtml
它在默认模板里的路径为
app/design/frontend/default/default/template/page/html/header.phtml
修改时注意替换default为你的模板路径
找到打开编辑,在大概31行处你会看到一行代码
getChildHtml(‘topLinks’) ?>
把它直接替换成你要修改的链接,用php语言写成
MY ACCOUNT YOUR LINKS LOG IN
上面是示例代码,可根据自己需求修改。修改完保存刷新缓存即可。
如果只是想去掉我的购物车和结帐这两项,直接到对应的xml文件里修改即可,例如要修改checkout和Customer这两项,只需要到
app/design/frontend/default/default/layout/checkout.xml
和
app/design/frontend/default/default/layout/customer.xml
修改就可以了
参考:
customer.xml
My Account 10 Log Out 100 Log In 100 page/1column.phtml page/1column.phtml page/1column.phtml Forgot Your Password page/1column.phtml Password forgotten Reset a Password page/1column.phtml Reset a Password page/1column.phtml Send confirmation link Edit Account Info left.permanent.callout page/2columns-left.phtml my-account account customer/account/ account_edit customer/account/edit/ address_book customer/address/ simple checkout/cart_item_renderer checkout/cart/sidebar/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/cart/sidebar/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/cart/sidebar/default.phtmlpage/2columns-left.phtml
checkout.xml
simple checkout/cart_item_renderer checkout/cart/sidebar/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/cart/sidebar/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/cart/sidebar/default.phtmlpage/1column.phtml checkout/cart.phtml checkout/cart/noItems.phtml simple checkout/cart_item_renderer checkout/cart/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/cart/item/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/cart/item/default.phtmlpage/1column.phtml default checkout/cart_item_renderer checkout/multishipping/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/multishipping/item/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/multishipping/item/default.phtmldefault checkout/cart_item_renderer checkout/multishipping/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/multishipping/item/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/multishipping/item/default.phtmldefault checkout/cart_item_renderer checkout/multishipping/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/multishipping/item/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/multishipping/item/default.phtmlpurchaseorder payment/form/purchaseorder.phtmldefault checkout/cart_item_renderer checkout/multishipping/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/multishipping/item/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/multishipping/item/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/multishipping/overview/item.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/multishipping/overview/item.phtmlpage/2columns-right.phtml checkout-progress-wrapper 1 purchaseorder payment/form/purchaseorder.phtmlpurchaseorder payment/form/purchaseorder.phtml1 default checkout/cart_item_renderer checkout/onepage/review/item.phtmlgrouped checkout/cart_item_renderer_grouped checkout/onepage/review/item.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/onepage/review/item.phtmlpage/2columns-right.phtml page/2columns-right.phtml
转载请注明:(●–●) Hello.My Weicot » Magento 修改toplink 的方法
文章来源于互联网:Magento 修改toplink 的方法
如无特殊说明或标注,任何个人或组织,复制、转载、采集本站内容请注明:
本文来源于:【Magento中文网】,并添加本文地址链接。
如未按上述操作复制或转载,本站有权追究法律责任。
若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
本文来源于:【Magento中文网】,并添加本文地址链接。
如未按上述操作复制或转载,本站有权追究法律责任。
若本站内容侵犯了原著者的合法权益,可联系我们进行处理。