Plugin Directory

Changeset 2636674


Ignore:
Timestamp:
11/29/2021 06:42:55 AM (4 years ago)
Author:
codeastrology
Message:

Feature update

Location:
woo-product-table
Files:
198 added
6 edited

Legend:

Unmodified
Added
Removed
  • woo-product-table/trunk/admin/admin-enqueue.php

    r2636219 r2636674  
    5555         * is not installed.
    5656         */
    57         if( ! defined( 'WPT_PRO_DEV_VERSION' ) ){
     57        //if( ! defined( 'WPT_PRO_DEV_VERSION' ) ){
    5858            wp_enqueue_style( 'wpt-offer-css', WPT_Product_Table::getPath( 'BASE_URL' ) . 'admin/notice/offeres/offer.css', array(), WPT_DEV_VERSION, 'all' );
    5959            wp_enqueue_script( 'wpt-offer-js', WPT_Product_Table::getPath( 'BASE_URL' ) . 'admin/notice/offeres/offer.js', array( 'jquery' ), WPT_DEV_VERSION, true );
    60         }
     60        //}
    6161    }
    6262}
     
    7373        $ajax_url = admin_url( 'admin-ajax.php' );
    7474        $version = class_exists( 'WOO_Product_Table' ) && WOO_Product_Table::getVersion() ? __( 'WTP Pro: ', 'wpt_pro' ) . WOO_Product_Table::getVersion() : WPT_Product_Table::getVersion();
     75        $is_pro = class_exists( 'WOO_Product_Table' ) ? 'yes' : 'no';
    7576        $WPT_DATA = array(
    7677           'ajaxurl' => $ajax_url,
     
    8182           'priceFormat' => wpt_price_formatter(),
    8283           'version' => $version,
     84            'is_pro' => $is_pro,
     85
    8386           );
    8487        $WPT_DATA = apply_filters( 'wpto_localize_data', $WPT_DATA );
  • woo-product-table/trunk/admin/notice/offeres/offer.js

    r2636425 r2636674  
    66        }
    77
    8         let wrapper_class = '.wpt-special-offer';
     8       
     9       
    910        loadOfferContent();
    1011
    1112        $(document.body).on('click','h1.wp-heading-inline',function(){
     13            console.log("Trigger for new json");
    1214            loadContentByAjax();
    1315        });
     
    1820               
    1921                offer_json = JSON.parse(offer_json);
    20                 jsonToHtmlMarkup(offer_json);
     22                jsonOfferToHtmlMarkup(offer_json);
     23                jsonNoticeToHtmlMarkup(offer_json)
    2124
    2225            }else if(navigator.onLine){
     
    3538                    if(result && result !== ''){
    3639                        setCookie('wpt_offer_latest',JSON.stringify(result),2);//For Two days
    37                         jsonToHtmlMarkup(result);
     40                        jsonOfferToHtmlMarkup(result);
     41                       
     42                        jsonNoticeToHtmlMarkup(result);
    3843                    }
    3944                   
     
    4449            });
    4550        }
     51        function jsonNoticeToHtmlMarkup(result){
    4652
    47         function jsonToHtmlMarkup(result){
    48             if(! result.offer.status){
     53            if( ! result.hasOwnProperty('notice') ){
    4954                return;
    5055            }
    51             let offer = result.offer,
    52             target_function = offer.target_function,
     56
     57            if(! result.notice.status ){
     58                return;
     59            }
     60            let notice = result.notice;
     61           
     62            jsonToHtml(notice, 'notice-wrapper');
     63
     64        }
     65        function jsonOfferToHtmlMarkup(result){
     66           
     67            if( ! result.hasOwnProperty('offer') ){
     68                return;
     69            }
     70
     71            if( typeof WPT_DATA_ADMIN.is_pro === 'string' && WPT_DATA_ADMIN.is_pro === 'yes' ){
     72                return;
     73            }
     74            if(! result.offer.status ){
     75                return;
     76            }
     77            let offer = result.offer;
     78            jsonToHtml(offer, 'offer-wrapper');
     79
     80        }
     81
     82        function jsonToHtml(offer,custom_wrapper_class){
     83           
     84            let target_function = offer.target_function,
    5385            image_url = offer.image_url,
    5486            target_link = offer.target_link,
     
    5688            wrapper_css = offer.wrapper_css,
    5789            image_css = offer.image_css;
     90
     91            let wrapper_class = '.wpt-unique-' + custom_wrapper_class;
    5892           
    5993
    6094            let location_selector = offer.display_wrapper + " " + offer.display_to;
    61 
     95           
    6296            $(wrapper_class).remove();
    6397
     
    73107            }
    74108
    75             let html = `<div class="wpt-special-offer">` + image_link_html + target_html + `</div>`;
     109            let html = `<div class="wpt-special-offer wpt-unique-` + custom_wrapper_class + `">` + image_link_html + target_html + `</div>`;
    76110           
    77111            if( !target_function ){
     
    79113            }
    80114
     115           
    81116            if( target_function === 'prepend' ){
    82117                $(location_selector).prepend(html);
  • woo-product-table/trunk/admin/notice/offeres/offer.json

    r2636425 r2636674  
    1616            "width":"auto"
    1717        }
     18    },
     19    "notice": {
     20        "status": false,
     21        "target_function": "append",
     22        "target_link": "https://codecanyon.net/item/woo-product-table-pro/20676867",
     23        "image_url": "https://raw.githubusercontent.com/codersaiful/woo-product-table/3.0.4.2/admin/notice/offeres/images/Black-Friday.png",
     24        "display_to": "#wpbody-content",
     25        "display_wrapper": ".wpt_admin_body",
     26        "target_html": false,
     27        "wrapper_css":{
     28            "color":"green",
     29            "background-color":"black"
     30        },
     31        "image_css":{
     32            "height":"150px",
     33            "width":"auto"
     34        }
    1835    }
    1936}
  • woo-product-table/trunk/assets/css/universal.css

    r2636219 r2636674  
    850850    position: relative;
    851851    box-sizing: border-box;
    852     display: table;
     852    display: block;
    853853}
    854854div.wpt_product_table_wrapper.woocommerce:before,div.wpt_product_table_wrapper.woocommerce:after{content: "";height:1px;width:100%;clear:both;}
  • woo-product-table/trunk/readme.txt

    r2636425 r2636674  
    55Requires at least: 4.0.0
    66Tested up to: 5.8.2
    7 Stable tag: 3.0.4
     7Stable tag: 3.0.6
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    211211
    212212== Changelog ==
     213
     214= 3.0.6 =
     215 * Fixed: Fullwidth table issue has been fixed.
    213216
    214217= 3.0.5 =
  • woo-product-table/trunk/woo-product-table.php

    r2636425 r2636674  
    88 * Tags: woocommerce product list,woocommerce product table, wc product table, product grid view, inventory, shop product table
    99 *
    10  * Version: 3.0.5
     10 * Version: 3.0.6
    1111 * Requires at least:    4.0.0
    1212 * Tested up to:         5.8.2
     
    3131
    3232if( !defined( 'WPT_DEV_VERSION' ) ){
    33     define( 'WPT_DEV_VERSION', '3.0.5.0' );
     33    define( 'WPT_DEV_VERSION', '3.0.6.0' );
    3434}
    3535
Note: See TracChangeset for help on using the changeset viewer.