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

When using variants, showing main SKU in product lists

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-12-2005, 09:14 AM
 
sgpark sgpark is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 51
 

Default When using variants, showing main SKU in product lists

Hi. I searched the forum but couldn't find the exact solution to this problem. Please forgive if I'm repeating a past post.

We're a clothing company, so we use variants for our products. When listing products on search result and category/subcat pages, the default SKU number that is pulled for $products[product].product is the SKU for the first product variant, not the "root" SKU for the product.

So, for a product with "root" SKU CZ-0012 that has variant SKUs CZ-0012-BL, CZ-0012-RD etc., the product list will show the SKU CZ-0012-BL. I want it to show the "root" SKU CZ-0012.

Which file would I need to edit to do this and how?

--------------------
Simma Park
BabyCZ.com
XCART Gold 4.0.11
Reply With Quote
  #2  
Old 06-06-2005, 03:30 PM
 
voltaire voltaire is offline
 

Newbie
  
Join Date: Apr 2005
Posts: 1
 

Default Re: When using variants, showing main SKU in product lists

Quote:
Originally Posted by sgpark
So, for a product with "root" SKU CZ-0012 that has variant SKUs CZ-0012-BL, CZ-0012-RD etc., the product list will show the SKU CZ-0012-BL. I want it to show the "root" SKU CZ-0012.

Which file would I need to edit to do this and how?

Exact same issue ..

Did you ever get an answer on this?

Anyone?

Best,

Harold ...
__________________
---
X-Cart v4.0.13
Reply With Quote
  #3  
Old 10-12-2005, 06:39 PM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default

I have seen this same topic, also unanswered, in another thread. I found a workaround for one site I'm doing, but this probably wouldn't work for most. Because these particular products don't really need short descriptions, I am using the root sku as the short description and displaying that code, not the sku code. That is, instead of
{$products[product].productcode}

I am using
{$products[product].product}

This isn't the greatest solution, because a lot of people need those short descriptions for what they're meant for. I'd like to find something more correct.
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
  #4  
Old 05-24-2006, 03:11 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Showing main SKU - solution!

I just got an answer from x-cart on this one. In include/search.php, comment out the two places where
Code:
$sql_tbl[variants].productcode,
occurs.

Save your 25 points and read it here!
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
  #5  
Old 01-19-2009, 08:11 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: When using variants, showing main SKU in product lists

Has anyone been successful with finding the code for v4.1.9 to achieve the same results as above?
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #6  
Old 01-30-2009, 05:53 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: When using variants, showing main SKU in product lists

Does anyone have a suggestion to display the root sku (part number) on the product.tpl and products_t.tpl pages for variants. I checked in my include/search.php and the only reference close to the above code by proboscidian is $sql_tbl[variants].productid:

$left_joins["variants"] = array(
"on" => "$sql_tbl[variants].productid = $sql_tbl[products].productid AND $sql_tbl[quick_prices].variantid = $sql_tbl[variants].variantid",
"parent" => "quick_prices"
);


Once a product variant is selected and the customer adds to cart for checkout, then the variant sku number is fine to display.

Christine
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #7  
Old 02-11-2009, 06:41 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: When using variants, showing main SKU in product lists

Bump. Has anyone made a change to display the root sku on the product.tpl and products_t.tpl pages for variants?

Christinie
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #8  
Old 12-31-2010, 10:57 AM
 
rsalimian rsalimian is offline
 

Newbie
  
Join Date: Nov 2010
Posts: 2
 

Default Re: When using variants, showing main SKU in product lists

hi all,

Current X-Cart logic is:
when product has Variants then it use the first variant SKU for showing at product detail

new login we need is:
showing main SKU instead of showing first Variant SKU


my Solution:


- FILE: \wholesale\include\func\func.product.php



FUNCTION: func_select_product

LINE: around 1049 √


what you should do is:



you should comment the line

Code:
$tmp = func_query_first("SELECT * FROM $sql_tbl[variants] WHERE variantid = '$product[variantid]'");


also :

in \skin\"your skin name"\customer\main\product_details.tpl

line: find the table row that shows the productcode and remove the "id=product_code" attribute of TD tag.

i think its not true for deleteing this attribute and we should find that where at the code side it set the value for this id.
__________________
Version 4.4.1
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 01:05 AM.

   

 
X-Cart forums © 2001-2020