Changeset 2298276
- Timestamp:
- 05/05/2020 08:01:12 AM (4 years ago)
- Location:
- woo-stock-count-progress-bar/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
woo-stock-count-progress-bar/trunk/readme.txt
r2190286 r2298276 1 1 === Stock Status Bar for Woocommerce === 2 Contributors: mehedi_csit, raihan143 3 Tags: woocommerce-progress-bar, stock,woocommerce,woocommerce-stock,stock-status,stock-status-in-prorgess-bar 2 Contributors: mehedi_csit 3 Tags:woocommerce-progress-bar,woocommerce,woocommerce-stock,stock-status,stock-status-in-prorgess-bar 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ANJRBFTXBUE8Q&source=url 4 5 Requires at least: 4.2 5 Tested up to: 5. 2.46 Requires PHP: 5. 46 Tested up to: 5. 7 Requires PHP: 5. 7 8 Stable tag: 1.0.0 8 9 License: GPL-2.0+ -
woo-stock-count-progress-bar/trunk/wpbs-stock-status-bar.php
r2190277 r2298276 3 3 Plugin Name: Stock Status Bar for Woocommerce 4 4 Description: This plugin will help you to display the woocommerce product stock quantity in a horizontal progress bar. 5 Plugin URI: https:// www.code4webs.com6 Version: 1. 0.07 Author: code4webs8 Author URI: https:// www.facebook.com/mehedicsit5 Plugin URI: https:// 6 Version: 1..0 7 Author: 8 Author URI: https:// 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 18 18 19 19 // enqueue scripts 20 function wpbsc_scripts_register() {20 function wpbsc_scripts_register(){ 21 21 22 22 wp_enqueue_style( 'wpbsc_custom_css', plugins_url('scripts/wpbs-style.css', __FILE__) ); 23 wp_enqueue_script( 'wpbsc_jqmeter', plugins_url('scripts/jqmeter.min.js', __FILE__), array('jquery'), null,true);24 wp_enqueue_script( 'wpbsc_custom_script', plugins_url('scripts/custom.js', __FILE__), array('jquery'), null,true);23 wp_enqueue_script( 'wpbsc_jqmeter', plugins_url('scripts/jqmeter.min.js', __FILE__), array('jquery'),); 24 wp_enqueue_script( 'wpbsc_custom_script', plugins_url('scripts/custom.js', __FILE__), array('jquery'),); 25 25 26 26 } … … 30 30 * Check if WooCommerce is active 31 31 **/ 32 if ( in_array( 'woocommerce/woocommerce.php', apply_filters('active_plugins', get_option( 'active_plugins' ) ) ) ) {32 if ( in_array('active_plugins', get_option( 'active_plugins' ) ) ) ) { 33 33 // Put your plugin code here 34 add_action( 34 add_action('woocommerce_before_add_to_cart_form', 'wpbsc_show_stock_shop', 10 ); 35 35 36 36 function wpbsc_show_stock_shop() { … … 38 38 global $post; 39 39 $manage_stock = get_post_meta( $post->ID, '_manage_stock', true ); 40 if( is_product() && $product->is_type( 'simple' ) && $manage_stock == 'yes'){40 if({ 41 41 42 42 $stock = get_post_meta( $post->ID, '_stock', true ); … … 56 56 } 57 57 }else{ 58 add_action('admin_notices', function() {58 add_action('admin_notices', function(){ 59 59 echo '<div class="notice notice-error"><p>'.esc_html__('Stock Status Bar For Woocommerce requires WooCommerce to be installed and active. You can download', 'wpbsc').' <a href="https://woocommerce.com/" target="_blank">WooCommerce</a> '.esc_html__('here.','wpbsc').'</p></div>'; 60 60 });
Note: See TracChangeset
for help on using the changeset viewer.