Plugin Directory

Changeset 2770027


Ignore:
Timestamp:
08/13/2022 06:29:25 AM (4 years ago)
Author:
amadercode
Message:
  1. Compatible with the latest 3 major releases of WordPress.
  2. Some functionality improved
Location:
wp-amazon-shop
Files:
337 added
9 edited

Legend:

Unmodified
Added
Removed
  • wp-amazon-shop/trunk/assets/css/admin.css

    r2202856 r2770027  
    10031003}
    10041004
    1005 
     1005.wpas-admin-template-wrapper {
     1006    display: flex;
     1007    flex-wrap: wrap;
     1008}
     1009
     1010.wpas-admin-template-wrapper label {
     1011    display: block;
     1012    flex: 0 0 25%;
     1013    max-width: 25%;
     1014    box-sizing: border-box;
     1015    padding: 15px;
     1016    background-color: #e4e2e2;
     1017    border: 1px solid #f1f1f1;
     1018}
     1019
     1020.wpas-admin-template-wrapper label img {
     1021    max-width: 100%;
     1022    height: auto;
     1023    margin-bottom: 10px;
     1024}
     1025
  • wp-amazon-shop/trunk/assets/css/wpas-style.css

    r2191257 r2770027  
    33    height: auto;
    44}
    5 
     5.wpas-products-wrapper *{
     6    box-sizing: border-box;
     7}
    68/*******************
    79Product Grid
    810***********************/
     11
    912.wpas-products-wrapper {
    1013    display: flex;
     
    1316    margin-left: -15px;
    1417    margin-right: -15px;
     18    min-height: 100px;
    1519}
    1620
    1721.wpas-product-item {
    18     width: 25%;
     22    flex: 0 0 25%;
     23    max-width: 25%;
    1924    padding: 0 15px;
    20     box-sizing: border-box;
    2125    min-width: 170px;
    2226}
     
    2630***********************/
    2731.wpas-ajax-pre-loader-container {
    28     margin: 0 auto;
    29     display: table;
     32   margin: 0 auto;
     33   position: absolute;
     34   width: 100%;
     35   height: 100%;
     36   z-index: 999;
     37   background-color: rgba(0, 0, 0, 0.1);
     38   display: flex;
     39   align-items: center;
     40   justify-content: center;
    3041}
    3142
     
    105116    color: #ffffff;
    106117    box-shadow: 0 0 10px #e0dede !important;
     118    transition: 0.2s;
    107119}
    108120
    109121.wpas-search-form-container button:hover {
    110     background-color: #1e75d4;
     122    background-color: #046ad6;
    111123}
    112124
    113125/*******************
    114 Product List
     126Product List - Template 01
    115127***********************/
    116 .amazon-product-box {
     128.template-1 .amazon-product-box {
    117129    padding: 5px;
    118130    background-color: #fff;
    119131    text-align: center;
    120     border: 1px solid #dad8d8;
    121132    position: relative;
    122133    margin-bottom: 30px;
    123134    transition: 0.2s;
    124 }
    125 
    126 .amazon-product-box:hover {
    127     box-shadow: 0 6px 8px -4px #999999;
    128 }
    129 
    130 .amazon-product-thumb {
    131     position: relative;
    132     width: 100%;
    133     height: 160px;
     135    border-radius: 10px;
     136    border: 1px solid transparent;
     137}
     138
     139.template-1 .amazon-product-box:hover {
     140    box-shadow: 0px 3px 6px #ececec;
     141    border-color: #ececec;
     142}
     143
     144.template-1 .amazon-product-thumb {
     145    position: relative;
     146    width: 100%;
    134147    background-color: #ffffff;
    135 }
    136 
    137 .amazon-product-thumb .amazon-product-prime {
    138     display: block;
    139     background: rgba(255, 255, 255, 0.50) url("../images/amazon-splash.png") no-repeat;
     148    object-fit: contain;
     149}
     150.template-1 .amazon-product-thumb::before {
     151    content: "";
     152    display: block;
     153    padding-top: 100%;
     154}
     155.template-1 .amazon-product-thumb img{
     156    position: absolute;
     157    top: 0;
     158    bottom: 0;
     159    left: 0;
     160    width: 100%;
     161    height: 100%;
     162    border: 0;
     163}
     164
     165.template-1 .amazon-product-thumb .amazon-product-prime {
     166    display: block;
     167    background: rgba(255, 255, 255, 0.50);
    140168    height: 15px;
    141169    width: 54px;
     
    146174}
    147175
    148 .amazon-product-info h3 {
    149     font-size: 16px;
    150     white-space: nowrap;
     176.template-1 .amazon-product-info h3 {
     177    font-size: 18px;
     178    width: 100%;
     179    max-height: 45px;
     180    padding: 5px;
     181    overflow: hidden;
    151182    text-overflow: ellipsis;
    152     width: 100%;
    153     overflow: hidden;
    154     padding: 5px;
    155     box-sizing: border-box;
    156 }
    157 
    158 .amazon-product-brekdown ul {
     183    display: -webkit-box;
     184    -webkit-line-clamp: 2;
     185    -webkit-box-orient: vertical;
     186}
     187
     188.template-1 .amazon-product-brekdown ul {
    159189    margin: 0;
    160190    padding: 0;
    161191}
    162192
    163 .amazon-product-brekdown ul li {
     193.template-1 .amazon-product-brekdown ul li {
    164194    list-style: none;
    165195    display: block;
     
    168198}
    169199
    170 .amazon-product-brekdown {
     200.template-1 .amazon-product-brekdown {
    171201    background-color: #fff;
    172202    display: none;
    173203}
    174204
    175 .amazon-product-action {
     205.template-1 .amazon-product-action {
    176206    display: flex;
    177207    align-items: center;
    178208}
    179209
    180 .amazon-product-action button {
     210.template-1 .amazon-product-action button {
    181211    margin: 3px;
    182212    width: 100%;
     
    191221}
    192222
    193 .amazon-product-action button:hover {
    194     background-color: #494949;
    195 }
    196 
     223.template-1 .amazon-product-action button:hover {
     224    background-color: #139c00;
     225}
     226.template-1 .amazon-product-rating a{
     227    text-decoration: none !important;
     228    color: inherit;
     229}
     230/*******************
     231Product List - Template 02
     232***********************/
     233.template-2 .amazon-product-box {
     234    background-color: #fff;
     235    position: relative;
     236    margin-bottom: 30px;
     237    transition: 0.2s;
     238    border-radius: 4px;
     239    border: 1px solid #ececec;
     240    overflow: hidden;
     241}
     242
     243.template-2 .amazon-product-box:hover {
     244   transform: translateY(-10px);
     245}
     246
     247.template-2 .amazon-product-thumb {
     248    position: relative;
     249    width: 100%;
     250    background-color: #ffffff;
     251    object-fit: contain;
     252}
     253.template-2 .amazon-product-thumb::before {
     254    content: "";
     255    display: block;
     256    padding-top: 100%;
     257}
     258.template-2 .amazon-product-thumb img{
     259    position: absolute;
     260    top: 0;
     261    bottom: 0;
     262    left: 0;
     263    width: 100%;
     264    height: 100%;
     265    border: 0;
     266}
     267
     268.template-2 .amazon-product-thumb .amazon-product-prime {
     269    display: block;
     270    background: rgba(255, 255, 255, 0.50);
     271    height: 15px;
     272    width: 54px;
     273    background-position: -5px -490px;
     274    position: absolute;
     275    right: 0;
     276    top: 10px;
     277}
     278.template-2 .amazon-product-info{
     279    padding: 10px 20px;
     280}
     281.template-2 .amazon-product-info h3 {
     282    font-size: 18px;
     283    width: 100%;
     284    max-height: 45px;
     285    overflow: hidden;
     286    text-overflow: ellipsis;
     287    display: -webkit-box;
     288    -webkit-line-clamp: 2;
     289    -webkit-box-orient: vertical;
     290}
     291
     292.template-2 .amazon-product-brekdown ul {
     293    margin: 0;
     294    padding: 0;
     295}
     296
     297.template-2 .amazon-product-brekdown ul li {
     298    list-style: none;
     299    display: block;
     300    text-align: left;
     301    padding: 5px;
     302}
     303
     304.template-2 .amazon-product-brekdown {
     305    background-color: #fff;
     306    display: none;
     307}
     308
     309.template-2 .amazon-product-action {
     310    position: absolute;
     311    right: -100px;
     312    bottom: 10px;
     313    transition: 0.2s;
     314 
     315}
     316
     317.template-2 .amazon-product-action button {
     318    padding: 0;
     319    border: none;
     320    background: none;
     321
     322}
     323.template-2 .amazon-product-action button span.wpas-btn-icon{
     324    height: 45px;
     325    width: 45px;
     326    display: block;
     327    border-radius: 100%;
     328    cursor: pointer;
     329    transition: 0.2s;
     330    background: #48a93b;
     331    padding: 10px;
     332    fill: #fff;
     333}
     334.template-2 .amazon-product-action button span.wpas-btn-text{
     335    position: absolute;
     336    transition: 0.2s;
     337    background: #48a93b;
     338    color: #fff;
     339    padding: 5px 10px;
     340    line-height: 1;
     341    border-radius: 3px;
     342    box-shadow: 0 0 10px #77a464;
     343    transform: translateX(-50%) scale(0);
     344    font-size: 14px;
     345    visibility: hidden;
     346}
     347.template-2 .amazon-product-action button span.wpas-btn-text::before{
     348    content: "";
     349    display: block;
     350    width: 1px;
     351    border-top: 8px solid #48a93b;
     352    border-left: 5px solid transparent;
     353    border-right: 5px solid transparent;
     354    position: absolute;
     355    left: calc(50% - 5px);
     356    bottom: -7px;
     357}
     358.template-2 .amazon-product-box:hover .amazon-product-action{
     359    right: 20px;
     360    transform: rotate(360deg);
     361}
     362.template-2 .amazon-product-action button:hover span.wpas-btn-text{
     363    visibility: visible;
     364    transform: translate(-50%, -40px) scale(1);
     365    transition-delay: 0.5s;
     366}
     367.template-2 .amazon-product-rating{
     368    display: flex;
     369    align-items: center;
     370}
     371.template-2 .amazon-product-rating>div:last-child{
     372    margin-left: 10px;
     373}
     374.template-2 .amazon-product-rating a{
     375    text-decoration: none !important;
     376    color: #6a6a6a;
     377    font-size: 80%;
     378    line-height: 100%;
     379
     380}
    197381/***********************
    198382Load More button
     
    205389    margin: 3px;
    206390    width: 200px;
    207     border: 1px solid #fa911a;
    208     background-color: #fa911a;
     391    border: 1px solid #218df7;
     392    background-color: #218df7;
    209393    padding: 10px;
    210394    cursor: pointer;
     
    216400.wpas-load-more-loader .wpas-load-more-wrapper button span {
    217401    paddding-left: 5px;
     402}
     403.wpas-load-more-wrapper button:hover{
     404    border: 1px solid #046ad6;
     405    background-color: #046ad6;
    218406}
    219407
     
    531719    opacity: 0
    532720}
    533 
     721.a-icon-star{
     722    background-position: -256px -426px
     723}
    534724.a-star-5 {
    535725    background-position: -5px -368px
     
    582772    width: 100%;
    583773    border: 1px solid #eee;
     774    position: relative;
     775    min-height: 100px;
    584776}
    585777
  • wp-amazon-shop/trunk/includes/wp-amazon-shop-admin-api.php

    r1981218 r2770027  
    9898                $html .= '<textarea id="' . esc_attr( $field['id'] ) . '" rows="5" cols="50" name="' . esc_attr( $option_name ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '">' . $data . '</textarea><br/>'. "\n";
    9999            break;
    100 
     100            case 'template':
     101                $html .= '<div class="wpas-admin-template-wrapper">';
     102                foreach ( $field['options'] as $k => $v ) {
     103                    $checked = false;
     104                    if ( $k == $data ) {
     105                        $checked = true;
     106                    }
     107                    if($k=='1'||$k=='2'){
     108                        $temp_plugin_base=ACL_WPAS_URL;
     109                    }else{
     110                        $temp_plugin_base=ACL_WPAS_URL;
     111                    }
     112                    if($k!=""){
     113                        $html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '">';
     114                        $html .= '<img src="'.$temp_plugin_base.'assets/images/template'.$k.'.jpg" alt="'.$v.'">';
     115                        $html .= '<input type="radio" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" /><span>'.$v.'</span> </label> ';
     116                    }
     117                }
     118                $html .= '</div>';
     119            break;
    101120            case 'checkbox':
    102121                $checked = '';
  • wp-amazon-shop/trunk/includes/wp-amazon-shop-functions.php

    r2404692 r2770027  
    99    function wpas_search_form()
    1010    {
     11
     12        $template=get_option('acl_wpas_templates');
    1113        ob_start();
    1214        ?>
     
    2022                        class="wpas-search-btn"><?php _e('Search', 'wp-amazon-shop') ?></button>
    2123            </div>
    22             <div class="wpas-products-wrapper"></div>
     24            <div class="wpas-products-wrapper" <?php echo "template-".$template?>"></div>
    2325            <div class="wpas-load-more-wrapper" style="display: none">
    2426                <button id="wpas-load-more-btn" class="wpas-load-more-btn" data-keyword="" data-page-num=""><?php _e('Load More', 'wp-amazon-shop') ?> <span id="wpas-load-more-loader"></span></button>
     
    5254            $type='keyword';
    5355        }
     56        $template=get_option('acl_wpas_templates');
    5457       ob_start();
     58       
    5559        ?>
    56         <div class="wp-amazon-shop-auto-link-shortcode-wrapper">
     60        <div class="wp-amazon-shop-auto-link-shortcode-wrapper <?php echo "template-".$template?>">
    5761            <div class="row wpas-products-wrapper">
    5862                <div class="wp-amazon-shop-products" shortcode-type="<?php echo $type; ?>" asin-keys="<?php echo $key; ?>">
  • wp-amazon-shop/trunk/includes/wp-amazon-shop-handler.php

    r2407364 r2770027  
    201201    {
    202202        $affiliate_tag=get_option('acl_wpas_amazon_associate_tag');
     203        $template=get_option('acl_wpas_templates');
    203204        ob_start();
    204205        foreach ($products as $product) {
     206            if($template==1){ //Template one start
    205207            ?>
    206208            <div class="wpas-product-item">
     
    227229                    <?php if(isset($product['Rating']) && $product['Rating']!=""){
    228230                        if( strpos( $product['Rating'], '.0' ) !== false) {
    229                             $formatted_rating=str_replace(".0","",$product['Rating']);
     231                            $formatted_rating=str_replace(".0","",ceil($product['Rating']));
    230232                        }else{
    231                             $formatted_rating=str_replace(".","-",$product['Rating']);
     233                            $formatted_rating=str_replace(".","-",ceil($product['Rating']));
    232234                        }
    233235
     
    243245            </div>
    244246            <?php
     247            }
     248            if($template==2){  //Template two start
     249                ?>
     250                <div class="wpas-product-item">
     251                    <div class="amazon-product-box">
     252
     253                        <div class="amazon-product-thumb">
     254                            <?php if(isset($product['IsPrimeEligible']) && $product['IsPrimeEligible']=='1'){?>
     255                            <span class="amazon-product-prime"></span>
     256                            <?php } ?>
     257                            <img src="<?php echo $product['ImageUrl']; ?>" alt="Product">
     258                        </div>
     259                        <!-- amazon-product-thumb            -->
     260                        <div class="amazon-product-info">
     261                            <h3 title="<?php echo str_replace("\'", "", $product['Title']); ?>"><?php echo str_replace("\'", "", $product['Title']); ?> </h3>
     262                                <p><?php _e('Price', 'wp-amazon-shop') ?> : <?php echo $product['Price']; ?> </p>
     263
     264                                <?php if(isset($product['Rating']) && $product['Rating']!=""){
     265                            if( strpos( $product['Rating'], '.0' ) !== false) {
     266                                $formatted_rating=str_replace(".0","", ceil($product['Rating']));
     267                            }else{
     268                                $formatted_rating=str_replace(".","-", ceil($product['Rating']));
     269                            }
     270
     271                            $rating_class="a-star-". $formatted_rating;
     272                            ?>
     273                        <div class="amazon-product-rating" data-product-asin="<?php echo $product['ASIN']; ?>">
     274                            <div><i class="a-icon a-icon-star <?php echo  $rating_class?>"><span class="a-icon-alt"><?php echo $product['Rating']; ?> out of 5 stars</span></i></div>
     275                            <div><a href="<?php echo $product['DetailPageURL']; ?>?tag=<?php echo $affiliate_tag;  ?>#dp-summary-see-all-reviews" target="_blank">(<?php echo $product['TotalReviews'] ;?>)</a></div>
     276                        </div>
     277                        <?php } ?>
     278                        </div>
     279                        <!-- amazon-product-info -->
     280                        <div class="amazon-product-action">
     281                            <button class="wpas-add-to-cart" type="button"
     282                                    wpas-sku="<?php echo $product['ASIN']; ?>"
     283                                    wpas-url="<?php echo $this->build_action_url($product['ASIN'],$product['DetailPageURL']); ?>">
     284                                    <span class="wpas-btn-text"><?php echo (get_option('acl_wpas_buy_now_label')? get_option('acl_wpas_buy_now_label') : "Buy Now");  ?> </span>
     285                                    <span class="wpas-btn-icon">
     286                                       
     287                                    <svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:none;}</style></defs><title/><g data-name="Layer 2" id="Layer_2"><path d="M23.52,29h-15a5.48,5.48,0,0,1-5.31-6.83L6.25,9.76a1,1,0,0,1,1-.76H24a1,1,0,0,1,1,.7l3.78,12.16a5.49,5.49,0,0,1-.83,4.91A5.41,5.41,0,0,1,23.52,29ZM8,11,5.11,22.65A3.5,3.5,0,0,0,8.48,27h15a3.44,3.44,0,0,0,2.79-1.42,3.5,3.5,0,0,0,.53-3.13L23.28,11Z"/><path d="M20,17a1,1,0,0,1-1-1V8a3,3,0,0,0-6,0v8a1,1,0,0,1-2,0V8A5,5,0,0,1,21,8v8A1,1,0,0,1,20,17Z"/></g><g id="frame"><rect class="cls-1" height="32" width="32"/></g></svg>
     288                                    </span>
     289                                   
     290                            </button>
     291                         
     292
     293                        </div>
     294                       
     295                    </div>
     296                    <!-- amazon-product-box -->
     297                </div>
     298                <?php
     299            }
    245300        }
    246301        $content = ob_get_clean();
  • wp-amazon-shop/trunk/includes/wp-amazon-shop-info-page.php

    r2404692 r2770027  
    7979                            <p><?php _e('Just copy and paste this shortcode where you want to display amazon product by Amazon Product ASIN or Keywords parameter','wp-amazon-shop');?> .</p>
    8080                            <p><?php _e('Example of Multiple ASINs','wp-amazon-shop');?>  : [wpas_products ASIN="B077SXWSRP,B07CT3W44K"]</p>
    81                             <p><?php _e('Example of single ASIN','wp-amazon-shop');?>  : [wpas_products ASIN=B077SXWSRP]</p>
    82                             <p><?php _e('Example of Keywords','wp-amazon-shop');?>  : [wpas_products keywords="Kids & Baby Fashion"]</p>
    83                             <p><?php _e('Example of Product Comparison Table','wp-amazon-shop');?>  : [wpas_products_comparison ASIN=”B077SXWSRP,B07CT3W44K”]</p>
     81                            <p><?php _e('Example of Single ASIN','wp-amazon-shop');?>  : [wpas_products ASIN="B077SXWSRP"]</p>
     82                            <p><?php _e('Example of Keywords','wp-amazon-shop');?>  : [wpas_products keywords="Alexa"]</p>
     83                            <p><?php _e('Example of Product Comparison Table','wp-amazon-shop');?>  : [wpas_products_comparison ASIN="B077SXWSRP,B07CT3W44K"]</p>
    8484
    8585                            <h3><?php _e('WP AMAZON SHOP PRO VERSION FEATURES','wp-amazon-shop');?> ( <?php _e('Included Free Version Features','wp-amazon-shop');?>  ) </h3>
  • wp-amazon-shop/trunk/includes/wp-amazon-shop-settings.php

    r2404692 r2770027  
    342342            'fields'                => array(),
    343343        );
     344        $settings['wpas_template'] = array(
     345            'title'                 => __( 'Templates', 'wp-amazon-shop' ),
     346            'description'           => __( 'Select a template to display cart on your WooCommerce store as default', 'wp-amazon-shop' ),
     347            'fields'                => array(
     348                array(
     349                    'id'            => 'templates',
     350                    'label'         => __( 'Cart Templates', 'wp-amazon-shop' ),
     351                    'description'   => __( '', 'wp-amazon-shop' ),
     352                    'type'          => 'template',
     353                    'options'       => array( '1' => 'Template 01', '2' => 'Template 02',),
     354                    'default'       => '1'
     355                ),
     356
     357            ),
     358        );
    344359        $settings['wpas_custom_style'] = array(
    345360            'title'                 => __( 'Custom Style', 'wp-amazon-shop' ),
  • wp-amazon-shop/trunk/readme.txt

    r2575938 r2770027  
    44Tags: amazon, amazon shop,affiliate,amazon affiliate, dropship, amazon dropship,amazon product search, amazon product import,amazon product auto link
    55Requires at least: 4.4
    6 Tested up to: 5.7.2
    7 WC requires at least: 3.0
    8 WC tested up to: 5.4.1
     6Tested up to: 6.0.1
     7WC requires at least: 4.0
     8WC tested up to: 6.7.0
    99Stable tag: 2.1.1
    1010Requires PHP: 5.6.0
     
    349349= 2.0.8=
    350350*Direct redirection to amazon store setting option issue fixed.
     351= 2.1.2=
     352*Implemented two template option to display product blocks.
  • wp-amazon-shop/trunk/wp-amazon-shop.php

    r2575938 r2770027  
    22/*
    33 * Plugin Name: Dropshipping & Affiliation with Amazon
    4  * Version: 2.1.1
     4 * Version: 2.1.2
    55 * Plugin URI: https://www.wpamazonshop.com/
    66 * Description: Search and build products from Amazon store to make easy money by affiliation & dropshipping. No hassle, no coding, no amazon aws keys!.
     
    88 * Author URI: http://www.amadercode.com/
    99 * Requires at least: 4.4
    10  * Tested up to: 5.7.2
     10 * Tested up to: 6.0.1
    1111 * WC requires at least: 3.0
    12  * WC tested up to: 5.4.1
    13  * Stable tag: 2.1.1
     12 * WC tested up to: 6.7.0
     13 * Stable tag: 2.1.2
    1414 * Text Domain: wp-amazon-shop
    1515 * Domain Path: /lang/
     
    2626}
    2727define('ACL_WPAS_IMG_PATH', plugin_dir_url(__FILE__).'assets/images/');
     28if ( ! defined( 'ACL_WPAS_URL' ) ) {
     29    define('ACL_WPAS_URL', plugin_dir_url(__FILE__));
     30}
    2831//Dependency functions.
    2932if(!function_exists('wpas_clean')){
    3033    function wpas_clean($var){
    3134        if ( is_array( $var ) ) {
    32             return array_map( 'wpas_clean', $var );
     35            return array_map( 'wpas_clean', $var ); 
    3336        } else {
    3437            return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
Note: See TracChangeset for help on using the changeset viewer.