Support » Plugin: Amazon Link » Implementing live search product link

  • Resolved guel

    (@guel)


    Hi,

    I’m trying to put a single product link for book product searched by the keywords specified. The keyword is obtained by the user filling out the form from previous page. I get the inputs by GET and assign it to a variable for example, $book-title. I want to search for products in book category with this $book-title showing 1 result(hopefully the top result).

    Can you help me accomplishing this?

    http://wordpress.org/extend/plugins/amazon-link/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    It’s not something that the plugin supports in a ‘user friendly’ way, but I could probably give you a snippet of php code to do what you want. I’ll try and post something tomorrow,

    Cheers,

    Paul

    Plugin Author paulstuttard

    (@paulstuttard)

    This is the least ‘back door’ish way I can think of to do a search:

    if (isset($awlfw)) {
    	$opts['s_title'] = $book_title;
    	$opts['s_index'] = 'Books';
    	$opts['s_page']  = 1;
    	$items = $awlfw->search->do_search($opts);
    	if (isset($items['Error'])) {
    		echo '<div class="Error">Search Failed: ' . (isset($items['Error']['Message']) ? $items['Error']['Message'] : 'No Error Message') . '</div>';
    	} else if (is_array($items) && (count($items) >0)) {
    		$asin = $items[0]['asin'];
    		echo amazon_shortcode("asin=$asin&template=wishlist&live=1");
    	} else {
    		echo "<PRE>";print_r($items); echo "</PRE>";
    
    	}
    }

    Works for me, at least,

    Good luck,

    Paul

    Hi Paul.

    It works. It helped a lot. Thank you for your assistance.

    I have another question. What is the keyword to place between %% to display “used price and new price starting from” other than amazon’s price? Are these keywords listed somewhere?

    Where can I find a list of keywords for the associative array field? For example, how do I add a query for ISBN 10?

    Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    The keywords the plugin currently supports are listed in the ‘Template Help’ window on the plugin’s Options page.

    You can add your own keywords by creating your own ‘extras’ plugin or adding some code to your themes files, here is a plugin I knocked up to add the ISBN, NEW_PRICE & USED_PRICE keywords:

    amazon-link-my-keywords.php

    Download it, remove the ‘_.txt’ extension, upload to your plugins directory and activate it.

    If you have a play around with the Amazon Advertising Scratchpad you can see exactly what data is available and where in the response data structure it might be found:

    http://associates-amazon.s3.amazonaws.com/scratchpad/index.html

    Paul

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Implementing live search product link’ is closed to new replies.