Plugin Directory

Changeset 2001577


Ignore:
Timestamp:
12/26/2018 08:18:07 AM (7 years ago)
Author:
heliossolutions
Message:

Bug fixes
Fix depricated function and notice

Location:
helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk/main-cart-visibility.php

    r1996198 r2001577  
    77 * Author: heliossolutions
    88 * Author URI: http://heliossolutions.in/
    9  * Version: 2.0.3
     9 * Version: 2.0.4
    1010 * Compatible with woo commerce: 3.5.2
    1111 *
     
    109109    }
    110110
    111     function hshidecart_activate_filter() {
     111   public static function hshidecart_activate_filter() {
    112112        $pice_option = get_option('wc_settings_tab_visibility_title');
    113113        add_filter('woocommerce_get_price_html', __CLASS__ . '::hshidecart_show_price_logged');
    114114    }
    115115
    116     function hshidecart_show_price_logged($price) {
     116     public static function hshidecart_show_price_logged($price) {
    117117        $pice_option = get_option('wc_settings_tab_visibility_title');
    118118        $disable_product_price = get_option('wc_settings_tab_product_price_disable_product');
     
    265265function hshidecart_add_custom_field_into_loop() {
    266266    global $product;
    267     $show_hide_option = get_post_meta($product->id, 'woo_disable_add_to_cart_checkbox', 'false');
    268     $start_datetime = get_post_meta($product->id, 'woo_disable_add_to_cart_start_date', 'false');
    269     $end_datetime = get_post_meta($product->id, 'woo_disable_add_to_cart_end_date', 'false');
     267    $product_id = $product->get_id();
     268    $show_hide_option = get_post_meta($product_id, 'woo_disable_add_to_cart_checkbox', 'false');
     269    $start_datetime = get_post_meta($product_id, 'woo_disable_add_to_cart_start_date', 'false');
     270    $end_datetime = get_post_meta($product_id, 'woo_disable_add_to_cart_end_date', 'false');
    270271    //Start time str
    271272    $start_dt = new DateTime($start_datetime);
     
    287288            ?>
    288289            <style>
    289                 ul.products > li.post-<?php echo $product->id; ?> a.button{display:none !important}
     290                ul.products > li.post-<?php echo $product_id; ?> a.button{display:none !important}
    290291            </style>
    291292            <?php
     
    294295}
    295296
    296 add_action('woocommerce_single_product_summary', 'hshidecart_add_custom_field_into_single', 31);
    297 
    298 function hshidecart_add_custom_field_into_single() {
     297add_action('woocommerce_single_product_summary', 'hshidecart_add_custom_field_into_single', 31,1);
     298
     299function hshidecart_add_custom_field_into_single($product_id) {
    299300    global $product;
    300     $show_hide_option = get_post_meta($product->id, 'woo_disable_add_to_cart_checkbox', 'false');
    301     $start_datetime = get_post_meta($product->id, 'woo_disable_add_to_cart_start_date', 'false');
    302     $end_datetime = get_post_meta($product->id, 'woo_disable_add_to_cart_end_date', 'false');
     301    $product_id = $product->get_id();
     302    $show_hide_option = get_post_meta($product_id, 'woo_disable_add_to_cart_checkbox', 'false');
     303    $start_datetime = get_post_meta($product_id, 'woo_disable_add_to_cart_start_date', 'false');
     304    $end_datetime = get_post_meta($product_id, 'woo_disable_add_to_cart_end_date', 'false');
    303305    //Start time str
    304306    $start_dt = new DateTime($start_datetime);
     
    317319            ?>
    318320            <style>
    319                 #product-<?php echo $product->id; ?> div.summary.entry-summary form.cart{display:none !important}
     321                #product-<?php echo $product_id; ?> div.summary.entry-summary form.cart{display:none !important}
    320322            </style>
    321323            <?php
  • helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk/readme.txt

    r1996202 r2001577  
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
    77Tested up to: 5.0.1
    8 Stable tag: 2.0.3
     8Stable tag: 2.0.4
    99Compatible with woo commerce: 3.5.2
    1010
     
    4848
    4949== Changelog ==
     50
     51= 2.0.4 =
     52
     53* Bug fixes
     54
    5055= 2.0.3 =
    5156* Compatibility with Wordpress version 5.0.1 and Woocommerce version  3.5.2
Note: See TracChangeset for help on using the changeset viewer.