Plugin Directory

Changeset 2792087


Ignore:
Timestamp:
09/29/2022 07:00:13 PM (3 years ago)
Author:
codelizarplugs
Message:

0.2 updt

Location:
product-compare-for-woocommerce/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • product-compare-for-woocommerce/trunk/admin/class-cdlzr-proco-actions.php

    r2606301 r2792087  
    1313            include( CDLZR_PRODUCT_COMPARE_DIR_PATH . 'admin/inc/handler/setting-handler.php' );
    1414        }
     15
     16
     17        public static function cdlzr_proco_admin_print_scripts($hook_suffix){
     18             $screen = get_current_screen();   
     19            //echo $hook_suffix;
     20            //if ( in_array( $hook_suffix, array('admin.php') ) ) {
     21                //var_dump($screen);
     22                $screen = get_current_screen();
     23                wp_enqueue_script( 'jquery' ); //mother js library             
     24                // here 'cdlzr_proco' is cptname
     25                if ( 'toplevel_page_cdlzr_proco' === $screen->base ) {             
     26                   
     27                     wp_enqueue_style( 'cdlzr-proco-bootstrap', CDLZR_PRODUCT_COMPARE_URL . '/assets/css/bootstrap.css'  );               
     28                    wp_enqueue_script('cdlzr-proco-bootstrap-js', CDLZR_PRODUCT_COMPARE_URL . '/assets/js/bootstrap.min.js', array('jquery'), true, true);
     29                   
     30                }
     31            //}
     32        }
    1533    }
    1634}
  • product-compare-for-woocommerce/trunk/admin/class-cdlzr-proco-admin.php

    r2606301 r2792087  
    2424            */
    2525            add_action( 'wp_ajax_save_options_adminside', array( 'CDLZR_Admin_Actions', 'save_options' ) );
     26
     27            add_action( 'admin_enqueue_scripts', array( 'CDLZR_Admin_Actions', 'cdlzr_proco_admin_print_scripts' ) );
    2628        }
    2729    }
  • product-compare-for-woocommerce/trunk/admin/inc/class-cdlzr-dashboard-page.php

    r2606301 r2792087  
    8484                                </div>
    8585                                <div class="form-group col">
    86                                     <label for="proco_c2"><?php _e( 'Show compare button in products archive page', CDLZR_PRODUCT_COMPARE ); ?></label>
     86                                    <label for="proco_c2"><?php _e( 'Show compare button in products shop page', CDLZR_PRODUCT_COMPARE ); ?></label>
    8787                                    <input type="checkbox" name="proco_c2" class="form-control" id="proco_c2" value="1" <?php echo ( $show_button_productlist == 1 ) ? 'checked=checked' : '' ?>>
    8888                                </div>
  • product-compare-for-woocommerce/trunk/product-compare-for-woocommerce.php

    r2606304 r2792087  
    44 * Plugin URI: https://wordpress.org/plugins/
    55 * Description: The plugin give you the ability to compare the products by their category
    6  * Version: 0.1
     6 * Version: 0.2
    77 * Author: Codelizar
    88 * Author URI: https://codelizar.com/
  • product-compare-for-woocommerce/trunk/public/class-cdlzr-proco-addbutton.php

    r2606301 r2792087  
    88if( !class_exists('CDLZR_PROCO_ADDBUTTON')) {
    99    class CDLZR_PROCO_ADDBUTTON {
    10         public static function proco_archive_page_compare_btn_archivePage() {
     10        public static function proco_archive_page_compare_btn_archivePage(){
    1111            global $product;
    1212            $get_saved_option = get_option( 'proco_product_compare' );
     
    4848                                if( isset( $get_saved_option['button_type'] ) && $get_saved_option['button_type'] == 1 ) {
    4949                                    ?>
    50                                     <a href="#" class="product_type_simple add_to_cart_button adcomp-button <?php echo esc_html(self::hide_button($product->get_id())); ?>" id="<?php echo esc_attr($product->get_id()); ?>" data-id="<?php echo esc_attr($product->get_id()); ?>">
     50                                    <a href="#" class="product_type_simple add_to_cart_button adcomp-button <?php //echo self::hide_button($product->get_id()); ?>" id="<?php echo esc_attr($product->get_id()); ?>" data-id="<?php echo esc_attr($product->get_id()); ?>">
    5151                                        <?php echo esc_html($button_text); ?>
    5252                                    </a>
    5353                                    <?php
    5454                                }
    55                                 elseif ( isset( $get_saved_option['button_type'] ) && $get_saved_option['button_type'] == 2 ) {
     55                                elseif ( isset( $get_saved_option['button_type'] ) && $get_saved_option['button_type'] == 2 ) { 
    5656                                    ?>
    57                                     <button type="button" class="button product_type_simple add_to_cart_button adcomp-button <?php echo esc_html(self::hide_button($product->get_id())); ?>" id="<?php echo esc_attr($product->get_id()); ?>" data-id="<?php echo esc_attr($product->get_id()); ?>">
     57                                    <button type="button" class="button product_type_simple add_to_cart_button adcomp-button <?php //echo self::hide_button($product->get_id()); ?>" id="<?php echo esc_attr($product->get_id()); ?>" data-id="<?php echo esc_attr($product->get_id()); ?>">
    5858                                        <?php echo esc_html($button_text); ?>
    5959                                    </button>
  • product-compare-for-woocommerce/trunk/public/class-cdlzr-proco-frontend.php

    r2606301 r2792087  
    2020                wp_enqueue_script( 'datatable_js', CDLZR_PRODUCT_COMPARE_URL . 'assets/datatable/jquery.dataTables.min.js' );
    2121                /* Front ajax load */
    22                 wp_enqueue_script( 'public_js', CDLZR_PRODUCT_COMPARE_URL . 'public/libs/public_js.js', null, null, true );
    23                 wp_localize_script( 'public_js', 'procopublicajax', admin_url( 'admin-post.php' ) );           
     22                //wp_enqueue_script( 'public_js', CDLZR_PRODUCT_COMPARE_URL . 'public/libs/public_js.js', null, null, true );
     23                //wp_localize_script( 'public_js', 'procopublicajax', admin_url( 'admin-post.php' ) );
     24               
     25               
     26                wp_enqueue_script( 'public_js', CDLZR_PRODUCT_COMPARE_URL . 'public/libs/public_js.js' , ['jquery'], '1.2', true );
     27                wp_localize_script( 'public_js', 'procopublicajax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
    2428            }
    2529        }
  • product-compare-for-woocommerce/trunk/public/class-cdlzr-proco-public.php

    r2606301 r2792087  
    2525            * Action for ajax
    2626            */
    27             add_action( 'admin_post_check_upg_prdct_category', array( 'Proco_Frontend_Actions', 'check_product_category' ) );
    28             add_action( 'admin_post_nopriv_check_upg_prdct_category', array( 'Proco_Frontend_Actions', 'check_product_category' ) );
     27            add_action( 'wp_ajax_check_upg_prdct_category', array( 'Proco_Frontend_Actions', 'check_product_category' ) );
     28            add_action( 'wp_ajax_nopriv_check_upg_prdct_category', array( 'Proco_Frontend_Actions', 'check_product_category' ) );
    2929
    3030            /**
     
    3232            */
    3333
    34             add_action( 'admin_post_show_compare_table_popup', array( 'Proco_Frontend_Actions', 'show_product_compare_table' ) );
    35             add_action( 'admin_post_nopriv_show_compare_table_popup', array( 'Proco_Frontend_Actions', 'show_product_compare_table' ) );
     34            add_action( 'wp_ajax_show_compare_table_popup', array( 'Proco_Frontend_Actions', 'show_product_compare_table' ) );
     35            add_action( 'wp_ajax_nopriv_show_compare_table_popup', array( 'Proco_Frontend_Actions', 'show_product_compare_table' ) );
    3636
    3737            /**
    3838            * Action to remove product from compare table
    3939            */
    40             add_action( 'admin_post_remove_product_compare_table', array( 'Proco_Frontend_Actions', 'remove_product_compare_table' ) );
    41             add_action( 'admin_post_nopriv_remove_product_compare_table', array( 'Proco_Frontend_Actions', 'remove_product_compare_table' ) );
     40            add_action( 'wp_ajax_remove_product_compare_table', array( 'Proco_Frontend_Actions', 'remove_product_compare_table' ) );
     41            add_action( 'wp_ajax_nopriv_remove_product_compare_table', array( 'Proco_Frontend_Actions', 'remove_product_compare_table' ) );
    4242
    4343            /*
     
    5151            */
    5252            if( $show_button_productlist == 1 ) {
    53                add_action( 'woocommerce_after_shop_loop_item', array('CLDZR_PROCO_ADDBUTTON','proco_archive_page_compare_btn_archivePage'), 10 );
     53               add_action( 'woocommerce_after_shop_loop_item', array('CDLZR_PROCO_ADDBUTTON','proco_archive_page_compare_btn_archivePage'), 10 );
    5454               add_action( 'woocommerce_after_shop_loop_item', array('CDLZR_PROCO_PUBLIC','show_view'), 10 );
    5555            }
  • product-compare-for-woocommerce/trunk/public/handler/show_compared_products.php

    r2606301 r2792087  
    9999                                        if( count($image) > 0 ) {
    100100                                            for( $i_mage = 0; $i_mage < count($image); $i_mage++ ) {
    101                                                 echo "<td class='col'><a href='' class='remove_product' data-id='".esc_attr($product_id[$i_mage])."'>remove<span class='crossign'>X</span></a>". esc_html($image[$i_mage]) ."</td>";
     101                                                echo "<td class='col'><a href='' class='remove_product' data-id='".esc_attr($product_id[$i_mage])."'><span class='crossign'>X</span></a>". $image[$i_mage] ."</td>";
    102102                                            }
    103103                                        }
     
    210210                                    if( count($regular_price) > 0 ) {
    211211                                        for( $regular_price_counter = 0; $regular_price_counter < count($regular_price); $regular_price_counter++ ) {
    212                                             echo "<td class='col'>". esc_html(wc_price($regular_price[$regular_price_counter])) ."</td>";
     212                                            echo "<td class='col'>". wc_price($regular_price[$regular_price_counter]) ."</td>";
    213213                                        }
    214214                                    }
  • product-compare-for-woocommerce/trunk/public/libs/public_js.js

    r2606301 r2792087  
    99        var request = jQuery.ajax({
    1010            method: 'post',
    11             url: procopublicajax+"?action=check_upg_prdct_category",           
    12             data: 'product_id='+product_id,
    13             action: "check_upg_prdct_category",
     11            url: procopublicajax.ajaxurl,
     12            //url: procopublicajax+"?action=check_upg_prdct_category", 
     13            data:{
     14                action: "check_upg_prdct_category",
     15                product_id: product_id
     16            },     
     17            //data: 'product_id='+product_id,
     18           
    1419            beforeSend: function(){
    1520                // Show image container
     
    3338        jQuery.ajax({
    3439            method: 'get',
    35             url: procopublicajax+"?action=show_compare_table_popup",
     40            url: procopublicajax.ajaxurl,
     41            data:{
     42                action: "show_compare_table_popup"         
     43            }, 
     44            //url: procopublicajax+"?action=show_compare_table_popup",
    3645            success: function( sct_result ) {   
    3746                jQuery('.result').html(sct_result);
     
    4958        jQuery.ajax({
    5059            method: 'post',
    51             url: procopublicajax+"?action=remove_product_compare_table",
    52             data:'productId_remove='+productId_remove,
     60            url: procopublicajax.ajaxurl,
     61            data:{
     62                action: "remove_product_compare_table",
     63                productId_remove: productId_remove
     64            }, 
     65            //url: procopublicajax+"?action=remove_product_compare_table",
     66            //data:'productId_remove='+productId_remove,
    5367            beforeSend: function(){
    5468                // Show image container
     
    6478                jQuery.ajax({
    6579                    method: 'get',
    66                     url: procopublicajax+"?action=show_compare_table_popup",
     80                    url: procopublicajax.ajaxurl,
     81                    data:{
     82                        action: "show_compare_table_popup",
     83                        product_id: productId_remove
     84                    }, 
     85                    //url: procopublicajax+"?action=show_compare_table_popup",
    6786                    beforeSend: function(){
    6887                        // Show image container
  • product-compare-for-woocommerce/trunk/readme.txt

    r2606301 r2792087  
    33Contributors: codelizarplugs
    44Donate link: https://codelizar.com/
    5 Tags: woocommerce, products, e-commerce, product compare, woocommerce product compare, product comparison, woocommerce compare products, woocommerce table compare, woocommerce compare items, add to compare button, compare table, custom compare buttons
     5Tags: woocommerce, products, product compare, product table, list, grid, product comparison, woocommerce compare products, woocommerce table compare, woocommerce compare items, add to compare button, compare table, custom compare buttons
    66Donate link: https://codelizar.com/
    77Requires at least: 4.9
    8 Tested up to: 5.8.1
    9 Stable tag: 0.1
     8Tested up to: 6.0.2
     9Stable tag: 0.2
    1010Requires PHP: 5.2
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1313
    14 The plugin give you the ability to compare the products by their category
     14The plugin give you the ability to compare the WooCommerce products by their category
    1515
    1616== Description ==
     
    2323* Add to cart button in modal - Compare Table
    2424
    25 > #### Demos
    26 >
     25### More Plugins
     26* [Ultimate YouTube/Vimeo Video Player Pro Demo](https://codelizar.com/product/ultimate-youtube-video-player-pro/)
     27* [Accordion Box Pro With WooCommerce Addon](https://codelizar.com/product/accordion-box-pro/)
     28* [Tabs & Pills Pro Demo](https://codelizar.com/elementor-662/)
     29* [Grid Slid Pinterest Feed Pro](https://codelizar.com/product/grid-slid-pinterest-feed-pro/)
     30* [Gallery-Slider & Follow Button For Pinterest Pro](https://codelizar.com/product/grid-slid-pins-pro/)
     31* [Product Table Pro For WooCommerce](https://codelizar.com/product/product-table-pro-for-woocommerce/)
    2732
    2833== Screenshots ==
    29 
    30 
    31 == Upgrade Notice ==
    32 
     34* Selected Proucts List in Compare Table
     35* Pro - Product Table in Shop Page
     36* Pro - Where to diplay Product Table - Settings
     37* Pro - Pagination and Shortcode with other Settings
    3338
    3439== Changelog ==
     
    3641= 0.1 =
    3742* Initial Version
     43
     44= 0.2 =
     45* Shop Page Button Bug fixed
     46* Modal Data Bug Fixed
Note: See TracChangeset for help on using the changeset viewer.