我正在运行Mage 1.5.0.1,我正在尝试从"我的帐户"部分删除导航链接.
我的local.xml有以下工作正常:
<customer_account>
<reference name="root">
<action method="setTemplate"><template>page/staticpage.phtml</template></action>
</reference>
<reference name="left">
<remove name="cart_sidebar" />
<remove name="catalog.compare.sidebar" />
</reference>
</customer_account>
Run Code Online (Sandbox Code Playgroud)
当我尝试添加以下代码时系统抛出并出错:
<reference name="customer_account_navigation">
<action method="removeLinkByName"><name>recurring_profiles</name></action>
<action method="removeLinkByName"><name>billing_agreements</name></action>
</reference>
Run Code Online (Sandbox Code Playgroud)
错误
Invalid method Mage_Customer_Block_Account_Navigation::removeLinkByName
Run Code Online (Sandbox Code Playgroud)
我在1.4中看到了这个功能,是不是不再支持了,还是我做错了什么?
我想获取用户在结账时选择的送货方式的名称.有谁知道如何检索该信息?
这将在某种程度上得到它,但它被缓存:
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingDescription();
当我在onetep结账时,我回到运输选项卡并更改运输,它仍然持有旧的运输方式.我需要弄清楚如何获得当前的.
我不想为所有交易电子邮件创建模板,但我想替换用于电子邮件的默认Magento徽标.
我知道我可以进入基本目录并替换它,但如果我升级系统,它将擦除它.有谁知道改变它的正确方法?
我已禁用wishlist块的布局:
<block type="catalog/product_view" name="product.info.addtoto" as="addtoto" template="catalog/product/view/addto.phtml"/>
Run Code Online (Sandbox Code Playgroud)
我现在想在phtml中调用该块而不是将其添加到另一个布局.
我该如何直接调用它?
我有以下代码:
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect(array('name', 'price', 'small_image', 'status'), 'inner')
->addCategoryFilter(Mage::getModel('catalog/category')->load($catid));
$_helper = $this->helper('catalog/output');
foreach ($_productCollection as $_product):
echo $_product->getProductUrl();
endforeach
Run Code Online (Sandbox Code Playgroud)
我想学习如何发现我可以在对象上使用的方法.
例如$ _product-> getProductUrl()使用方法getProductUrl()来获取url,但我需要价格并且不知道调用它的方法.使用print_r并没有为我提供足够的信息来发现它们是什么.我认为它们位于MAGE核心的控制器中.我有商业错误,我已经厌倦了看:http://docs.magentocommerce.com/ 但我发现自己有时会丢失.
有没有人知道这方面的好教程还是可以指导我解决这个问题?
我想将CMS页面的内容拉入我的静态块,如果你知道如何做到这一点,我将不胜感激.
我有一个CMS页面,我将使用以下更新的XML代码显示产品:
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/wholesale-list.phtml">
<action method="setCategoryId"><category_id>191</category_id></action>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</reference>
Run Code Online (Sandbox Code Playgroud)
我已经尝试获取我在布局中设置的ID,但没有这样的运气.我试过了:
$_category = Mage::registry(‘current_category’);
$currentCategoryId= $_category->getId();
Run Code Online (Sandbox Code Playgroud)
和
$layer = Mage::getSingleton(‘catalog/layer’);
$_category = $layer->getCurrentCategory();
$currentCategoryId= $_category->getId();
Run Code Online (Sandbox Code Playgroud)
但这些方法都不起作用.有谁知道我怎么能得到身份证?
我正在使用产品网格,某些页面需要4列,在某些页面上有两行8个产品,在其他页面上有5列,每行10个产品.
我可以获得不同的列,但不会更改管理区域中设置的产品数量.对于我的5个列页面,如何覆盖每页8个产品的默认值?