Add New Field To Product page in x cart 5.3.1.3
Hi,
In My store (x cart 5.3.1.3) Admin, I want add a field in both category and product.
But i done in Category because i know Where to Create A new Field in Category.
For Category i been Working in below two files.
1.XLite\Module\<developer_ID>\<Modules_id>\Model - Category.php
2.XLite\Module\<developer_ID>\<Modules_id>\View\Mo del -Category.php
And Also i did Same for product But I can't see that Field
1.XLite\Module\<developer_ID>\<Modules_id>\Model -Product .php
2.XLite\Module\<developer_ID>\<Modules_id>\View\Mo del -Product.php
In old Version of X cart (5.2.x) i can See Both field But In x cart 5.3.1.3 Where i do Custom For Add field In product .
And Also i find Some product Related Files Still i can't see my field. i been Working for product below files.
XLite\Module\<developer_ID>\<Modules_id>\View\Form Model\Product - Info.php
My Code
protected function defineFields()
{
$new_fields = [];
foreach (\XLite\Core\Database::getRepo('\XLite\Module\<dev eloper_ID>\<Modules_id>\Model\new_field')->findActiveNewfield() as $new_field) {
$new_fields[$new_field->getId()] = $new_field->getName();
}
$schema = parent::defineFields();
$schema = static::compose(
$schema,
[
'prices_and_inventory' => [
'website_product' => [
'type' => 'XLite\Module\<developer_ID>\<Modules_id>\View\For mField\Select\new_field',
'label' => static::t('Newfield'),
'multiple' => true,
'choices' => array_flip($new_fields),
'choices_as_values' => true,
'position' => 600,
],
],
]
);
return $schema;
}
Still i didn't See my field in my store Admin.. Kindly Suggest Me What do to....
Awaiting For your Reply.
Thanks,
Vignesh Kutty.
__________________
kutty
|