View Single Post
Old January 25th, 2012, 03:23 PM
Giftoly Giftoly is offline
Join Date: Dec 2011
Posts: 52
Default Price, merchant, brand auto filter

Good Afternoon,

I have tried the following thread which I would be really interested in doing but it got too long and confusing

I tried copying the following code into the function.php file and the second part inside a 'text' box that I inserted onto a view.


I think your query is completely wrong. I did this and it worked:

Code for theme's functions.php file:
PHP Code:
function dfr_get_brands() {
    global $wpdb;
    $brands = $wpdb->get_results("SELECT brand FROM ".$wpdb->prefix."dfr_shop_products GROUP BY brand");
    $html = '';
    foreach ($brands as $brands) {
        $html .= '<option value="'.$brands->brand.'">'.$brands->brand.'</option>';
    return $html;
Code for your view:
HTML Code:
<form method="get">
	<select name="brand">
		<?php echo dfr_get_brands(); ?>
		<input type="submit" value="Go" />
However category pages will now no longer open when selected from the menu on the side of this page

Could I have deleted something by accident from the Category section ??

I currently have

1) Breadcrumb

2) Text
<!-- Category Name -->
<!-- /Category Name -->

  <?php if ($category->image) { ?>
  <!-- Category Image -->
  <img src="[category.image]" alt="[]" style="float:left;margin:0 10px 10px 0;" />
  <!-- /Category Image -->
  <?php } elseif ($category->thumbnail) { ?>
  <!-- Category Thumbnail -->
  <img src="[category.thumbnail]" alt="[]" style="float:left;margin:0 10px 10px 0;" />
  <!-- /Category Thumbnail -->
  <?php } ?>
  <!-- Category Description -->
  <!-- /Category Description -->
3) Text
With just some category specific text

4) Category list

5) Product list
Many thanks