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

Including the manufacturer in the BestSellers Module

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-13-2009, 10:23 PM
 
redidesi redidesi is offline
 

Member
  
Join Date: Nov 2009
Posts: 11
 

Default 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
__________________
4.3.0
Reply With Quote
  #2  
Old 12-14-2009, 05:20 PM
 
redidesi redidesi is offline
 

Member
  
Join Date: Nov 2009
Posts: 11
 

Default 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}
__________________
4.3.0
Reply With Quote
  #3  
Old 06-26-2012, 11:46 AM
 
fearnothing fearnothing is offline
 

Senior Member
  
Join Date: Jun 2005
Location: North East England
Posts: 124
 

Default 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.
__________________
www.smartchoicemusic.com
Smart Choice Music - Import CD and DVD Specialists
4.6.0
MySQL 5.5.34
PHP 5.4.24
Apache/2.2.26
Multiple homegrown and paid-for mods
Reply With Quote
  #4  
Old 08-02-2012, 06:19 AM
 
fearnothing fearnothing is offline
 

Senior Member
  
Join Date: Jun 2005
Location: North East England
Posts: 124
 

Default 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}
__________________
www.smartchoicemusic.com
Smart Choice Music - Import CD and DVD Specialists
4.6.0
MySQL 5.5.34
PHP 5.4.24
Apache/2.2.26
Multiple homegrown and paid-for mods
Reply With Quote
  #5  
Old 07-10-2013, 08:50 AM
 
fearnothing fearnothing is offline
 

Senior Member
  
Join Date: Jun 2005
Location: North East England
Posts: 124
 

Default 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 ?
__________________
www.smartchoicemusic.com
Smart Choice Music - Import CD and DVD Specialists
4.6.0
MySQL 5.5.34
PHP 5.4.24
Apache/2.2.26
Multiple homegrown and paid-for mods
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 06:18 AM.

   

 
X-Cart forums © 2001-2020