Jump to content

how to add extra text field that can parse the img tag like descritpion field


aaront1

Recommended Posts

I am using v1.5.5.

how do I add an extra text field that is same as the long description field under product->information, which can parse the img tag to real image? like this tag [img-29-left-medium_default].

right now I only able to show the img tag as text, but not the image on the product page.

 

so far I have edit

in DB, i just manual added the 3 fields.

 

in classes\Product.php :

    public $description2;
    public $description3;
    public $description4;

 

'description2' =>array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
            'description3' =>array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
            'description4' =>array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),

 

adminFolder/themes/default/template/controllers/products/informations.tpl :

add the 3 input fields

 

themes\default\product.tpl :

{product->desciption2}

{product->desciption3}

{product->desciption4}

 

 

 

my other question is, I tried to use override\classes\Product.php , but I am not able to even save the input data in DB. anyone know the proper way to use override file?

my override file is like this.

 

    class Product extends ProductCore
    {

  Product::$definition['fields']['description2'] = array( 'type' => ObjectModel::TYPE_HTML, 'lang' => true,  'validate' => 'isCleanHtml');
    Product::$definition['fields']['description3'] = array( 'type' => ObjectModel::TYPE_HTML, 'lang' => true,  'validate' => 'isCleanHtml');
    Product::$definition['fields']['description4'] = array( 'type' => ObjectModel::TYPE_HTML, 'lang' => true,  'validate' => 'isCleanHtml');

        public $description2;
        public $description3;     
           public $description4;

            
    
    }
 

 

 

Link to comment
Share on other sites

yes, I did added those fields to database under the product_lang table (same table as the description field).

 

As I said before, I can see the text in product page. just the img tag not able to parse to real image like the original description field.

it is only displaying back the text like this:  some text [img-29-left-medium_default] some other text

 

so in other words, my new field is working just like a normal field, but it doesn't have the same feature as the original description field that I want. which is missing the parse img tag part.

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...