Jump to content

jawaid

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • First Name
    Muhammad Jawaid
  • Last Name
    Shamshad

Recent Profile Visitors

117 profile views

jawaid's Achievements

Newbie

Newbie (1/14)

0

Reputation

1

Community Answers

  1. @eject-computer, so what you're saying you modified feature.php file for this? I see only one definition that I assume works for both add and edit. So, how actually you solved it?
  2. I fixed the issue. Solution is available here http://stackoverflow.com/questions/30472428/prestashop-1-6-display-custom-field-in-feature-add-edit-form But now there is new problem that my custom field doesn't get saved in database while other default fields are. My code is available at GitHub https://github.com/mjawaids/advancedfeaturesvalues If anyone can see what the issue is and if I'm missing anything.
  3. I'm doing similar stuff where I added a custom field to Features. When I add a new Feature this new custom field also gets saves. But when I edit a Feature the value doesn't get updated. What could be the reason for that?
  4. I am able to display my custom field in Feature Value Add/Edit form by overriding AdminFeaturesController and overriding initFormFeatureValue() function. I want to do the same for Feature Add/Edit form but cannot find function to override. I tried renderForm() function but didn't work. Which file/class/controller/function should I look into to override Feature Add/Edit form to display my custom field?
  5. OK I fixed it. Solution is here http://stackoverflow.com/questions/30471431/prestashop-1-6-module-error-notice-on-line-719-in-file-prestashop16-tools-smart/30471871#30471871
  6. I'm developing a module and extended AdminFeaturesController.php to display my custom field Add/Edit Feature Value, but it is showing following error in popup: Notice on line 719 in file D:\xampp\htdocs\prestashop16\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code [8] Undefined index: name I think it is due to I override the function initFormFeatureValue() in my AdminFeaturesController.php file and added a new field. Here is the code for that: public function initFormFeatureValue() { $this->setTypeValue(); $row = Feature::getFeature($this->context->language->id, (int)Tools::getValue('id_feature')); p($row); $this->fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Feature value'), 'icon' => 'icon-info-sign' ), 'input' => array( array( 'type' => 'select', 'label' => $this->l('Feature'), 'name' => 'id_feature', 'options' => array( 'query' => Feature::getFeatures($this->context->language->id), 'id' => 'id_feature', 'name' => 'name' ), 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Value'), 'name' => 'value', 'lang' => true, 'size' => 33, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'required' => true ), array( 'type' => 'select', 'label' => $this->l('Parent Feature Value'), 'name' => 'parent_id_feature_value', 'options' => array( 'query' => FeatureValue::getFeatureValues(1), //$row['id_feature']), 'id' => 'id_feature', 'name' => 'name' ), 'required' => true ), ), 'submit' => array( 'title' => $this->l('Save'), ), 'buttons' => array( 'save-and-stay' => array( 'title' => $this->l('Save then add another value mamu'), 'name' => 'submitAdd'.$this->table.'AndStay', 'type' => 'submit', 'class' => 'btn btn-default pull-right', 'icon' => 'process-icon-save' ) ) ); $this->fields_value['id_feature'] = (int)Tools::getValue('id_feature'); // Create Object FeatureValue $feature_value = new FeatureValue(Tools::getValue('id_feature_value')); $this->tpl_vars = array( 'feature_value' => $feature_value, ); $this->getlanguages(); $helper = new HelperForm(); $helper->show_cancel_button = true; $back = Tools::safeOutput(Tools::getValue('back', '')); if (empty($back)) $back = self::$currentIndex.'&token='.$this->token; if (!Validate::isCleanHtml($back)) die(Tools::displayError()); $helper->back_url = $back; $helper->currentIndex = self::$currentIndex; $helper->token = $this->token; $helper->table = $this->table; $helper->identifier = $this->identifier; $helper->override_folder = 'feature_value/'; $helper->id = $feature_value->id; $helper->toolbar_scroll = false; $helper->tpl_vars = $this->tpl_vars; $helper->languages = $this->_languages; $helper->default_form_language = $this->default_form_language; $helper->allow_employee_form_lang = $this->allow_employee_form_lang; $helper->fields_value = $this->getFieldsValue($feature_value); $helper->toolbar_btn = $this->toolbar_btn; $helper->title = $this->l('Add a new feature value'); $this->content .= $helper->generateForm($this->fields_form); } Any idea why it is showing this error? Also, it is not populating my custom field.
  7. @bantumi where do you call your own method? Can you post your file?
  8. Did you find the solution for this? I'm searching for similar solution.
  9. I am trying to modify product features in a way that I can define one product feature as parent of another product feature. For example, I add two product features Feature1 and Feature2. In Feature1 I add values like F1value1, F1value2, and so on. Similarly, when defining values for second feature I want to map a parent of that value. Like if I define value of Feature2 to be F2V2 I also want to tell that its parent is F1Value1. So, a feature value can have one parent and multiple feature values can have same parent. This is a one-to-many relationship between parent and child feature. To do this what I think I need to modify product_features table and add a parent_id column. But how can I update the Product Feature screen to reflect the changes in DB? Any help would be appreciated.
×
×
  • Create New...