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)
-   -   SKU for variants way to long (https://forum.x-cart.com/showthread.php?t=20361)

cotc2001 03-07-2006 09:07 AM

SKU for variants way to long
 
Anyone know the answer to this.

Because of variants (colour & size) each variant is assigned it's own SKU - and because of the amount of options per size per colour some of the SKU's can get incredibly long (up to 12 digits) - is there anyway to truncuate the displayed SKU's down to the first 5 digits on emails, order history, invoices etc. as thats what we only ever use anyway?

balinor 04-03-2006 06:52 PM

Just use the smarty truncate feature, similar to the way the short description is truncated in the cart...

{$products[prod_num].product|truncate:30:"...":true}

Just do the same for whatever you want to shorten :)

cotc2001 04-03-2006 10:23 PM

K and the next question is then when adding variants even if i have set the parent SKU as just numbers i.e 01743 in the SKU of varaints it still prefixs the numbers with the word SKU - any idea on how to stop it doing that?

cotc2001 04-22-2006 10:35 AM

bump - anyone got any clue on this one?

geckoday 04-30-2006 10:10 AM

Quote:

Originally Posted by cotc2001
K and the next question is then when adding variants even if i have set the parent SKU as just numbers i.e 01743 in the SKU of varaints it still prefixs the numbers with the word SKU - any idea on how to stop it doing that?


It doesn't appear to do this in later unmodified versions (4.0.14 & up). The code that generates the SKU for the variants is in modules/Product_Options/func.php in func_rebuild_variants. At least in later versions there is a comment "Get unique SKU" just before the code that generates the SKU. You can tweak that code to do whatever you want.


All times are GMT -8. The time now is 12:28 PM.

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