Jump to content

disable carrier wizard


sygram

Recommended Posts

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

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

<?php

class 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

 

<?php

class 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...