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)
-   -   When using variants, showing main SKU in product lists (https://forum.x-cart.com/showthread.php?t=13963)

sgpark 05-12-2005 09:14 AM

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

voltaire 06-06-2005 03:30 PM

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 ...

proboscidian 10-12-2005 06:39 PM

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.

proboscidian 05-24-2006 03:11 AM

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!

ChristineP 01-19-2009 08:11 AM

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?

ChristineP 01-30-2009 05:53 AM

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

ChristineP 02-11-2009 06:41 AM

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

rsalimian 12-31-2010 10:57 AM

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.


All times are GMT -8. The time now is 05:00 AM.

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