我目前的目标是添加一个新的客户属性(带有int类型),该属性应该显示为具有预定义选项的select(从具有可在后端编辑的条目的模型加载,这已完成).我正在努力正确使用$installer->addAttribute()方法,特别是指定正确的源选项.其他问题是新属性未保存到eav_entity_attribute表
我在Magento CE 1.5.1.0上
在Magento中,有一个功能,您可以通过指定在运行总计之前和之后来定义总计算的顺序.
我添加了一个自定义总计,如果我将以下行添加到config.xml,则排序错误.错误的意思是:tax_shipping来之前 shipping.这会导致运费的税费增加两倍.
但这违反了这一条件
tax_shipping
after: shipping
Run Code Online (Sandbox Code Playgroud)
我的猜测:整套规则必定存在一些矛盾.但我怎么能找到它呢?
这是我添加的唯一规则.没有这个规则,tax_shipping就会排序shipping.
<shippingprotectiontax>
<class>n98_shippingprotection/quote_address_total_shippingprotectionTax</class>
<after>subtotal,discount,shipping,tax</after>
<before>grand_total</before>
</shippingprotectiontax>
Run Code Online (Sandbox Code Playgroud)
下面我粘贴usort调用返回的已排序数组.Mage_Sales_Model_Quote_Address_Total_Collector::_getSortedCollectorCodes()
对于那些没有安装Magento的人,代码如下:
/**
* uasort callback function
*
* @param array $a
* @param array $b
* @return int
*/
protected function _compareTotals($a, $b)
{
$aCode = $a['_code'];
$bCode = $b['_code'];
if (in_array($aCode, $b['after']) || in_array($bCode, $a['before'])) {
$res = -1;
} elseif (in_array($bCode, $a['after']) || in_array($aCode, $b['before'])) {
$res = 1;
} else { …Run Code Online (Sandbox Code Playgroud) 我试图找出的问题是我们如何设置限制集合,我在Google上找到的答案仅适用于带有setPage的目录($ pageNum,$ pageSize).这不适用于任何其他收藏品.
请参阅以下答案.
请输入有效网址.在Magento 1.9.2安装中需要协议(http://,https://或ftp://)?
在安装Magento时,我在Magento 1.9.2中面临Web验证错误
我想知道是否有人发现或编写了一个扩展程序,允许magento网站管理员在添加产品时能够为其产品属性添加值.例如,如果我出售书籍并希望书籍作者位于下拉列表中以便在分层导航中使用,那么在添加产品之前我必须通过属性部分添加作者似乎很奇怪.从工作流的角度来看,在我的添加产品屏幕下拉菜单旁边添加"添加新值"按钮确实很有意义.
任何人有任何想法或见解?
我们在这里建立了一个很好的Magento专家社区.我很好奇Magento的扩展和其他软件工具(IDE,编辑等)每个人都在用它们来帮助他们的开发项目?
免费和商业工具都非常受欢迎.
如何将外部JavaScript文件添加到Magento,所以它的代码将包含在每个前端页面上?
我正在尝试为自定义模块实现一些配置设置.我设法在左侧导航栏中添加了一个标签和一个部分.但是当我想打开一个部分时,我得到一个404错误页面而没有任何进一步的信息.
到目前为止,我已经尝试了任何工作来阅读博客,示例等,但我找不到错误.也许你们中的某个人可以向我解释我做错了什么.
我的adminhtml.xml:
<?xml version="1.0" ?>
<config>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<tempest_section translate="title" module="Tempest">
<title>Tempest</title>
</tempest_section>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</config>
Run Code Online (Sandbox Code Playgroud)
我的config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Polyvision_Tempest>
<version>0.1.0</version>
</Polyvision_Tempest>
</modules>
<global>
<helpers>
<Tempest>
<class>Polyvision_Tempest_Helper</class>
</Tempest>
</helpers>
</global>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<tempest before="Mage_Adminhtml">Polyvision_Tempest_Adminhtml</tempest>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<adminhtml>
<menu>
<menu1 translate="title" module="Tempest">
<title>polyvision</title>
<sort_order>60</sort_order>
<children>
<menuitem1 module="Tempest">
<title>Tempest - Export</title>
<action>adminhtml/tempest_main</action>
</menuitem1>
</children>
</menu1>
</menu>
</adminhtml>
<default>
<tempest> …Run Code Online (Sandbox Code Playgroud) 我们想在产品页面添加动态块.问题是产品页面具有完整页面缓存(由于速度问题,我们无法将其关闭).我们希望根据登录用户的帐户在每个产品页面上显示不同的信息,并且因产品而异.
我创建了一个具有自己的缓存的单独块,但是它显示了上一个产品页面中的相同块.我正在尝试更改它的缓存方法,因此它不会保存以前产品页面中的缓存.
它最初几次进入产品页面,然后突然开始显示一个Magento错误页面,上面写着:"网站在检索http://www.mycompany.com/productpage.html时遇到错误.它可能是关闭维护或配置不正确."
这是我到目前为止所做的.我创建了app/code/local/MyCompany/MyModule/PageCache/etc/config.xml来添加MyCompany_PageCache_Model.
然后我用这些函数在app/code/local/MyCompany/MyModule/PageCache/Model/Container/MyFile.php中创建了控制缓存的文件:
protected function _getCacheId()
{
return 'CONSTANT_CACHE' . md5($this->_placeholder->getAttribute('cache_id'));
}
protected function _saveCache($data, $id, $tags = array(), $lifetime = null)
{
return false;
}
protected function _renderBlock()
{
$blockClass = $this->_placeholder->getAttribute('block');
$template = $this->_placeholder->getAttribute('template');
$block = new $blockClass;
$block->setTemplate($template);
$block->setLayout(Mage::app()->getLayout());
return $block->toHtml();
}
Run Code Online (Sandbox Code Playgroud)
我还使用我的占位符为CONSTANT_CACHE在Catalog/etc下创建了cache.xml.
上面的语法是不正确的,还是有更简单的方法来做到这一点?
我只是magento的新手.我在我的localhost上安装了magento.在我使用管理页面登录后进行所有设置后,即使使用正确的用户名和密码,我也无法登录Chrome浏览器.但是当我尝试登录firefox时没有问题.那么有人可以帮我解决这个问题吗?
magento ×10
php ×4
admin ×1
attributes ×1
caching ×1
collections ×1
graph-theory ×1
javascript ×1
magento-1.9 ×1
sorting ×1
system ×1
tooling ×1