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)
-   -   Including the manufacturer in the BestSellers Module (https://forum.x-cart.com/showthread.php?t=51297)

redidesi 12-13-2009 10:23 PM

Including the manufacturer in the BestSellers Module
 
Hi,

I would like the Best Sellers module to list: product by manufacturer.

I couldn't figure out how to access the manufacturer variable? Can anyone help

Thanks heaps,
redidesi

redidesi 12-14-2009 05:20 PM

SOLVED: Including the manufacturer in the BestSellers Module
 
Just to answer my own question:

Using version 4.3, change lines 73 - 100 of bestsellers.php to:

if ($threshold)
$threshold -= 1;

$search_query['where'][] = " $sql_tbl[products_categories].categoryid IN ('".implode("','", $cat_ids)."')";
unset($result);
}

#
# Search the bestsellers
#
$search_query['where'][] = "$sql_tbl[products].views_stats > '0' AND $sql_tbl[products].sales_stats >= '".$threshold."'";
$search_query['fields'][] = "xcart_products.manufacturerid";

$bestsellers = func_search_products($search_query,
@$user_account["membershipid"],
"$sql_tbl[products].sales_stats DESC, $sql_tbl[products].views_stats DESC",
$config["Bestsellers"]["number_of_bestsellers"]
);

if ($bestsellers)
foreach ($bestsellers as $k => $v)
$bestsellers[$k]['manufacturer'] = func_query_first_cell("select manufacturer from $sql_tbl[manufacturers] where manufacturerid = '$v[manufacturerid]'");

$smarty->assign("bestsellers", $bestsellers);

?>


Now the manufacture name is available in the menu_bestsellers.tpl as

{$b.manufacturer}

fearnothing 06-26-2012 11:46 AM

Re: Including the manufacturer in the BestSellers Module
 
Resurrecting a very old thread here, but has anyone made this work in 4.4/4.5 ?

Threads elsewhere in the forum about manufacturers displaying on product and search pages are very helpful, but I can't seem to get this one cracked.

fearnothing 08-02-2012 06:19 AM

Re: Including the manufacturer in the BestSellers Module
 
Answering my own query:

For 4.5 (and I presume 4.4)

above the line $smarty->assign("bestsellers", $bestsellers); on bestsellers.php

Enter the following

Quote:

# Manufacturer Name Mod

if (is_array($bestsellers)){
foreach($bestsellers as $k => $v) {
$bestsellers[$k]["manufacturer"] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] m inner join $sql_tbl[products] p on p.manufacturerid = m.manufacturerid WHERE productid ='$v[productid]'"); }}

# End Manufacturer Name Mod


Now the manufacturer name is available in menu_bestsellers.tpl as {$b.manufacturer}

fearnothing 07-10-2013 08:50 AM

Re: Including the manufacturer in the BestSellers Module
 
Hmmm ... Just started testing 4.6 and the manufacturers name mod has stopped working. Does anyone have an idea what has changed in 4.6 ?


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

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