Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Undefined array key "id" #25

Open
danielle771 opened this issue Jun 21, 2024 · 1 comment
Open

Warning: Undefined array key "id" #25

danielle771 opened this issue Jun 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@danielle771
Copy link

Describe the bug
I get the warning when I try to customize the module

Prestashop version(s)
8.1.6

Additionally while the COD fee is added to the cart after shipping fee, the amount is always 0 (zero), no matter what the COD amount is defined.
COD-0
cod-warning

@danielle771 danielle771 added the bug Something isn't working label Jun 21, 2024
@Ecommerce-Manager
Copy link

Ecommerce-Manager commented Aug 19, 2024

in modules/codwfeeplus/controllers/admin/AdminCODwFeePlusController.php replace this function:

    public function renderFormConditions($in_cond_id = null, $getfrompost = false)
    {
        $carriers = Carrier::getCarriers($this->context->language->id, false, false, false, null, Carrier::ALL_CARRIERS);
        $carriers_list = array();
        foreach ($carriers as $value) {
            $carriers_list[] = array(
                'id_option' => (int) $value['id_carrier'],
                'name' => $value['name'],
            );
        }

        $countries = array();
        $states = array();
        CODwFP::getCountriesandStates($countries, $states);

        $country_list = array();
        foreach ($countries as $value) {
            $country_list[] = array(
                'id_option' => (int) $value['id_country'],
                'name' => $value['name'],
            );
        }

        $state_list = array();
        foreach ($states as $value) {
            $state_list[] = array(
                'id_option' => (int) $value['id_state'],
                'name' => $value['name'],
            );
        }

        $zones = Zone::getZones();
        $zones_list = array();
        foreach ($zones as $value) {
            $zones_list[] = array(
                'id_option' => (int) $value['id_zone'],
                'name' => $value['name'],
            );
        }

        $emptyManuf_text = $this->l('Empty manufacturer');
        $manuf_label = $this->l('Cart Manufacturers');
        $manuf_desc = $this->l('Select one or more manufacturers to compare to the cart values');
        $manuf_hint = $this->l('The manufacturers of the products in the cart.');
        $manuf_matchall_label = $this->l('Match all manufacturers');
        $manuf_matchall_hint = $this->l('Toggle whether to match all the manufacturers of the cart, to the manufacturers selected in a condition. If disabled, even if only one manufacturer matches the condition manufacturers, this step of validation will be passed.');
        if ($this->module->is17) {
            $emptyManuf_text = $this->l('Empty brand');
            $manuf_label = $this->l('Cart Brands');
            $manuf_desc = $this->l('Select one or more brands to compare to the cart values');
            $manuf_hint = $this->l('The brands of the products in the cart.');
            $manuf_matchall_label = $this->l('Match all brands');
            $manuf_matchall_hint = $this->l('Toggle whether to match all the brands of the cart, to the brands selected in a condition. If disabled, even if only one brand matches the condition brands, this step of validation will be passed.');
        }

        $manufacturers = Manufacturer::getManufacturers();
        $manufacturers_list = array(
            0 => array(
                'id_option' => 0,
                'name' => $emptyManuf_text,
            )
        );
        foreach ($manufacturers as $value) {
            $manufacturers_list[] = array(
                'id_option' => (int) $value['id_manufacturer'],
                'name' => $value['name'],
            );
        }

        $suppliers = Supplier::getSuppliers();
        $suppliers_list = array(
            0 => array(
                'id_option' => 0,
                'name' => $this->l('Empty supplier'),
            )
        );
        foreach ($suppliers as $value) {
            $suppliers_list[] = array(
                'id_option' => (int) $value['id_supplier'],
                'name' => $value['name'],
            );
        }

        $taxrules = TaxRulesGroup::getTaxRulesGroups();
        $options_taxrule = array(
            array(
                'id_option' => 0,
                'name' => $this->l('No Tax'),
            ),
        );
        foreach ($taxrules as $value) {
            $options_taxrule[] = array(
                'id_option' => (int) $value['id_tax_rules_group'],
                'name' => $value['name'],
            );
        }

        $os = OrderState::getOrderStates($this->context->language->id);
        uasort($os, array($this, '_sortOrderStatuses'));
        $options_orderstate = array(
            array(
                'id_option' => 0,
                'name' => $this->l('Use default'),
            ),
        );
        foreach ($os as $value) {
            $options_orderstate[] = array(
                'id_option' => (int) $value['id_order_state'],
                'name' => $value['id_order_state'] . ' - ' . $value['name'],
            );
        }

        $options = array(
            array(
                'id_option' => 0,
                'name' => $this->l('No Fee'),
            ),
            array(
                'id_option' => 1,
                'name' => $this->l('Fixed Fee'),
            ),
            array(
                'id_option' => 2,
                'name' => $this->l('Percentage Fee'),
            ),
            array(
                'id_option' => 3,
                'name' => $this->l('Fixed and Percentage Fee'),
            ),
        );

        $options_cartvalue_sign = array(
            array(
                'id_option' => 0,
                'name' => $this->l('Apply when >='),
            ),
            array(
                'id_option' => 1,
                'name' => $this->l('Apply when <='),
            ),
        );

        $options_integration = array(
            array(
                'id_option' => 0,
                'name' => $this->l('Add to carrier\'s fee'),
            ),
            array(
                'id_option' => 1,
                'name' => $this->l('Add a COD product to the order'),
            ),
        );

        $fieldValues = $this->getFieldsValuesConditions($in_cond_id, $getfrompost);

        $category = Category::getRootCategory()->id;
        $tree = new HelperTreeCategories('codwfeeplus_cat_tree');
        $tree->setUseCheckBox(true)
                ->setUseSearch(false)
                ->setRootCategory($category)
                ->setInputName('cond_categoryBox')
                ->setSelectedCategories($fieldValues['categories']);
        if (Tools::version_compare(_PS_VERSION_, '1.6.1.0', '>')) {
            $tree->setIdTree('codwfeeplus_cond_cat_tree');
        }
        if (Tools::version_compare(_PS_VERSION_, '1.6.1.0', '>=')) {
            $tree->setFullTree(true);
            $tree->setChildrenOnly(true);
            $tree->setNoJS(false);
        }
        $categoryTree = $tree->render();
        //token changed because of the category tree... So change it back.
        $this->context->smarty->assign('token', $this->token);

        $title = '';
        if ($in_cond_id == null) {
            $title = $this->l('New Condition');
        } else {
            $title = $this->l('Condition Details') . ' - ID: ' . $in_cond_id;
        }
        $groups_list = array();
        if (Group::isFeatureActive()) {
            $groups = Group::getGroups($this->context->language->id);
            foreach ($groups as $value) {
                $groups_list[] = array(
                    'id_option' => (int) $value['id_group'],
                    'name' => $value['name'],
                );
            }
        }

        $fields_form = array(
            'form' => array(
                'legend' => array(
                    'title' => $title,
                    'icon' => 'icon-cogs',
                ),
                'tabs' => array(
                    '0' => $this->l('General'),
                    '1' => $this->l('Fee Calculation'),
                    '2' => $this->l('Validation Rules'),
                ),
                'input' => array(),
                'submit' => array(
                    'title' => $this->l('Save'),
                ),
            ),
        );


        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $this->l('Enable this condition'),
            'name' => 'CODWFEEPLUS_ACTIVE',
            'tab' => '0',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'ec_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'ec_off',
                    'value' => 0,
                ),
            ),
            'hint' => $this->l('Toggle condition activation.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch_custom',
            'label' => $this->l('Type of condition'),
            'name' => 'CODWFEEPLUS_CONDTYPE',
            'tab' => '0',
            'cols' => 6,
            'desc' => $this->l('Select if the validation of the condition defines the fee or if it disables the payment method.'),
            'values' => array(
                array(
                    'value' => 0,
                    'label' => $this->l('FEE CALCULATION'),
                    'id' => 'CODWFEEPLUS_CONDTYPE_0',
                ),
                array(
                    'value' => 1,
                    'label' => $this->l('MODULE DEACTIVATION'),
                    'id' => 'CODWFEEPLUS_CONDTYPE_1',
                ),
            ),
            'hint' => $this->l('When the condition validates, If the FEE CALCULATION is selected, the condition will calculate the fee. If MODULE ACTIVATION is selected and the condition is validated, the payment method will NOT be available in the front office.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Description'),
            'name' => 'CODWFEEPLUS_DESCRIPTION',
            'tab' => '0',
            'hint' => $this->l('Give a description to identify your condition.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'label' => $this->l('Integration form'),
            'name' => 'CODWFEEPLUS_INTEGRATION',
            'tab' => '0',
            'options' => array(
                'query' => $options_integration,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('If the condition is validated, it is the first one validated and the appropriate option is selected in the main options, how the fee will be integrated to the order?'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'label' => $this->l('COD Product tax rule'),
            'name' => 'CODWFEEPLUS_TAXRULE',
            'tab' => '0',
            'options' => array(
                'query' => $options_taxrule,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('If the condition is validated, and a COD product is used, what is the tax that it should contain? This only applies when the COD product is used. If fee is added to the carrier, the selected carrier\'s tax will be used.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'label' => $this->l('Order status'),
            'name' => 'CODWFEEPLUS_ORDERSTATE',
            'tab' => '0',
            'options' => array(
                'query' => $options_orderstate,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('If the condition is validated and it is the first one validated, what is the order status after the order is done?'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'label' => $this->l('Fee Type'),
            'name' => 'CODWFEEPLUS_FEETYPE',
            'tab' => '1',
            'options' => array(
                'query' => $options,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('If the condition is validated, what kind of fee should be applied?'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Fixed Fee'),
            'name' => 'CODWFEEPLUS_FEE',
            'tab' => '1',
            'suffix' => $this->_defCurrencySuffix,
            'class' => 'fixed-width-sm',
            'desc' => $this->l(''),
            'hint' => $this->l('This amount will be added to fee if fixed or percentage + fixed fee method is selected.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Percentage Fee'),
            'name' => 'CODWFEEPLUS_PERCENTAGE',
            'tab' => '1',
            'suffix' => '%',
            'class' => 'fixed-width-sm',
            'desc' => $this->l(''),
            'hint' => $this->l('This is the percentage of the total cart value that will be added as fee, if percentage or percentage + fixed fee method is selected.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $this->l('Include carrier\'s fee in percentage'),
            'name' => 'CODWFEEPLUS_FEE_PERCENT_INCLUDE_CARRIER',
            'tab' => '1',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'ic_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'ic_off',
                    'value' => 0,
                ),
            ),
            'hint' => $this->l('When the percentage fee is calculated, include carrier\'s fee or just the products\' value?'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Minimum Fee'),
            'name' => 'CODWFEEPLUS_MIN',
            'tab' => '1',
            'suffix' => $this->_defCurrencySuffix,
            'class' => 'fixed-width-sm',
            'desc' => $this->l('Set to 0 to disable'),
            'hint' => $this->l('For percentage or percentage + fixed fee methods, if the calculated fee is below this value, this value will be applied.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Maximum Fee'),
            'name' => 'CODWFEEPLUS_MAX',
            'tab' => '1',
            'suffix' => $this->_defCurrencySuffix,
            'class' => 'fixed-width-sm',
            'desc' => $this->l('Set to 0 to disable'),
            'hint' => $this->l('For percentage or percentage + fixed fee methods, if the calculated fee is above this value, this value will be applied.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'label' => $this->l('Apply when cart total value is:'),
            'name' => 'CODWFEEPLUS_CARTVALUE_SIGN',
            'tab' => '2',
            'options' => array(
                'query' => $options_cartvalue_sign,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select either greater or equal, or lesser or equal, for comparing cart value condition to customer\'s cart value.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'text',
            'label' => $this->l('Total cart value'),
            'name' => 'CODWFEEPLUS_CARTVALUE',
            'tab' => '2',
            'suffix' => $this->_defCurrencySuffix,
            'class' => 'fixed-width-sm',
            'desc' => $this->l('Set to 0 to disable'),
            'hint' => $this->l('The value to check against customer\'s total cart value.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $this->l('Include carrier\'s fee in total cart value'),
            'name' => 'CODWFEEPLUS_CARTVALUE_INCLUDE_CARRIER',
            'tab' => '2',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'icv_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'icv_off',
                    'value' => 0,
                ),
            ),
            'hint' => $this->l('When the total cart value is checked, include carrier\'s fee or just the products\' value?'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $this->l('Carriers List'),
            'name' => 'CODWFEEPLUS_DELIVERY_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $this->l('Select one or more carriers to compare to the cart values'),
            'options' => array(
                'query' => $carriers_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select (using the Control key) none, one or more Carriers from the list.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $this->l('Countries List'),
            'name' => 'CODWFEEPLUS_COUNTRIES_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $this->l('Select one or more countries to compare to the cart values'),
            'options' => array(
                'query' => $country_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select (using the Control key) none, one or more Countries from the list.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $this->l('States List'),
            'name' => 'CODWFEEPLUS_STATES_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $this->l('Select one or more states to compare to the cart values'),
            'options' => array(
                'query' => $state_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select (using the Control key) none, one or more States from the list.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $this->l('Zone List'),
            'name' => 'CODWFEEPLUS_ZONES_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $this->l('Select one or more zones to compare to the cart values'),
            'options' => array(
                'query' => $zones_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select (using the Control key) none, one or more Zones from the list.'),
        );

        if (Group::isFeatureActive()) {
            $fields_form['form']['input'][] = array(
                'type' => 'html',
                'html_content' => '<hr class="codwfeeplus_form_hr">',
                'col' => '12',
                'label' => '',
                'name' => 'sep',
                'tab' => '2',
            );
            $fields_form['form']['input'][] = array(
                'type' => 'select',
                'multiple' => true,
                'add_buttons' => true,
                'label' => $this->l('Groups List'),
                'name' => 'CODWFEEPLUS_GROUPS_ARRAY[]',
                'tab' => '2',
                'class' => 'codwfeeplus_admin_select',
                'desc' => $this->l('Select one or more customer groups to compare to the cart values'),
                'options' => array(
                    'query' => $groups_list,
                    'id' => 'id_option',
                    'name' => 'name',
                ),
                'hint' => $this->l('Select (using the Control key) none, one or more Groups from the list.'),
            );
            $fields_form['form']['input'][] = array(
                'type' => 'switch',
                'label' => $this->l('Match all groups'),
                'name' => 'CODWFEEPLUS_MATCHALL_GROUPS',
                'tab' => '2',
                'is_bool' => true,
                'values' => array(
                    array(
                        'id' => 'mag_on',
                        'value' => 1,
                    ),
                    array(
                        'id' => 'mag_off',
                        'value' => 0,
                    ),
                ),
                'hint' => $this->l('Toggle whether to match all the groups a customer belongs to, to the groups selected in a condition. If disabled, even if only one group matches the condition groups, this step of validation will be passed.'),
            );
        } else {
            $fields_form['form']['input'][] = array(
                'type' => 'html',
                'html_content' => '<hr class="codwfeeplus_form_hr">',
                'col' => '12',
                'label' => '',
                'name' => 'sep',
                'tab' => '2',
            );
            $fields_form['form']['input'][] = array(
                'type' => 'html',
                'html_content' => '<p class="codwfeeplus_nogroup_error">' . $this->l('The group feature is not active on this shop.') . '</p>',
                'label' => $this->l('Groups List'),
                'name' => 'CODWFEEPLUS_GROUPS_ARRAY',
                'tab' => '2',
                'class' => 'fixed-width-lg',
            );
        }

        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'categories_select',
            'label' => $this->l('Category List'),
            'desc' => $this->l('Select one or more categories to apply this Fee.'),
            'name' => 'CODWFEEPLUS_CATEGORIES_ARRAY',
            'tab' => '2',
            'category_tree' => $categoryTree,
            'hint' => $this->l('Check the categories that at least one of the product of the cart, belongs to.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $this->l('Match all categories'),
            'name' => 'CODWFEEPLUS_MATCHALL_CATEGORIES',
            'tab' => '2',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'mac_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'mac_off',
                    'value' => 0,
                ),
            ),
            'hint' => $this->l('Toggle whether to match all the categories from the cart to the categories selected in a condition. If disabled, even if only one category matches the condition categories, this step of validation will be passed.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );

        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $manuf_label,
            'name' => 'CODWFEEPLUS_MANUFACTURERS_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $manuf_desc,
            'options' => array(
                'query' => $manufacturers_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $manuf_hint,
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $manuf_matchall_label,
            'name' => 'CODWFEEPLUS_MATCHALL_MANUFACTURERS',
            'tab' => '2',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'mam_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'mam_off',
                    'value' => 0,
                ),
            ),
            'hint' => $manuf_matchall_hint,
        );
        $fields_form['form']['input'][] = array(
            'type' => 'html',
            'html_content' => '<hr class="codwfeeplus_form_hr">',
            'col' => '12',
            'label' => '',
            'name' => 'sep',
            'tab' => '2',
        );
        $fields_form['form']['input'][] = array(
            'type' => 'select',
            'multiple' => true,
            'add_buttons' => true,
            'label' => $this->l('Suppliers List'),
            'name' => 'CODWFEEPLUS_SUPPLIERS_ARRAY[]',
            'tab' => '2',
            'class' => 'codwfeeplus_admin_select',
            'desc' => $this->l('Select one or more suppliers to compare to the cart values'),
            'options' => array(
                'query' => $suppliers_list,
                'id' => 'id_option',
                'name' => 'name',
            ),
            'hint' => $this->l('Select (using the Control key) none, one or more suppliers from the list.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'switch',
            'label' => $this->l('Match all suppliers'),
            'name' => 'CODWFEEPLUS_MATCHALL_SUPPLIERS',
            'tab' => '2',
            'is_bool' => true,
            'values' => array(
                array(
                    'id' => 'mas_on',
                    'value' => 1,
                ),
                array(
                    'id' => 'mas_off',
                    'value' => 0,
                ),
            ),
            'hint' => $this->l('Toggle whether to match all the suppliers of the cart, to the suppliers selected in a condition. If disabled, even if only one supplier matches the condition suppliers, this step of validation will be passed.'),
        );
        $fields_form['form']['input'][] = array(
            'type' => 'hidden',
            'name' => 'CODWFEEPLUS_ID',
        );

        $helper = new HelperForm();
        $helper->show_toolbar = true;
        $helper->table = $this->table;
        $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
        $helper->default_form_language = $lang->id;
        $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
        $helper->show_cancel_button = true;
        $helper->back_url = $this->context->link->getAdminLink('AdminCODwFeePlus', true);
        $helper->identifier = 'id_codwfeeplus_cond';
        $helper->submit_action = 'submitCODwFeePlusConditions';
        $helper->currentIndex = $this->context->link->getAdminLink('AdminCODwFeePlus', false);
        $helper->token = Tools::getAdminTokenLite('AdminCODwFeePlus');
        $helper->override_folder = '_configure/';
        $helper->tpl_vars = array(
            'fields_value' => $fieldValues['form'],
            'languages' => $this->context->controller->getLanguages(),
            'id_language' => $this->context->language->id,
        );

        return $helper->generateForm(array('0' => $fields_form));
    }

in modules/codwfeeplus/views/templates/admin/_configure/helpers/form/form.tpl replace line 931:

var vat_number = {if isset($vat_number) && $vat_number}1{else}0{/if};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants