Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   search results high to low WITH sale prices (/showthread.php?t=11047)

yankeestonk September 28th, 2014 03:03 PM

search results high to low WITH sale prices
 
http://saveongolf.net

I have my search results set up to display high price to low. However it is displaying the retail price high to low and not the actual price if on sale. Can I set it up to show the results based on price including sale prices?

Eric September 28th, 2014 08:16 PM

Hi,

Change the query parameter from "price" to "sprice".

Eric

yankeestonk September 29th, 2014 09:02 AM

Can you show me where? I did it in the code near the top and had no effect.

here is the code:

HTML Code:

<style type="text/css">.desc img {float:left;}</style>


<!-- Search Heading -->
<h2>Your Search Results:</h2>
<!-- /Search Heading -->


<!-- Search Fields -->
<ul>
  <?php if (@$_GET['word']){ ?><li><b>Word: </b>[store.get param="word"]</li><?php } ?>
  <?php if (@$_GET['merchant']){ ?><li><b>Merchant: </b>[store.get param="merchant"]</li><?php } ?>
  <?php if (@$_GET['tags']){ ?><li><b>Tags: </b>[store.get param="tags"]</li><?php } ?>
  <?php if (@$_GET['price']){ ?><li><b>Price: </b>[store.get param="price"]</li><?php } ?>
</ul>
<!-- /Search Fields -->


<div class="dffltrs">
  <form method="get">
    <span class="dflside">
      Products per page:
      <?php echo datafeedr_tools()->form_select("ppp",
        array(
        "16" => "16",
        "32" => "32",
        "56" => "56",
        "80" => "80",
        )); ?>
    </span>
    <span class="dfrside">
      Sort by:
      <?php echo datafeedr_tools()->form_select("sort",
        array(
        "price"  => "Price (low to high)",
        "-price"  => "Price (high to low)",
        "name"    => "Product Name (a - z)",
        "-name"  => "Product Name (z - a)",
        )); ?>
      <input type="submit" value="Go" class="dfsbmt" />
    </span>
    <div class="clearingdiv">&nbsp;</div>
  </form>
</div>


