View Single Post
  #2  
Old 05-27-2014, 03:04 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: New Field in product page

Hi!

The main process is as follows:
1) Create an empty module as described here: http://kb.x-cart.com/display/XDD/How+to+create+a+module
2) Create the file Model/Product.php script inside your module with the following content:
PHP Code:
<?php

namespace <YOUR-NAME-SPACE>;

class 
Product extends \XLite\Model\Product implements \XLite\Base\IDecorator
{
    
/**
      * @Column(type="integer")
      */
    
protected $my_int_property;

    
/**
      * @Column(type="string", length="32")
      */
    
protected $my_string_propery;
}

You should use your own namespace in the script, of course. Within the example, I created two properties: integer property and string one.

Once you rebuild cache X-Cart 5 will update tables and new field will appear in the database.

If you can give more details about how you want to display on invoice, I can help you with this part as well.

Tony.
Reply With Quote