我创建了一个可配置的产品,它有三个选项:颜色,大小和样式.
现在在产品页面中,每个选项在下拉列表中都有默认文本" 选择一个选项... ",但我希望文本应该是" 选择颜色 "," 选择大小 "和" 选择样式 ".
我在app\code\core\Mage\Catalog\Block\View\Type\Configurable.php中编辑了函数getJsonConfig()
从:
'chooseText' => Mage::helper('catalog')->__('Choose an Option...'),
Run Code Online (Sandbox Code Playgroud)
至:
'chooseText' => ('Select ').$attribute->getLabel(),
Run Code Online (Sandbox Code Playgroud)
并将文件的第39行编辑frontend/base/default/template/catalog/product/view/type/options/configurable.phtml为:
<option><?php echo $this->__('Select ') ?><?php echo $_attribute->getLabel() ?></option>
Run Code Online (Sandbox Code Playgroud)
但结果并不好,它总是在三个选项中显示文字"选择风格".请给我一个这个问题的提示,非常感谢你!
在Magento中安装自定义模块期间是否存在访问商店配置的限制?这是问题所在
我有一个安装脚本:
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$this->getTable('userpaymentban')};
CREATE TABLE IF NOT EXISTS {$this->getTable('userpaymentban')} (
`ban_id` INT NOT NULL AUTO_INCREMENT ,
`user_id` INT NOT NULL ,
`paymentmethod_id` VARCHAR(200) NOT NULL ,
`store_id` INT NOT NULL ,
PRIMARY KEY (`ban_id`) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;");
$defaultNotBannedPaymentMethods = array();
$paymentMethods = Mage::getSingleton('payment/config')->getAllMethods();
Run Code Online (Sandbox Code Playgroud)
查询没问题,但最后一行导致抛出一些奇怪的东西:
Error in file: "/var/www/magentotest/magento161/app/code/local/Alpha/Userpaymentban/sql/userpaymentban_setup/mysql4-install-0.1.0.php" - Warning: Invalid argument supplied for foreach() in /var/www/magentotest/magento161/app/code/core/Mage/Payment/Model/Config.php on line 76
#0 …Run Code Online (Sandbox Code Playgroud)