Jump to content

simonedev

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • First Name
    Simone
  • Last Name
    Conti

simonedev's Achievements

Newbie

Newbie (1/14)

0

Reputation

1

Community Answers

  1. Good evening every time a customer from Milan (Milano, Italy) buy an object from the store, the address is not show properly. As you can see in the attached picture, there's a line showing "MICHIGAN", just like Milan were in U.S.A. Any hint? Every other Italian city works fine... so I believe there's nothing wrong in the prestashop code. thanks
  2. As I said, there was a simple error inside an array. I did not to validate my field in the normal way, there's a special function for translatable ones. Now it works
  3. Good morning everybody. I need to add a translatable field in my Prestashop v1.4 backoffice panel. Here's what I did: (1) added a new field "info_url" into ps_product_lang table (varchar 250) (2) added a block of code inside /tabs/AdminProducts.php <tr> <td class="col-left">'.$this->l('More info url:').'</td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo '<div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;"> <input size="40" type="text" id="info_url_'.$language['id_lang'].'" name="info_url_'.$language['id_lang'].'" value="'.stripslashes(htmlspecialchars($this->getFieldValue($obj, 'info_url', $language['id_lang']))).'"'.((!$obj->id) ? ' onkeyup="if (isArrowKey(event)) return; copy2friendlyURL();"' : '').' onkeyup="if (isArrowKey(event)) return; updateCurrentText();" onchange="updateCurrentText();" /> <span class="hint" name="help_box">'.$this->l('Url of the info page') . '</span> </div>'; echo '</td> </tr>' .... (3) added these lines inside classes/Product.php class ProductCore extends ObjectModel { ... ... /** @var string infourl */ public $info_url; ... ... protected $fieldsValidate = array( ... 'info_url' => 'isString', ); protected $fieldsRequiredLang = array('link_rewrite', 'name', 'info_url'); protected $fieldsSizeLang = array('meta_description' => 255,..., 'info_url' => 250); protected $fieldsValidateLang = array( 'meta_description' => 'isGenericName', ..., 'info_url' => 'IsGenericName'); ... public function getFields() { parent::validateFields(); $fields['info_url'] = pSQL($this->info_url); } public function getTranslationsFieldsChild() { self::validateFieldsLang(); $fieldsArray = array('meta_description', 'meta_keywords', 'meta_title', 'link_rewrite', 'name', 'available_now', 'available_later', 'info_url'); } } All seems ok in my panel, but when I save, i get this error: Warning: strip_tags() expects parameter 1 to be string, array given in /var/www/itart/store/classes/Tools.php on line 530 Fatal error (Product -> info_url = ) What's the matter?
×
×
  • Create New...