Jump to content

Filter by Manufacturer (Code included)


Guest Rick@GDLA

Recommended Posts

Guest Rick@GDLA

CubeCart 5.0.9

Why cannot I not do an advanced search and filter by manufacturer without having to type in a keyword?

I wrote a hack to catalogue.class.php to add this rather obvious functionality

classes/catalogue.class.php

add at Line 1095

//hack

else{

$whereString = (isset($where) && is_array($where)) ? implode(' AND ', $where) : '';

if (!empty($whereString)) $whereString = ' AND '.$whereString;

$query=sprintf("SELECT I.* FROM %1\$sCubeCart_inventory AS I WHERE I.status = 1 %2\$s ",$GLOBALS['config']->get('config', 'dbprefix') , $whereString);

$search = $GLOBALS['db']->query($query);

if ( $search !== false) {

$q2=sprintf($query.' '.$limit,$GLOBALS['config']->get('config', 'dbprefix') , $whereString);

$count = $GLOBALS['db']->query($q2, false, 0);

$this->_category_count = (int)count($count);

$this->_category_products = $search;

return true;

}

}

// end hack

Link to comment
Share on other sites

Funny thing is, there originally was some code to handle things like that (it needed a little adapting to handle the manufacturers still mind), but they commented it out in a later version with a note that said something like // Can't see why this would ever be needed

I found that a little bizarre when I had to re-fix a manufacturer search mod I'd done for a friend

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...