Changeset 2001577
- Timestamp:
- 12/26/2018 08:18:07 AM (7 years ago)
- Location:
- helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk
- Files:
-
- 2 edited
-
main-cart-visibility.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk/main-cart-visibility.php
r1996198 r2001577 7 7 * Author: heliossolutions 8 8 * Author URI: http://heliossolutions.in/ 9 * Version: 2.0. 39 * Version: 2.0.4 10 10 * Compatible with woo commerce: 3.5.2 11 11 * … … 109 109 } 110 110 111 function hshidecart_activate_filter() {111 public static function hshidecart_activate_filter() { 112 112 $pice_option = get_option('wc_settings_tab_visibility_title'); 113 113 add_filter('woocommerce_get_price_html', __CLASS__ . '::hshidecart_show_price_logged'); 114 114 } 115 115 116 function hshidecart_show_price_logged($price) {116 public static function hshidecart_show_price_logged($price) { 117 117 $pice_option = get_option('wc_settings_tab_visibility_title'); 118 118 $disable_product_price = get_option('wc_settings_tab_product_price_disable_product'); … … 265 265 function hshidecart_add_custom_field_into_loop() { 266 266 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'); 270 271 //Start time str 271 272 $start_dt = new DateTime($start_datetime); … … 287 288 ?> 288 289 <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} 290 291 </style> 291 292 <?php … … 294 295 } 295 296 296 add_action('woocommerce_single_product_summary', 'hshidecart_add_custom_field_into_single', 31 );297 298 function hshidecart_add_custom_field_into_single( ) {297 add_action('woocommerce_single_product_summary', 'hshidecart_add_custom_field_into_single', 31,1); 298 299 function hshidecart_add_custom_field_into_single($product_id) { 299 300 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'); 303 305 //Start time str 304 306 $start_dt = new DateTime($start_datetime); … … 317 319 ?> 318 320 <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} 320 322 </style> 321 323 <?php -
helios-solutions-woocommerce-hide-price-and-add-to-cart-button/trunk/readme.txt
r1996202 r2001577 6 6 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 7 Tested up to: 5.0.1 8 Stable tag: 2.0. 38 Stable tag: 2.0.4 9 9 Compatible with woo commerce: 3.5.2 10 10 … … 48 48 49 49 == Changelog == 50 51 = 2.0.4 = 52 53 * Bug fixes 54 50 55 = 2.0.3 = 51 56 * Compatibility with Wordpress version 5.0.1 and Woocommerce version 3.5.2
Note: See TracChangeset
for help on using the changeset viewer.