![]() |
Adding new property to a product (radio button) for Xcart 5
Hello
I found a great help in this link https://devs.x-cart.com/basics/adding_new_property_to_a_product/ so I can add extra properties to products. This implementation adds a text field in product page (Admin Area). I want to ask, If I would like to add a radio button what I should change in the code? Thanks |
Re: Adding new property to a product (radio button) for Xcart 5
Quote:
Hi there. I am assuming you are referring to a Yes/No button. If so, you should make the following change to the module. 1. View/FormModel/Product/Info.php Add the following line Code:
$schema['default']['myMessage'] = [ 2. Model/Product.php Change from Code:
@Column (type="string") Code:
@Column (type="boolean") That's pretty much it. If you already have the demo module installed in your store, don't forget to drop the existing 'myMessage' column from the database before re-deploying. Otherwise it will most likely produce an error that data format is incorrect. |
Re: Adding new property to a product (radio button) for Xcart 5
Dear Alex,
thanks a lot!!!!!!!!! By the way these articles are a great help to understand Xcart 5!!!!! |
Re: Adding new property to a product (radio button) for Xcart 5
Quote:
Was glad to help :) |
Re: Adding new property to a product (radio button) for Xcart 5
I want to ask again, If I want to add a list menu (drop down) what I should do? I cannot find any article to read about.
|
Re: Adding new property to a product (radio button) for Xcart 5
Quote:
I would suggest to find a module that does what you need in your X-Cart installation and then search through the code to find the piece of code that does the thing. |
Re: Adding new property to a product (radio button) for Xcart 5
Hi, following the same method as mentioned int he docs - https://devs.x-cart.com/basics/adding_new_property_to_a_product/ ; I added a new property to the product.
How can I now include that property to import and export of products? |
Re: Adding new property to a product (radio button) for Xcart 5
You must extend the \XLite\Logic\Export\Step\Products to export and the \XLite\Logic\Import\Processor\Products to import you new property. For example to import:
Quote:
Quote:
|
All times are GMT -8. The time now is 12:02 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.