brand and price select menu behaviour

brand and price select menu behaviour

Postby onesquarelight » Fri Mar 26, 2010 1:54 am

First, thanks for the awesome script.

I have just a couple things I've noticed that I wanted to bring to your attention.

With the brand and price select menus, once a selection is made all other options no longer available. I'd like to request that a future release be altered so that you can make subsequent selections.

On a similar note.
The sort select menu does not pass the query string parameters from the brand and price menus. This means every time you drive into the desired brand and price range, any attempt to sort the results ends up delivering a wider range of products than expected.
onesquarelight

 
Posts: 13
Joined: Wed Mar 24, 2010 11:17 pm

Re: brand and price select menu behaviour

Postby onesquarelight » Sat Mar 27, 2010 3:48 am

The ajax sort has never worked for me. The page always does a full post back.

I've fixed that and added a bit of script that allows you to sort product results and still maintain a selected brand or price range.

If you want to try it replace lines 52 - 63 of category.tpl with the following:

<?php
$attributearray = array();
$querystring = $_SERVER["QUERY_STRING"];
$pairs = explode("&", $querystring);
foreach($pairs as $values){
$val = explode("=", $values);
if($val[0] === 'brand'){
$sortqs .= '&amp;brand='.$val[1];
}
if($val[0] === 'minprice'){
$sortqs .= '&amp;minprice='.$val[1];
}
if($val[0] === 'maxprice'){
$sortqs .= '&amp;maxprice='.$val[1];
}
}

?>
<?php if($this->sort): ?>
<div class="sort">
<div class="div1">
<select onchange="ajaxUpdater('content',this.value);return false;" name="sort">
<option selected="selected" value="<?php echo $this->sort->current->ajaxurl.$sortqs; ?>">
<?php echo $this->sort->current->name; ?>
</option>
<?php foreach($this->sort->options as $s): ?>
<option value="<?php echo $s->ajaxurl.$sortqs; ?>"><?php echo $s->name; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="div2"><?php eprint(LangSortBy); ?>:</div>
</div>

This still doesn't solve the issue that I mentioned at the top of this thread. Once you make a brand selection or a price selection all other options for brand and price disappear from the select menu.
onesquarelight

 
Posts: 13
Joined: Wed Mar 24, 2010 11:17 pm

Re: brand and price select menu behaviour

Postby admin » Sat Mar 27, 2010 5:40 pm

onesquarelight wrote:
With the brand and price select menus, once a selection is made all other options no longer available. I'd like to request that a future release be altered so that you can make subsequent selections.


Unfortunately there is nothing I can do about this. When you select a brand, a request is made to Amazon to return all items with your brand selection, also it requests a new brand list based on your brand selection. To get round this I could do two seperate API requests, but Amazon only allow one request per second and this would slow the site down significantly.

onesquarelight wrote:On a similar note.
The sort select menu does not pass the query string parameters from the brand and price menus. This means every time you drive into the desired brand and price range, any attempt to sort the results ends up delivering a wider range of products than expected.


Thanks, I will work on a fix for the next release.
User avatar
admin
Site Admin
 
Posts: 462
Joined: Sun Nov 22, 2009 7:24 pm

Re: brand and price select menu behaviour

Postby onesquarelight » Sun Mar 28, 2010 5:45 pm

Cool. Don't know if you looked at that php snippet I worked out but that fix allows you to sort without loosing price and brand parameters. Of course it's probably better to handle that behind the scenes rather than at the template level.
onesquarelight

 
Posts: 13
Joined: Wed Mar 24, 2010 11:17 pm

Re: brand and price select menu behaviour

Postby admin » Sun Mar 28, 2010 6:40 pm

onesquarelight wrote:Cool. Don't know if you looked at that php snippet I worked out but that fix allows you to sort without loosing price and brand parameters. Of course it's probably better to handle that behind the scenes rather than at the template level.


Yeah thanks highlighting this. I have fixed this in the main code for the next version, so FYI when you upgrade you may need to remove your modification because it will double up like ?brand=sony?brand=sony :)
User avatar
admin
Site Admin
 
Posts: 462
Joined: Sun Nov 22, 2009 7:24 pm

Re: brand and price select menu behaviour

Postby onesquarelight » Wed Mar 31, 2010 4:13 pm

duly noted. I see v2.0 is released. Alas no more free version?? I'll be checking it out for sure.
onesquarelight

 
Posts: 13
Joined: Wed Mar 24, 2010 11:17 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron