Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

New Field in product page

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #21  
Old 01-17-2017, 08:43 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default 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?
__________________
Core version: 5.5.xx
Reply With Quote
  #22  
Old 01-18-2017, 02:23 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
xgarb (01-19-2017)
  #23  
Old 01-19-2017, 03:12 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default 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']);
__________________
Core version: 5.5.xx
Reply With Quote

The following user thanks xgarb for this useful post:
qualiteam (01-25-2017)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:16 AM.

   

 
X-Cart forums © 2001-2020