View Single Post
  #1  
Old 03-02-2023, 10:52 AM
 
galoadm galoadm is offline
 

Advanced Member
  
Join Date: Dec 2013
Posts: 36
 

Default Adding multiple new properties to a product trouble

I am following the "Add a New Property to a Product" instructions and am having a little trouble adding multiple properties in X-Cart 5.4. Adding a single property works fine, but adding multiple properties is making the product description, name, images, and category disappear from the back and front end while displaying all the new properties.

My code for decorating viewer class:

Code:
<?php // vim: set ts=4 sw=4 sts=4 et: namespace XLite\Module\*******\*******\View\FormModel\Product; /** * Product form model */ abstract class Info extends \XLite\View\FormModel\Product\Info implements \XLite\Base\IDecorator { protected function defineFields() { $schema = parent::defineFields(); $schema = ['default' => [ 'myBrand' => [ 'label' => static::t('Brand'), 'position' => 900, ], 'myCountryOrigin' => [ 'label' => static::t('Country of Origin'), 'position' => 910, ], 'myCountryAssembly' => [ 'label' => static::t('Assembly Location'), 'position' => 920, ], 'myItemCondition' => [ 'label' => static::t('Item Condition'), 'position' => 930, ], 'myMaterial' => [ 'label' => static::t('Made of'), 'position' => 940, ], ], ]; return $schema; } }


Instructions code for decorating viewer class:

Code:
<?php // vim: set ts=4 sw=4 sts=4 et: namespace XLite\Module\XCExample\ProductPropertyDemo\View\FormModel\Product; /** * Product form model */ abstract class Info extends \XLite\View\FormModel\Product\Info implements \XLite\Base\IDecorator { protected function defineFields() { $schema = parent::defineFields(); $schema['default']['myMessage'] = [ 'label' => static::t('My message'), 'position' => 900, ]; return $schema; } }


Any help will be most appreciated.
__________________
X-Cart Business 5.4
Reply With Quote