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

SKU for variants way to long

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-07-2006, 09:07 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default 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?
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #2  
Old 04-03-2006, 06:52 PM
 
balinor balinor is offline
 

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

Default

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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 04-03-2006, 10:23 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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?
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #4  
Old 04-22-2006, 10:35 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

bump - anyone got any clue on this one?
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #5  
Old 04-30-2006, 10:10 AM
 
geckoday geckoday is offline
 

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

Default

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.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
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 03:12 AM.

   

 
X-Cart forums © 2001-2020