Adding Amazon.com Universal Wish List Button
Information about it:
amazon.com/wishlist/vendor-button/ref=cm_wl_uwl_landing
I would like to add the universal wish list button. Amazon provides this code:
Code:
<script id="AddToAUWLButton" language="JavaScript1.2" type="text/javascript" src="http://www.amazon.com/gp/wishlist/bookmarklet/getbutton.js"> </script>
Is this possible to incorporate into ZenCart and if so can someone tell me where I would insert it (directory, file name and location in code)?
Thanks in advance.
Re: Adding Amazon.com Universal Wish List Button
BTW here is an example of it in action:
t-shirtforums.com/store/anniversary-t-shirts/trumpeter-2007-winning-design-t-shirt-forums-t-shirt-design-contest-extravanganza/prod_2.html
Re: Adding Amazon.com Universal Wish List Button
Where on your site would you like to add it? On each product page?
Re: Adding Amazon.com Universal Wish List Button
If you would like to add it to your product pages, try adding it right below the line:
Code:
<!--eof free ship icon -->
in file tpl_product_info_display.php. You can find that file located on your server at /includes/templates/template_default/templates. Before making changes, you should copy that file to /includes/templates/YOUR_CUSTOM_TEMPLATE_NAME/templates and then only make changes to that file.
I added that code there on my page and here is what it got me. Took only a couple minutes.
WARNING: NOT SAFE FOR WORK, CARTOON GUYS KISSING:
https://store.yaoi911.com/index.php?...&products_id=6
(It will be there for the rest of the day. After that, I might remove the button...)
Re: Adding Amazon.com Universal Wish List Button
Of course, if you really want to do it up right, you can do better than what they did in the example link you referenced. They just have the default set-up that grabs the meta-data from the title bar.
But based on what Amazon.com indicates on this page
http://www.amazon.com/wishlist/vendor-info/ref=cm_wl-vb
you can actually prefill the categories with the Product Name, Product Price and the Main Product Image.
Add this code after the <--eof free ship icon --> comment
Code:
<!--eof free ship icon -->
<script id="AddToAUWLButton" language="JavaScript1.2" type="text/javascript" src="http://www.amazon.com/gp/wishlist/bookmarklet/getbutton.js"> </script>
<span id="AUWLBkPrice" style="display:none"><?php echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); ?></span>
<span id="AUWLBkTitle" style="display:none"><?php echo $products_name; ?></span>
<span id="AUWLBkImage" style="display:none"><?php echo 'https://www.example.com/images/' . $products_image; ?></span>
Change the "https://www.example.com/images/" in the last span to the folder you've uploaded your images to (http://www.queerrepublictees.com/images/ perhaps?) and you are off to the races.
Again, I have my product page configured with this. Still not sure I'm going to keep it, but I'll leave it up for a couple days at least as an example... :D
Re: Adding Amazon.com Universal Wish List Button
WOW!!! Thanks so much for the help!!! :smile: I'm going to look into adding this today. Thanks for showing me the example on your site as well.
Re: Adding Amazon.com Universal Wish List Button
Quote:
Originally Posted by
alexwoolfson
Of course, if you really want to do it up right, you can do better than what they did in the example link you referenced. They just have the default set-up that grabs the meta-data from the title bar.
But based on what Amazon.com indicates on this page
http://www.amazon.com/wishlist/vendor-info/ref=cm_wl-vb
you can actually prefill the categories with the Product Name, Product Price and the Main Product Image.
Add this code after the <--eof free ship icon --> comment
Code:
<!--eof free ship icon -->
<script id="AddToAUWLButton" language="JavaScript1.2" type="text/javascript" src="http://www.amazon.com/gp/wishlist/bookmarklet/getbutton.js"> </script>
<span id="AUWLBkPrice" style="display:none"><?php echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); ?></span>
<span id="AUWLBkTitle" style="display:none"><?php echo $products_name; ?></span>
<span id="AUWLBkImage" style="display:none"><?php echo 'https://www.example.com/images/' . $products_image; ?></span>
Change the "https://www.example.com/images/" in the last span to the folder you've uploaded your images to (
http://www.queerrepublictees.com/images/ perhaps?) and you are off to the races.
Again, I have my product page configured with this. Still not sure I'm going to keep it, but I'll leave it up for a couple days at least as an example... :D
Hey, thanks again! So I got it placed on my product page where I want it. :clap: I did a test by adding a product to my Amazon wishlist. It added to the list fine ... correct image, product name and price showed up correctly ... BUT ... when I click on that item inside my Amazon wishlist it links to queerrepublictees.com/index.php?main_page=product_info and not the specific product page.
What did I do wrong? I tested yours the same way and it works just fine. :dontgetit
Re: Adding Amazon.com Universal Wish List Button
Okay ... I don't know what the hell just happened but now it seems to be working!!!!! :blush:
Re: Adding Amazon.com Universal Wish List Button
Delighted you got this to work. :D
And just for future information, according to Amazon.com you can always customize the links for your products if you need to. In the instructions page I linked to above, follow these instructions:
Quote:
URL
If this is provided, it is preferred as the item link URL when items are linked from Amazon.com back to their originating sites. This is often going to be a better candidate than the page URL in the user's browser, as the page might have been generated by a form POST, or might contain session information that will cause problems, for example. If this parameter is used, it should contain any tracking variables needed by the originating site to track incoming links. This URL, if present, will override any values passed for AUWLBkTPname and AUWLBkTPvalue.
Element ID: AUWLBkURL
Format: string (e.g.
http://www.site.com/dp/1234567.html)
Example: <span id="AUWLBkURL" style="display:none">http://www.site.com/dp/1234567.html?ref=bookmark</span>
As the links worked fine for me "right out of the box", I didn't bother with it. (And, off the top of my head, I'm not sure what I would put there instead.) But good to know for future reference.
Thank you for letting me know it worked.
Alex
P.S. The tagline on the bottom of your site gave me a little chuckle. :wink: