X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Parent SKU for a item with variants? (https://forum.x-cart.com/showthread.php?t=37434)

mikeynuts 02-08-2008 01:12 AM

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

balinor 02-08-2008 04:09 AM

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.

geckoday 02-08-2008 07:09 AM

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.

geckoday 02-08-2008 07:16 AM

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.

mikeynuts 02-08-2008 07:53 PM

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.


All times are GMT -8. The time now is 01:28 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.