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

Parent SKU for a item with variants?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-08-2008, 01:12 AM
 
mikeynuts mikeynuts is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 46
 

Default Parent SKU for a item with variants?

Is there a way I can get the parent SKU on an invoice?

Right now it just shows the SKU of the item that was ordered, but I would also like to show the product code of the product.

Basically I used the Product Code to group the variants together, and used the UPC's of the products for the variants.


Thanks,
Mike
__________________
X-Cart Gold v4.1.9
Reply With Quote
  #2  
Old 02-08-2008, 04:09 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Parent SKU for a item with variants?

Technically there is no root SKU if you used variants, as each of the variants is their own product.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-08-2008, 07:09 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Parent SKU for a item with variants?

X-Cart only supplies the product code of the variant and not the product. You would need to modify the query in include/func/func_order.php function func_order_data to rename the products table productcode field to something like parentproductcode so that it doesn't get overlayed by the product code in the order_details table. It should then be available in the template as $product.parentproductcode.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #4  
Old 02-08-2008, 07:16 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Parent SKU for a item with variants?

Quote:
Originally Posted by balinor
Technically there is no root SKU if you used variants, as each of the variants is their own product.
Not in X-Cart. Each product with variants is a single row in the products table with a productcode. Each variant for that product is a separate row in the variants table with a product code for that particular variant. So a root productcode/SKU exists in the database as well as productcode/SKU for each varaiant.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #5  
Old 02-08-2008, 07:53 PM
 
mikeynuts mikeynuts is offline
 

Advanced Member
  
Join Date: Jan 2007
Posts: 46
 

Default Re: Parent SKU for a item with variants?

Quote:
Originally Posted by geckoday
X-Cart only supplies the product code of the variant and not the product. You would need to modify the query in include/func/func_order.php function func_order_data to rename the products table productcode field to something like parentproductcode so that it doesn't get overlayed by the product code in the order_details table. It should then be available in the template as $product.parentproductcode.

Oh wow, works perfectly... THANKS!

For anyone else I added:

$sql_tbl[products].productcode as parentproductcode

to the sql query in the query in the function above.
__________________
X-Cart Gold v4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 10:15 AM.

   

 
X-Cart forums © 2001-2020