View Single Post
  #4  
Old May 10th, 2013, 04:34 AM
urbaniteuk urbaniteuk is offline
 
Join Date: Apr 2013
Posts: 120
Default

Hi Eric,

Hope all is well?

Further to my query. Please could you advise on the following:

I have placed the code as advised, but in addition I would like the drop down filters to list category related Brands and Merchants (ie. Mens > Mens Brands > Related Merchants).

1. I believe this is what I need, but I'm not 100% sure where to incorporate the codes… Do I need to REPLACE or ADD this code to my existing functions.php file?

/show...5993#post35993

My current functions.php file looks like this:

Quote:
<?php
################################# FIX IE 7 bugs #############################################
add_action( 'wp_head', 'ie_conditional' );
if (!function_exists('ie_conditional')) {
function ie_conditional()
{
echo "
<!--[if IE 7]>
<style>
#sidebar { margin-top:-16px;}
body.home #sidebar { margin-top:0px;}
#plusone-div {padding: 0 0 10px !important;}
#plusone-div {position:absolute;margin:12px 0 0 0 !important;display:inline;padding: 0 0 10px !important;}
</style>
<![endif]-->
<!--[if IE 8]>
<style>
#plusone-div {position:absolute;margin:12px 0 0 0 !important;display:inline;padding: 0 0 10px !important;}
</style>
<![endif]-->
";
}}

function dfr_get_brands() {
global $wpdb;
$brands = $wpdb->get_results("SELECT brand FROM ".$wpdb->prefix."dfr_shop_products GROUP BY brand");
$html = '<option value="">Select a brand</option>';
foreach ($brands as $brands) {
if (trim($brands->brand) != "") {
$selected = (strip_tags(stripslashes($_GET['brand']))==$brands->brand) ? ' selected="selected"' : '';
$html .= '<option value="'.$brands->brand.'"'.$selected.'>'.$brands->brand.'</option>';
}
}
return $html;
}

function dfr_get_merchants() {
global $wpdb;
$merchants = $wpdb->get_results("SELECT merchant, merchant_id FROM ".$wpdb->prefix."dfr_shop_products GROUP BY merchant");
$html = '<option value="">Select a merchant</option>';
foreach ($merchants as $k => $v) {
if (trim($v->merchant) != "") {
$selected = (strip_tags($_GET['merchant_id'])==$v->merchant_id) ? ' selected="selected"' : '';
$html .= '<option value="'.$v->merchant_id.'"'.$selected.'>'.$v->merchant.'</option>';
}
}
return $html;
}

function dfr_get_networks() {
global $wpdb;
$networks = $wpdb->get_results("SELECT network, net_id FROM ".$wpdb->prefix."dfr_shop_products GROUP BY net_id");
$html = '<option value="">Select a network</option>';
foreach ($networks as $k => $v) {
if ($v->net_id > 0) {
$selected = (strip_tags($_GET['net_id'])==$v->net_id) ? ' selected="selected"' : '';
$html .= '<option value="'.$v->net_id.'"'.$selected.'>'.$v->network.'</option>';
}
}
return $html;
}
################################# END FIX FOR FACEBOOK LIKE THUMB URL ##########################################
?>

2. Where in the factory do I add this code?

Quote:
<ul>
<?php
$brands = dfr_get_brands_list($category);
foreach ($brands as $brand) : ?>
<li><a href="[server.url type='fullpage' query='brand=$brand']"><?php echo $brand; ?></a></li>
<?php endforeach; ?>
</ul>

3. Is there a way to re-size the width of the drop downs, as I would like to keep the sizes consistent (Select a Brand/Select a Merchant)?

Many thanks.