• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » Wordpress » Boost your Earning with Amazon Custom Thumbnail Plugin

Boost your Earning with Amazon Custom Thumbnail Plugin

By Sigit Prasetya Nugroho ∙ September 1, 2014 ∙ Wordpress ∙ 2 Comments

Share : TwitterFacebookTelegramWhatsapp

Free Amazon Custom Thumbnail PluginTo make your amazon website be an attractive, and increase your earnings, I will share plugin and tips to create amazon custom thumbnail plugin. For you that use free wordpress theme for selling amazon’s products, Amazon custom thumbnail can be your first choice to build a your amazon wordpress site.

Table of Contents

  • 1  Features that we get when using amazon custom thumbnail plugin. 
    • 1.1  Okay, time for us to review step by step how to create amazon custom thumbnail plugin. 

 Features that we get when using amazon custom thumbnail plugin. 

  • Display the rating of products.
  • Display the List price with strike tag.
  • Display the price of products.
  • Displays the percentage discounts.
  • Display detail products button (will link at amazon site with your amazon associate tag )
  • Display Add to cart button ( will link to the amazon site add cart form).

 Okay, time for us to review step by step how to create amazon custom thumbnail plugin. 

If previously I have made asin grabber plugin, this is my second plugin. I more satisfied using my own plugin rather than buying a plugin with an expensive price. Besides being able modified to suit our taste, can also add to our knowledge about wordpress plugin and we can sell it.

For build this amazon custom thumbnail plugin, i choose DW WallPress as theme. Maybe you can choose the other free wordpress themes for wallpaper’s site.

  • Create new folder as act_amazon_custom_thumbnail.
  • Create php file as act_amazon_custom_thumbnail.php
  • Write this script at act_amazon_custom_thumbnail.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/*
Plugin Name: Amazon Custom Thumbnail
Plugin URI: n/a
Description: Create an attractive thumbnail display for your amazon affiliate sites.
Version: 1.0 .
Author: Sigit Prasetya Nugroho.
Author URI: https://seegatesite.com
 
License: GPL2
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
*/
add_filter('post_thumbnail_html','act_amazon_custom_thumbnail',10);
function act_amazon_custom_thumbnail( $html ) {
        global $post;
$html ='</a><div>';
if(!is_single() && !is_attachment() )
{
$name = get_post_meta($post->ID, 'azon_image', true);
$rating = get_post_meta($post->ID, 'azon_rating', true);
$price = get_post_meta($post->ID, 'azon_price', true);
$list_price = get_post_meta($post->ID, 'azon_listprice', true);
$url = get_post_meta($post->ID, 'azon_url', true);
$cart = get_post_meta($post->ID, 'azon_cart', true);
$titles=get_the_title();
if( $name )
{
$html .= '<div align="center"><img src="'. esc_url( $name ).'" title="'.$titles.'" alt="'.$titles.'" ></div>';
}
if( $rating )
{
$html .= '<div align="center"><img src="' . plugins_url( 'act_amazon_custom_thumbnail/images/'.$rating.'.gif', dirname(__FILE__) ) . '"  style="width:70px;float:left" alt="'.$titles.' product rating" /></div><br />
<hr/>';
}
$html .='<div style="margin-bottom:5px;">';
if( $list_price )
{
$html .= '<div align="left" style="font-family: Arial, Helvetica, sans-serif;
font-size:12px;"><label>List Price : $</label><label style="color:grey;"><s> '.number_format($list_price).'</s></label></div>';
}
if( $price )
{
$html .= '<div align="left" style="font-family: Arial, Helvetica, sans-serif;
font-size:12px;"><label><b>Price :</label><label style="font-size:14px;color:red;"> $ '.number_format($price).'</b></label></div>';
}
if( $list_price && $price )
{
if ($list_price > $price)
{
$save_point= ($list_price - $price);
$save_prcn= (($list_price - $price)*100)/$list_price;
$html .= '<div align="left" style="font-family: Arial, Helvetica, sans-serif;
font-size:12px;"><label>You Save :</label><label style="font-size:12px;color:red;"> $ '.number_format($save_point).' ('.number_format($save_prcn).'%)</label></div>';
}
}
$html .='</div>';
if( $url )
{
$html .= '<a style="cursor: pointer; text-decoration: none;" href="'.$url.'" target="_blank"  rel="nofollow" title="Add to cart"><img src="' . plugins_url( 'act_amazon_custom_thumbnail/images/buy_now.png', dirname(__FILE__) ) . '"  style="height: 22px;width: auto;float:left" alt="'.$titles.' check price and available at amazon site" title="'.$titles.' check price and available at amazon site" /></a>';
}
if( $cart )
{
$html .= '<a style="cursor: pointer; text-decoration: none;" href="'.$cart.'" target="_blank"  rel="nofollow" title="Add to cart"><img src="' . plugins_url( 'act_amazon_custom_thumbnail/images/add_cart.png', dirname(__FILE__) ) . '"  style="height: 22px;width: auto;float:right" alt="add to cart" alt="'.$titles.' add to amazon cart" /></a><br />';
}
}
$html .='</div>';
return $html;
}
add_action( 'publish_post', 'act_add_thumbnail_id' );
add_action( 'save_post', 'act_add_parameter' );
 
