Prestashop 1.5.6-在管理产品页面中添加自定义字段

Prestashop 1.5.6-在管理产品页面中添加自定义字段,prestashop,http-status-code-403,prestashop-1.5,Prestashop,Http Status Code 403,Prestashop 1.5,我一直在尝试在管理产品页面中引入一个新的自定义字段,但出现了一个奇怪的错误。实际上,此字段与现有字段具有相同的文本区域类型如果输入纯文本,效果很好,但是如果输入任何以左尖括号开始的内容(您必须覆盖ProductCore类,而不是修改ProductCore类) class Product extends ProductCore { public $alternate_item; public function __construct($id_product = null, $ful

我一直在尝试在管理产品页面中引入一个新的自定义字段,但出现了一个奇怪的错误。实际上,此字段与现有字段具有相同的文本区域类型如果输入纯文本,效果很好,但是如果输入任何以左尖括号开始的内容(您必须覆盖ProductCore类,而不是修改ProductCore类)

class Product extends ProductCore 
{
   public $alternate_item;

   public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
   {
         self::$definition['fields']['alternate_item'] = array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml');
         parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
   }
}
覆盖类必须放在覆盖/classes文件夹或您的模块/override/classes


当您重写一个类时,您必须删除缓存/class_index.php

Hi fito,我已经尝试了您建议的一切,但仍然得到了相同的403错误。我真的不明白为什么会发生这种情况。您有其他想法吗?这一定与那些HTML标记有关。我觉得我应该对AdminProd做些什么uctsController.php?我刚刚放了一些information.tpl和textarea_lang.tpl的代码。感谢您的时间和帮助!请看一下这似乎是一个文件权限问题。请检查您的prestashop安装文件和目录权限。
<div class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display:none;{/if}float: left;">
    <textarea cols="100" rows="10" id="{$input_name}_{$language.id_lang}" 
        name="{$input_name}_{$language.id_lang}" 
        class="autoload_rte" >{if isset($input_value[$language.id_lang])}{$input_value[$language.id_lang]|htmlentitiesUTF8}{/if}</textarea>
    <span class="counter" max="{if isset($max)}{$max}{else}none{/if}"></span>
    <span class="hint">{$hint|default:''}<span class="hint-pointer">&nbsp;</span></span>
</div>
{/foreach}
</div>
<script type="text/javascript">
    var iso = '{$iso_tiny_mce}';
    var pathCSS = '{$smarty.const._THEME_CSS_DIR_}';
    var ad = '{$ad}';
</script>
class Product extends ProductCore 
{
   public $alternate_item;

   public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
   {
         self::$definition['fields']['alternate_item'] = array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml');
         parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
   }
}