Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

Need to have paginated search results that are limited to a specific browsenode

  • 2ndrendermedia
  • 2ndrendermedia's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 months 3 weeks ago #3923 by 2ndrendermedia
2ndrendermedia created the topic: Need to have paginated search results that are limited to a specific browsenode
Hello,

Creating a menu link that is an Amazon Shopping Cart> Product Search type allows me to show a page with paginated results. Perfect for what i need. The problem is the search criteria is too broad so instead i linked to an article with shortcode that brings up a specific browsenode. The problem with this method is, as far as i can see, there's no option to add paginated results.

Is there a way to have paginated search results that only pick from a specific browsenode?

Thanks.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago - 4 months 3 weeks ago #3924 by boggler
boggler replied the topic: Need to have paginated search results that are limited to a specific browsenode
The best solution is to make some slight changes to the product search item type, this is actually very simple, you just need a couple of code edits.

1. In components/com_amazonws/views/productsearch/tmpl/default.xml, on line 34, immediately after the search index field definition, add one for the browse node, so that you have this:-
<field name="searchIndex" type="searchIndex" default="All" all="1" label="Search Index" description="ASC_PARAMSEARCHINDEX">   			
</field>
<field name="browseNode" type="text" default="" label="Browse Node" description="Select the browse node" />	

2. In components/com_amazonws/views/productsearch/view.html.php, on line 156, immediately after the search index definition add a definition for the operation browse node, so that you have this:-
	$operation["SearchIndex"] = $searchIndex;
	$browseNode = JRequest::getInt('browseNode', 0);
	if(!empty($browseNode) && $searchIndex != "All")
	{
		$operation["BrowseNode"] = $browseNode;
	}

That should be all that you need. Now that you have brought this up we can put this in the next release, but in the meantime if you edit the code yourself it should do what you want.

Amazon don't allow the use of browse nodes with the All search index, which is why it is excluded in the code above.
Last Edit: 4 months 3 weeks ago by boggler.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #3925 by boggler
boggler replied the topic: Need to have paginated search results that are limited to a specific browsenode
You might also need to add the browse node as a pagination parameter. It depends, sometimes it will work correctly without this. But if you find that you are getting odd results after the first page, add it after the search index pagination parameter, line 257, so that you have this
	$this->pagination->setAdditionalUrlParam("searchIndex", htmlspecialchars($searchIndex, ENT_QUOTES));
	if(!empty($browseNode))
	{
		 $this->pagination->setAdditionalUrlParam("browseNode", (int)$browseNode);			  
	}

Please Log in or Create an account to join the conversation.

  • 2ndrendermedia
  • 2ndrendermedia's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 months 3 weeks ago #3926 by 2ndrendermedia
2ndrendermedia replied the topic: Need to have paginated search results that are limited to a specific browsenode
That works great; thank you very much.

My only issue now is that, because it's a search, i need to input search terms when I'd ideally just like it to show paginated results of any/all items from a specific browsenode with pagination. Having to add a search word (in my case "men's" since it's meant to show men's fitness clothing on this specific page as an example) means that, if the word isn't in the item name then I'm actually causing it to show fewer, less relevant results. I hope I'm making sense. Is there a way to enable the site to show all items from a browsenode with pagination and without the need for keywords?

Please Log in or Create an account to join the conversation.

  • 2ndrendermedia
  • 2ndrendermedia's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 months 3 weeks ago - 4 months 3 weeks ago #3927 by 2ndrendermedia
2ndrendermedia replied the topic: Need to have paginated search results that are limited to a specific browsenode
Thinking more on it, i suppose one method is to create 10 articles all with the shortcode in to generate the items from the browsenode and each set to display a different "itemPage" of the results. I'll try this out if you don't have a better alternative solution. It's a bit messy but it should work, i think.
Last Edit: 4 months 3 weeks ago by 2ndrendermedia.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #3928 by boggler
boggler replied the topic: Need to have paginated search results that are limited to a specific browsenode

Thinking more on it, i suppose one method is to create 10 articles all with the shortcode in to generate the items from the browsenode and each set to display a different "itemPage" of the results. I'll try this out if you don't have a better alternative solution. It's a bit messy but it should work, i think.


Yes, that is the sort of approach that you need to use.

Amazon don't offer a way to simply show all the results in the browse node, you can only use an item search which requires keywords, an item lookup which shows specific items using their asins, or a similarity lookup, which shows similar items to a list of items specified by the asins.

You might look at using an item lookup, you can list up to 10 itemIds in a single shortcode, then you know exactly what will be displayed. But it is more work, and as the availability of items changes over time you would need to keep updating the list.

Please Log in or Create an account to join the conversation.

  • 2ndrendermedia
  • 2ndrendermedia's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 months 2 weeks ago #3929 by 2ndrendermedia
2ndrendermedia replied the topic: Need to have paginated search results that are limited to a specific browsenode
Ok. thanks again.

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.203 seconds