Plugin: Woocommerce Drop Price Plugin Timeframe End Date
-
I got this code for the sale start & end date, So it shows on a product page:
add_action( 'woocommerce_single_product_summary', 'woocommerce_output_sale_end_date', 10 ); function woocommerce_output_sale_end_date() { $sale_end_date = get_post_meta( get_the_ID(), '_sale_price_dates_to', true ); if ( ! empty( $sale_end_date ) ) echo '<span id="sale-price-to-date">' . __( 'Sale End Date: ', 'woocommerce' ) . date( 'Y-m-d', $sale_end_date ) . '</span>'; }
Somehow I need to ad this code, so it picks up the drop price timeframe from the drop price plugin for woocommerce instead of the sale end date:
$drop_price_dates_from = ( $date = get_post_meta( $post->ID, '_drop_price_dates_from', true ) ) ? $date : ''; $drop_price_dates_to = ( $date = get_post_meta( $post->ID, '_drop_price_dates_to', true ) ) ? $date : '';
I got this code to show the drop price timer on the homepage, but I want it to show the drop price timeframe. Any solution?
add_action( 'woocommerce_after_shop_loop_item_title', 'wpgenie_show_counter_on_loop',50 ); function wpgenie_show_counter_on_loop(){ global $product; if(!isset ($product)) return; if (isset($product->drop_price_counter) && ($product->drop_price_counter == 'yes') && isset($product->drop_price_next_drop) && $product->drop_price_next_drop){ echo '<div class="drop-price-counter">'; echo '<div class="drop-price-time" id="countdown"> <div class="drop-price-countdown" data-time="'.$product->drop_price_next_drop.'" data-productid="'.$product->id.'" ></div> </div>'; echo "</div>"; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Plugin: Woocommerce Drop Price Plugin Timeframe End Date’ is closed to new replies.