X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to display 'base' sku for variants - 4.3 (https://forum.x-cart.com/showthread.php?t=52905)

balinor 03-19-2010 01:38 PM

How to display 'base' sku for variants - 4.3
 
Remember seeing this one for previous versions, but things have changed in 4.3. When you display the sku on the products list, it shows the first variant. Need to display the 'base' sku (i.e. the sku of the main product) instead. Any ideas where that little PHP snippet lives?

Jon 03-19-2010 06:25 PM

Re: Anyone know how to display 'base' sku for variants - 4.3
 
Sometimes I feel like x-cart has one person who understands and writes the variants code and he works to ensure his job security :)

Open include/search.php

FIND:

Code:

        foreach ($variant_properties as $property) {
            $fields[] = "IFNULL($sql_tbl[variants].$property, $sql_tbl[products].$property) as ".$property;
        }


Replace with:

Code:

        foreach ($variant_properties as $property) {
            if ($property != 'productcode')
            $fields[] = "IFNULL($sql_tbl[variants].$property, $sql_tbl[products].$property) as ".$property;
        }


balinor 03-21-2010 04:17 AM

Re: Anyone know how to display 'base' sku for variants - 4.3
 
Going to move this to Custom Mods :)


All times are GMT -8. The time now is 02:11 PM.

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