Jump to content

[SOLVED] add new product field


Recommended Posts

1. Added in themes/controller/product/information.tpl file

<tr>
        <td class="col-left">
            {include file="controllers/products/multishop/checkbox.tpl" field="gender" type="default"}
            <label>{l s='Gender:'}</label>
        </td>
        <td style="padding-bottom:5px;">
            <select name="gender" id="gender" style="width: 140px; margin-right: 44px;">
                                <option value="both" {if $product->gender == 'both'}selected="selected"{/if} >{l s='Both'}</option>
                <option value="male" {if $product->gender == 'male'}selected="selected"{/if} >{l s='Male'}</option>
                <option value="female" {if $product->gender == 'female'}selected="selected"{/if} >{l s='Female'}</option>
            </select>
        </td>
                </tr>

 

2. Added in classes/product.php

               public $gender;

 

            'gender'    =>      array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGender', 'values' => array('both','male', 'female' ), 'default' => 'both'),
 

in validate.php

            'gender'    =>      array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGender', 'values' => array('both','male', 'female' ), 'default' => 'both')

for validate

 

its working now but i am getting new error now

 

An error occurred while updating an object. product ()

 

 

Plz help to solve this

Link to comment
Share on other sites

×
×
  • Create New...