function act_add_thumbnail_id($postid) {
    if(!wp_is_post_revision($postid)) {
        $field_name = '_thumbnail_id';
        add_post_meta($postid, $field_name, '-1', true);
    }
}
function act_add_parameter($postid) {
    if(!wp_is_post_revision($postid)) {
        add_post_meta($postid, 'azon_image', '', true);
        add_post_meta($postid, 'azon_price', '', true);
        add_post_meta($postid, 'azon_url', '', true);
        add_post_meta($postid, 'azon_cart', '', true);
add_post_meta($postid, 'azon_listprice', '', true);
add_post_meta($postid, 'azon_rating', '', true);
    }
}
?>

  • Create new folder in the act_amazon_custom_thumbnail folder and give name as  images  .
  • Download image here and paste in folder  images

rating.png

  • Finish and compress your act_amazon_custom_thumbnail folder into  zip format .

I will give a little explanation about the script above :

  • For create WordPress plugin , PHP file must contain a standard Plugin information header. This header lets WordPress recognize that your plugin exists.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
Plugin Name: Amazon Custom Thumbnail
Plugin URI: n/a
Description: Create an attractive thumbnail display for your amazon affiliate sites.
Version: 1.0 .
Author: Sigit Prasetya Nugroho.
Author URI: https://seegatesite.com
 
License: GPL2
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
*/

  • Create add_filter hooks and apply to post_thumbnail_html function ( Output HTML for the post thumbnail meta-box.) and callback act_amazon_custom_thumbnail function when the custom Filter is applied. (read more here for more information).

1
add_filter('post_thumbnail_html','act_amazon_custom_thumbnail',10);

  • Create function act_amazon_custom_thumbnail( $html ). In order to executed the script besides the post page and attachments page, we need statement if(!is_single() && !is_attachment() ). 
  • Create custom field parameter to save your amazon thumbnail data with this syntax below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
add_action( 'publish_post', 'act_add_thumbnail_id' );
add_action( 'save_post', 'act_add_parameter' );
 
function act_add_thumbnail_id($postid) {
if(!wp_is_post_revision($postid)) {
add_post_meta($postid, '_thumbnail_id', '-1', true);
}
}
function act_add_parameter($post) {
if(!wp_is_post_revision($post)) {
add_post_meta($post, 'azon_image', '', true);
add_post_meta($post, 'azon_price', '', true);
add_post_meta($post, 'azon_url', '', true);
add_post_meta($post, 'azon_cart', '', true);
add_post_meta($post, 'azon_listprice', '', true);
add_post_meta($post, 'azon_rating', '', true);
}
}

add_action( ‘publish_post’, ‘act_add_thumbnail_id’ ) ,  Function act_add_thumbnail_id will applied when you publish your post (or click publish).

add_action( ‘save_post’, ‘act_add_parameter’ ), Function act_add_parameter will applied when you create new post (or click add new post).

azon_image : fill this custom field with your image url.
azon_price : fill this custom field with price.
azon_url : fill this custom field with url of amazon product . And don’t forget to include your amazon associate tag.
azon_cart : fill this custom field with url of amazon cart link.
azon_listprice : fill this custom field with listprice before discount.
azon_rating : fill this custom field with rating (give value 1,2,3,4).

For set featured image on your post, we need insert post meta with key “_thumbnail_id”, give the value -1.

1
2
3
4
5
function act_add_thumbnail_id($postid) {
if(!wp_is_post_revision($postid)) {
add_post_meta($postid, '_thumbnail_id', '-1', true);
}
}

After you successfully create custom thumbnail amazon script, here’s how to use the plugin

  • Go to plugins ->add new, upload and then install and active that plugin.

amazon thumbnail plugin

  • Then create new post, active your custom fields screen.

active custom fields to setting amazon custom thumbnail

  • Fill custom fields below the post box.

amazon custom thumbnail custom fields

 

  • Publish your post, and see the result 🙂

You can modified that script with add as you like. If you need to download my plugin , download plugin below , Please share my article before you download it 🙂  [sociallocker id=”58″] DOWNLOAD [/sociallocker] .

If you have trouble, find some bug, or get idea for this amazon custom thumbnail plugin, please give me comment bellow 🙂

My Amazon Custom Thumbnail Plugin New Version Launch, read here 🙂

Related Articles :

  • How to Create Autocomplete Amazon Keyword Suggestion With Jquery
  • Easy Get XML Amazon API Data with My Amazon_Class
  • Easy Get ASIN with My Amazon Asin Grabber Class

Another WordPress Related Post :

  • How To Create The Fastest Social Share Button WordPress Without Plugin
  • Create WordPress Slider Without Javascript
  • The Point Responsive WordPress Theme For Blogging
  • The Doctors Free WordPress Responsive Theme For Medical
  • Develop Your Site With Start Blogging The Responsive WordPress Theme
  • Zerius Theme The Free WordPress Responsive Theme

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Comments

  1. Avatar for Cheap Zentai SuitCheap Zentai Suit says

    October 1, 2014 at 7:46 am

    These are actually enormous ideas in regarding blogging.

    You have touched some fastidious points here. Any way keep up wrinting.

    Reply
    • Avatar for Sigit Prasetya NugrohoSigit Prasetya Nugroho says

      October 3, 2014 at 4:23 pm

      thank you 🙂

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) lumen api (4) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (8) Publisher Tips (5) react (6) Reactjs (9) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2022 Seegatesite.com