<!-- Pagination Links (Top) -->
<div class="pgr">
  Pages:
  [pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
  [pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
  [pager.pages delim=' ']
  [pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
  [pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Top) -->

<!-- Product List -->
  <ul class="products grid">
<div class="pl">
  [product.each]
  <div class="t1 col5">
  <div class="bdr">
    <h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2>
    <div class="thmb"><a href="[product.link]" title="[product.name]">[product.thumbnail tag='1']</a></div> 
   
   
    <?php if ($product->saleprice > 0 &&  $product->saleprice < $product->price) { ?>
  <div class="prc">
    <small>
      <span style="text-decoration: line-through;">[product.currency mode='sign'][product.price]</span>
      <span style="font-weight: bold; color:red;">[product.currency mode='sign'][product.saleprice]</span>
    </small>
  </div>
<?php } else { ?>
  <div class="prc">
    <small>
      [product.currency mode='sign'][product.price]
    </small>
  </div>   
<?php } ?>
    <p class="desc">[product.description]</p>
    <div class="logo">[product.merchant_logo]</div>
    <div class="btns">
    <?php if ( $product->compset_status > 0 ) : ?>
  <a href="[product.link]" class="dfbutton dforange dfmedium dfrounded" title="Find the best price for [product.name]">Compare Prices</a>
<?php else : ?>
  <a href="[product.link]" class="dfbutton dfgreen dfmedium dfrounded" title="View details of [product.name]">Details</a>
<?php endif; ?>
    </div>
    <div class="clearingdiv"> </div>
  </div>
  </div>
  [/product.each]
  <div class="clearingdiv"> </div>
</div>
</ul>
<!-- /Product List -->


<!-- Search Results -->

<!-- /Search Results -->
<!-- Pagination Links (Bottom) -->
<div class="pgr">
  Pages:
  [pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
  [pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
  [pager.pages delim=' ']
  [pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
  [pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Bottom) -->


Eric September 29th, 2014 09:06 AM

Hi,

Change this:

PHP Code:

"price" => "Price (low to high)",
"-price" => "Price (high to low)"

To this:

PHP Code:

"sprice" => "Price (low to high)",
"-sprice" => "Price (high to low)"

Eric

yankeestonk September 29th, 2014 09:22 AM

Hi Eric,

http://saveongolf.net

I made the change above and it doesn't work in conjunction with a search from the search bar. This is the code for the search bar widget in W.P. . Is there something I need to add here to make it sort by price and sale price when using the search bar?

<form role="search" method="get" id="searchform" class="search-form" action="/store/search/">
<div><label class="screen-reader-text" for="s">Search for:</label>
<input class="search-field" type="text" value="" name="name" id="s" value="<?php echo esc_attr( @$_GET['name'] ); ?>">
<input class="search-submit" type="submit" id="searchsubmit" value="Search"><input name="saleprice" value="1-" type="checkbox"><strong style="color:#fff;margin-top: 5px; display: inline-table; margin-left: 5px; float: left;">On sale</strong>
</div></form>


Actually, I was just checking my site and the filter by merchant datafeedr widget is also not filtering by "sprice". Do I have to change the "price" to "sprice" in multiple areas and for individual widgets or just in the search default area? ) which I did and isn't working.

Eric September 29th, 2014 10:40 AM

Answered here: /show...0980#post50980

yankeestonk September 29th, 2014 11:41 AM

That seems to have done the trick! Thanks much Eric!!!!

yankeestonk September 29th, 2014 05:26 PM

spoke to soon. Still showing retail prices in order high to low even when the sale prices are lower. Here is the code for "Search Page" Default.

When I search in the search bar it is giving retail price high to low. I need it to show the price high to low even if it is a sale price.

<style type="text/css">.desc img {float:left;}</style>


<!-- Search Heading -->
<h2>Your Search Results:</h2>
<!-- /Search Heading -->


<!-- Search Fields -->
<ul>
<?php if (@$_GET['word']){ ?><li><b>Word: </b>[store.get param="word"]</li><?php } ?>
<?php if (@$_GET['merchant']){ ?><li><b>Merchant: </b>[store.get param="merchant"]</li><?php } ?>
<?php if (@$_GET['tags']){ ?><li><b>Tags: </b>[store.get param="tags"]</li><?php } ?>
<?php if (@$_GET['price']){ ?><li><b>Price: </b>[store.get param="price"]</li><?php } ?>
</ul>
<!-- /Search Fields -->


<div class="dffltrs">
<form method="get">
<span class="dflside">
Products per page:
<?php echo datafeedr_tools()->form_select("ppp",
array(
"16" => "16",
"32" => "32",
"56" => "56",
"80" => "80",
)); ?>
</span>
<span class="dfrside">
Sort by:
<?php echo datafeedr_tools()->form_select("sort",
array(
"sprice" => "Price (low to high)",
"-sprice" => "Price (high to low)",
"name" => "Product Name (a - z)",
"-name" => "Product Name (z - a)",
)); ?>
<input type="submit" value="Go" class="dfsbmt" />
</span>
<div class="clearingdiv">&nbsp;</div>
<?php
if ( isset( $_GET['name'] ) ) {
echo '<input type="hidden" name="name" value="' . $_GET['name'] . '" />';
}
?>
</form>
</div>


<!-- Pagination Links (Top) -->
<div class="pgr">
Pages:
[pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
[pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
[pager.pages delim=' ']
[pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
[pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Top) -->

<!-- Product List -->
<ul class="products grid">
<div class="pl">
[product.each]
<div class="t1 col5">
<div class="bdr">
<h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2>
<div class="thmb"><a href="[product.link]" title="[product.name]">[product.thumbnail tag='1']</a></div>


<?php if ($product->saleprice > 0 && $product->saleprice < $product->price) { ?>
<div class="prc">
<small>
<span style="text-decoration: line-through;">[product.currency mode='sign'][product.price]</span>
<span style="font-weight: bold; color:red;">[product.currency mode='sign'][product.saleprice]</span>
</small>
</div>
<?php } else { ?>
<div class="prc">
<small>
[product.currency mode='sign'][product.price]
</small>
</div>
<?php } ?>
<p class="desc">[product.description]</p>
<div class="logo">[product.merchant_logo]</div>
<div class="btns">
<?php if ( $product->compset_status > 0 ) : ?>
<a href="[product.link]" class="dfbutton dforange dfmedium dfrounded" title="Find the best price for [product.name]">Compare Prices</a>
<?php else : ?>
<a href="[product.link]" class="dfbutton dfgreen dfmedium dfrounded" title="View details of [product.name]">Details</a>
<?php endif; ?>
</div>
<div class="clearingdiv"> </div>
</div>
</div>
[/product.each]
<div class="clearingdiv"> </div>
</div>
</ul>
<!-- /Product List -->


<!-- Search Results -->

<!-- /Search Results -->
<!-- Pagination Links (Bottom) -->
<div class="pgr">
Pages:
[pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='']
[pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='']
[pager.pages delim=' ']
[pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='']
[pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='']
</div>
<!-- /Pagination Links (Bottom) -->

Eric September 29th, 2014 07:26 PM

Hi,

It seems to work for me: http://saveongolf.net/store/category...16&sort=sprice

Eric

yankeestonk September 30th, 2014 06:50 AM

Why am I getting this?
http://saveongolf.net/store/category...st-gold-rated/

Eric September 30th, 2014 09:27 AM

Hi,

That's also working for me when you use the sort by option: http://saveongolf.net/store/category...6&sort=-sprice

Eric

yankeestonk September 30th, 2014 10:40 AM

Hi Eric,

I guess my question is why isn't it working when you select something from the Store Categories list on the left? http://saveongolf.net/store/category/golf-clubs-all/

Eric September 30th, 2014 10:41 AM

Hi,

So you mean you want the default sort to be by price?

Eric

yankeestonk September 30th, 2014 12:06 PM

Not sure what it is called, but I'd like (at least for now while I test it out) is for every search/sort etc. to be from high priced to low by "sprice". Right now my site is sorting search items by sprice and category searches by price. I'd like it to all be uniform. I just want to test and see if this is the best way for consumers to find what they are looking for given the vast amount of products in our store.

yankeestonk September 30th, 2014 12:12 PM

I'm not sure really how the best default sort should be. I see a lot of golf websites and other sites sort by popularity first. I don't think that is an option with Datafeedr. So I'm left with name/price/sprice high to low or low to high. None of which are the best options as we've got both new and used items etc. Only one vendor actually puts their sale price on the items, and they are mostly used clubs. So I'm kind of experimenting to see. I know low to high is out as the very low priced items are usually items that shouldn't even be in the store but slipped past the search criteria. High to low might be better but I don't know. There is no popularity option I guess right?
Do you have an opinion on the best way to sort? I think all the sorts should be one way so it's consistent whichever I go with.

Eric September 30th, 2014 12:18 PM

Hi,

Yes, there is a popularity option and that can be based on both "views" (the number of times a product has been viewed on your site) and "clickthroughs" (the number of times a product's buy button has been clicked.

You can change the default sort of your categories here: The Factory > Your Store > VIEWS > CATEGORY PAGE > Default > Product list module > Settings () > Sort by

Eric

yankeestonk September 30th, 2014 01:13 PM

THanks Eric. I'll try that. I may be back on this one though...so don't leave your computer!

yankeestonk September 30th, 2014 01:54 PM

I told you I'd be back! Is there a way to put "popularity" in the "sort by" widget? Right now I have Random, hi to low, low to high, a-z and z-a? Since the site is new I don't know how the views thing will work now, but I'd like to try it. This is going to sound really dumb, but it won't be the first time... are the views "counted" already? Or does that have to be activated by doing the above to start that. In other words will the most viewed up to now show, or if I wait and have the site live for 3 months before I add the most popular option will it know what was viewed the most? My head is going to explode!

Eric September 30th, 2014 03:40 PM

Hi
Quote:

Originally Posted by yankeestonk (Post 51005)
Is there a way to put "popularity" in the "sort by" widget?

We don't have (and will not have) a popularity field. We only have "views" and "clickthroughs".

Quote:

Originally Posted by yankeestonk (Post 51005)
are the views "counted" already

Views are already being counted by default.

Eric

yankeestonk September 30th, 2014 06:09 PM

1 Attachment(s)
Can I add "views" to the "sort by" dropdown widget. If so where do I do that?


All times are GMT -5. The time now is 01:10 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.