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

how I add a new field to orders in admin area ?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-26-2015, 01:02 PM
 
nettbee nettbee is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 8
 

Default how I add a new field to orders in admin area ?

Hello,

I am trying add a new field to an order in admin area, I need save a number of bill (please see the screashot of example).

Hope anyone here will help me.

Best Regards.
Attached Thumbnails
Click image for larger version

Name:	Captura.PNG
Views:	135
Size:	70.0 KB
ID:	4154  
__________________
XCART Pro 4.2.0
Reply With Quote
  #2  
Old 06-03-2015, 05:01 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

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

Default Re: how I add a new field to orders in admin area ?

Hello @nettbee,

You should start developing this mod with this article:
http://kb.x-cart.com/display/XDD/Working+with+viewer+classes

Please, let me know if it helps. If there are still any questions, just let me know.

Thank you.

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

The following user thanks tony_sologubov for this useful post:
nettbee (06-09-2015)
  #3  
Old 06-09-2015, 11:36 AM
 
nettbee nettbee is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 8
 

Default Re: how I add a new field to orders in admin area ?

Hello @tony_sologubov,

I have not questions,thank you for your reply.
__________________
XCART Pro 4.2.0
Reply With Quote
  #4  
Old 06-21-2016, 12:57 PM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default Re: how I add a new field to orders in admin area ?

I am working on updating my module to x-cart 5.3 ... http://kb.x-cart.com/display/XDD/Adding+new+property+to+a+product apparently that doesn't work anymore?

The Flexy to Twig Converter outputted

Code:
{## # @ListChild (list="invoice.item.name", weight="20") # @ListChild (list="cart.item.info", weight="20") #} {% if this.item.product.getPPCField() %} <li class="ppc-field"> <span class="name">{{ t('Pieces Per Case') }}</span> <span class="ppc-field-value">{{ this.item.product.getPPCField() }}</span> </li> {% endif %}
__________________
Business License
https://glaspak.com
GoDaddy VPS - Apache with WHM
2GB ECC DDR3 1600MHz
2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz
15 MB proc cache
60 GB 10k RPM hdd
PHP 7.0.15
MariaDB 10.1.21 with InnoDB engine
Reply With Quote
  #5  
Old 06-21-2016, 11:14 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: how I add a new field to orders in admin area ?

We are currently working on articles in the Knowledge base.
Everything will be up to date when the 5.3 version is out of Beta.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #6  
Old 06-22-2016, 06:00 AM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default Re: how I add a new field to orders in admin area ?

Quote:
Originally Posted by qualiteam
We are currently working on articles in the Knowledge base.
Everything will be up to date when the 5.3 version is out of Beta.

Any help on the the decorator issues with the admin field? Would like to get the module working before out of beta.
__________________
Business License
https://glaspak.com
GoDaddy VPS - Apache with WHM
2GB ECC DDR3 1600MHz
2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz
15 MB proc cache
60 GB 10k RPM hdd
PHP 7.0.15
MariaDB 10.1.21 with InnoDB engine
Reply With Quote
  #7  
Old 06-27-2016, 06:19 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: how I add a new field to orders in admin area ?

I will try to check the code on my local 5.3.x installation this week.

Please could you clarify what exactly doesn't work after you migrated the code?
Can you send me your module files?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #8  
Old 06-27-2016, 07:37 AM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default Re: how I add a new field to orders in admin area ?

Quote:
Originally Posted by qualiteam
I will try to check the code on my local 5.3.x installation this week.

Please could you clarify what exactly doesn't work after you migrated the code?
Can you send me your module files?

We don't sell single items (just cases) so I added a new field called PPCField (pieces per case) and modified the admin screen for products so I could add a field for how many pieces per case each product had (unless there were options, then I use variants).

This caused all kinds of problems with importing the products into another build (but I manually corrected all the issues) because the export and import can't handle new fields in the database apparently.

Attached is the packed module that I used the smarty to twig converter that xcart gave.
Attached Files
File Type: tar EBLIEB-GlasPak-v5_3_0.tar (12.5 KB, 96 views)
__________________
Business License
https://glaspak.com
GoDaddy VPS - Apache with WHM
2GB ECC DDR3 1600MHz
2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz
15 MB proc cache
60 GB 10k RPM hdd
PHP 7.0.15
MariaDB 10.1.21 with InnoDB engine
Reply With Quote
  #9  
Old 06-27-2016, 11:38 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: how I add a new field to orders in admin area ?

Why don't you use the attributes page? It allows you to add a new product field (attribute) named "Pieces Per Case" and specify its value per product. The import/export function supports attributes.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #10  
Old 06-28-2016, 05:17 AM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default Re: how I add a new field to orders in admin area ?

Quote:
Originally Posted by qualiteam
Why don't you use the attributes page? It allows you to add a new product field (attribute) named "Pieces Per Case" and specify its value per product. The import/export function supports attributes.

Couple reasons. 1 we do use pieces per case in the attributes section (specifically for variants when they occur), but the reason we have to use this method is because

a) attributes only show up in the specifications tab, which means the quick view doesn't show the attribute unless it is a multiple input attribute

b) attributes don't show up in the main product screen unless it is a multiple input attribute

c) attributes aren't visible on the invoice unless they are multiple input attributes

You can see from the module that it inserts the ppcfield into the quick view and product screen (over the add to cart button) and it adds it to the invoice. This is really important to vendors who don't sell single items but do sell cases BUT don't want to add the pieces into the title of the product because it is inconsistent when you have a variant available for some but not all).

You can get an idea of how we sell products and why this is necessary at our website https://glaspak.com


Specifically

Example of a ppc (pieces per case) using attribute and variant - https://glaspak.com/round-1-liter-giara-swing-top-bottle.html
Example of a ppc that requires the module - https://glaspak.com/round-750-ml-dalia-swing-top-bottle.html
__________________
Business License
https://glaspak.com
GoDaddy VPS - Apache with WHM
2GB ECC DDR3 1600MHz
2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz
15 MB proc cache
60 GB 10k RPM hdd
PHP 7.0.15
MariaDB 10.1.21 with InnoDB engine
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 11:46 PM.

   

 
X-Cart forums © 2001-2020