X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   New Field in product page (https://forum.x-cart.com/showthread.php?t=69245)

xgarb 01-17-2017 08:43 AM

Re: New Field in product page
 
I've followed the article and added a new field (I'm replacing the standard x-cart tab with an custom html one).

Code:

class Info extends \XLite\View\FormModel\Product\Info implements \XLite\Base\IDecorator
{
    /**
    * @return array
    */
    protected function defineFields()
    {
        $schema = parent::defineFields();

        $schema[self::SECTION_DEFAULT]['specification'] = [
            'label'      => static::t('Specification'),
            'position'  => 600,
                        'type'    => 'XLite\View\FormModel\Type\TextareaAdvancedType',
        ];

        return $schema;
    }
}


It all works but when I enter HTML all the tags are stripped out. Is there something else I should be defining somewhere?

qualiteam 01-18-2017 02:23 AM

Re: New Field in product page
 
Did you decorate \XLite\Model\DTO\Product\Info as well?

Check how the class reads and writes the "full_description" field (that uses the WYSIWYG editor too) to the product model.

xgarb 01-19-2017 03:12 AM

Re: New Field in product page
 
yep I had that decorated as well but with this...

$object->setSpecification($this->default->specification);

when I needed this...

$object->setSpecification((string) $rawData['default']['specification']);


All times are GMT -8. The time now is 01:41 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.