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

Adding order meta data and displaying it places!
 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-26-2018, 05:22 AM
 
NavinSeth NavinSeth is offline
    
Join Date: Oct 2018
Posts: 1
 

Default Adding order meta data and displaying it places!

I currently have the following scenario and need some guidance.

I would like to add a piece of meta data to an order when it is created and include that data on the invoice template for the order. For argument sake let's call this data orderColor.

1) How do I create a new column to the gbxc5_orders table? (orderColor column).
2) How do I populate orderColor when the order is created?
3) How do I show the orderColor on the invoice when a admin user views the order AND when the invoice is emailed on order creation event?
4) How do I show the orderColor column on the packing slip?

Any guidance would really be appreciated!

Thank you.
Reply With Quote
  #2  
Old 10-31-2018, 04:50 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is online now
 

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

Default Re: Adding order meta data and displaying it places!

Hi Navin,

Thanks for choosing X-Cart and welcome to X-Cart forums!

Quote:
Originally Posted by NavinSeth
I currently have the following scenario and need some guidance.

I would like to add a piece of meta data to an order when it is created and include that data on the invoice template for the order. For argument sake let's call this data orderColor.

1) How do I create a new column to the gbxc5_orders table? (orderColor column).

The process of adding a new property to the model is described here:
https://devs.x-cart.com/basics/adding_new_property_to_a_product/#decorating-model-class

This example is for \XLite\Model\Product class, but you can decorate \XLite\Model\Order class all the same. Although, you will be adding orderColor property instead of myMessage.

Quote:
2) How do I populate orderColor when the order is created?

\XLite\Model\Order class has the processSucceed() method that is run when you place an order. You should decorate it and put the code of defining processSucceed property there.

Quote:
3) How do I show the orderColor on the invoice when a admin user views the order AND when the invoice is emailed on order creation event?
4) How do I show the orderColor column on the packing slip?[/quote]

These tasks are similar to one described here: https://devs.x-cart.com/design_changes/adding_product_images_to_order_notifications.html

Please, have a look at the article and you find any difficulties, please let me know.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (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 02:02 AM.

   

 
X-Cart forums © 2001-2018