sygram Posted September 18, 2016 Share Posted September 18, 2016 Hi there, i would like to disable the carrier wizard and enable the previous AdminCarriersController. Unfortunately i can not override the AdminCarrierWizardController.php the same way as AdminCarriersController.php and there is no documentation. Thank you very much. Regards Link to comment Share on other sites More sharing options...
shokinro Posted September 18, 2016 Share Posted September 18, 2016 (edited) you may try to redirect to AdminCarriersController from AdminCarrierWizardControllerto implement your requirement. but it is better to modify your code to use override of AdminCarrierWizardController, because the old one maybe deprecated in the future. Edited September 18, 2016 by shokinro (see edit history) Link to comment Share on other sites More sharing options...
sygram Posted September 19, 2016 Author Share Posted September 19, 2016 Hi and thanks for the reply. I've already tried the below 2 cases but none worked. 1) as redirect, i replaced the contents of file AdminCarrierWizardController with the contents of AdminCarriersController, but it did not work. 2) i created the below override files : Carrier.php <?phpclass Carrier extends CarrierCore{ /** @var int points */ public $points; /** @var string storepass */ public $storepass; /** @var string address */ public $address; /** @var string email */ public $email; /** @var string tel */ public $tel; public function __construct($id = null, $id_lang = null) { self::$definition['fields']['points'] = array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId','required' => true); self::$definition['fields']['storepass'] = array('type' => self::TYPE_STRING, 'validate' => 'isUnsignedId','required' => true); self::$definition['fields']['address'] = array('type' => self::TYPE_STRING, 'validate' => 'isUnsignedId','required' => true); self::$definition['fields']['email'] = array('type' => self::TYPE_STRING, 'validate' => 'isUnsignedId','required' => true); self::$definition['fields']['tel'] = array('type' => self::TYPE_STRING, 'validate' => 'isUnsignedId','required' => true); parent::__construct($id, $id_lang); } }?> and AdminCarrierWizardController.php <?phpclass AdminCarrierWizardController extends AdminCarrierWizardControllerCore{ public function renderStepOne($carrier) { $this->fields_form_override =array( array( 'type' => 'text', 'label' => $this->l('Points'), 'name' => 'points', 'lang' => false, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'text', 'label' => $this->l('storepass'), 'name' => 'storepass', 'lang' => false, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'text', 'label' => $this->l('address'), 'name' => 'address', 'lang' => false, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'text', 'label' => $this->l('email'), 'name' => 'email', 'lang' => false, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'text', 'label' => $this->l('tel'), 'name' => 'tel', 'lang' => false, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), ); $fields_value = $this->getStepOneFieldsValues($carrier); return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars); } public function getStepOneFieldsValues($carrier) { return array( 'points' => $this->getFieldValue($carrier, 'points'), 'storepass' => $this->getFieldValue($carrier, 'storepass'), 'address' => $this->getFieldValue($carrier, 'address'), 'email' => $this->getFieldValue($carrier, 'email'), 'tel' => $this->getFieldValue($carrier, 'tel'), ); }}?> Unfortunately with no results either. Any thoughts ? Regards Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now