Changeset 3489501
- Timestamp:
- 03/24/2026 12:05:00 AM (7 days ago)
- Location:
- coming-soon-for-woocommerce/trunk
- Files:
-
- 2 edited
-
coming-soon-for-woocommerce.php (modified) (11 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coming-soon-for-woocommerce/trunk/coming-soon-for-woocommerce.php
r3483703 r3489501 4 4 * Plugin URI: https://wordpress.org/plugins/coming-soon-for-woocommerce/ 5 5 * Description: Show coming soon badge over products 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Author: wpcentrics 8 8 * Author URI: https://www.wp-centrics.com … … 35 35 defined( 'ABSPATH' ) || exit; 36 36 37 define ('COMING_SOON_WC_VERSION', '1.1. 2' );37 define ('COMING_SOON_WC_VERSION', '1.1.3' ); 38 38 define ('COMING_SOON_WC_PATH', dirname(__FILE__) . '/' ); 39 39 define ('COMING_SOON_WC_URL', plugin_dir_url( __FILE__ ) ); … … 62 62 $this->load_options(); 63 63 64 // Init stuff + comming products let term64 // Init 65 65 add_action( 'init', array ( $this, 'init' ) ); 66 66 … … 122 122 * 123 123 * @since 1.0.0 124 * @version 1. 0.11124 * @version 1.1.3 125 125 */ 126 126 public function load_options() { … … 137 137 138 138 'badge_loop_style' => 'circle-text', 139 'badge_loop_text' => __('COMING SOON', 'coming-soon-for-woocommerce'),139 'badge_loop_text' => 'COMING SOON', 140 140 'badge_loop_opts' => array ( 141 141 'font-size' => '14', … … 160 160 161 161 'badge_product_style' => 'circle-text', 162 'badge_product_text' => __('COMING SOON', 'coming-soon-for-woocommerce'),162 'badge_product_text' => 'COMING SOON', 163 163 'badge_product_opts' => array ( 164 164 'font-size' => '28', // double as loop … … 687 687 * 688 688 * @since 1.0.0 689 * @version 1.1. 1689 * @version 1.1.3 690 690 * 691 691 */ 692 692 function display_coming_soon_loop_wc_open() { 693 693 694 echo wp_kses_post( $this->get_open_badge('loop') ); 694 $open_code = $this->get_open_badge('loop'); 695 if( $open_code && $open_code != '' ) echo wp_kses_post( $open_code ); 695 696 } 696 697 … … 699 700 * 700 701 * @since 1.0.0 701 * @version 1.1. 1702 * @version 1.1.3 702 703 * 703 704 */ 704 705 function display_coming_soon_loop_wc_close() { 705 706 706 echo wp_kses_post( $this->get_close_badge('loop') ); 707 $close_code = $this->get_close_badge('loop'); 708 if( $close_code && $close_code != '' ) echo wp_kses_post( $close_code ); 709 710 //echo wp_kses_post( $this->get_close_badge('loop') ); 707 711 } 708 712 … … 711 715 * 712 716 * @since 1.0.0 713 * @version 1.1. 1717 * @version 1.1.3 714 718 * 715 719 */ 716 720 function wc_before_template_part ( $template_name, $template_path, $located, $args ) { 717 721 718 $debug_param = filter_input( INPUT_GET, 'coming-soon-wc', FILTER_SANITIZE_STRING);722 $debug_param = filter_input(INPUT_GET, 'coming-soon-wc', FILTER_SANITIZE_SPECIAL_CHARS); 719 723 720 724 if ( $debug_param === 'show-placeholders' && current_user_can('manage_options') ) { … … 724 728 if ($template_name == 'single-product/product-image.php') { 725 729 726 echo wp_kses_post( $this->get_open_badge('product') ); 727 echo wp_kses_post( $this->get_close_badge('product') ); 730 $open_code = $this->get_open_badge('product'); 731 if( $open_code && $open_code != '' ) echo wp_kses_post( $open_code ); 732 733 $close_code = $this->get_close_badge('product'); 734 if( $close_code && $close_code != '' ) echo wp_kses_post( $close_code ); 728 735 } 729 736 … … 734 741 * 735 742 * @since 1.0.0 736 * @since 1.1. 1743 * @since 1.1.3 737 744 * 738 745 */ 739 746 function wc_after_template_part ( $template_name, $template_path, $located, $args ) { 740 747 741 $debug_param = filter_input( INPUT_GET, 'coming-soon-wc', FILTER_SANITIZE_STRING);748 $debug_param = filter_input(INPUT_GET, 'coming-soon-wc', FILTER_SANITIZE_SPECIAL_CHARS); 742 749 743 750 if ( $debug_param === 'show-placeholders' && current_user_can('manage_options') ) { -
coming-soon-for-woocommerce/trunk/readme.txt
r3483703 r3489501 7 7 WC requires at least: 3.0 8 8 WC tested up to: 10.6.1 9 Stable tag: 1.1. 29 Stable tag: 1.1.3 10 10 Requires PHP: 7.0 11 11 Requires Plugins: woocommerce … … 67 67 == Frequently Asked Questions == 68 68 69 = Where I setupthe badges? =70 71 On admin side, go to WooCommerce > Coming Soon Badges69 = Where I design the badges? = 70 71 On the admin side, go to WooCommerce > Coming Soon Badges 72 72 73 73 = How to disable adding to cart when the product is set to coming soon? = 74 74 75 The plugin doesn’t do it for now. There are two ways in WooCommerce to lock a product purchase:75 The plugin doesn’t do this yet. There are two ways in WooCommerce to prevent a product from being purchased: 76 76 77 77 1. You can remove the regular and sale price for a product, or … … 79 79 2. You can set the product stock to 0, or the stock status to out of stock (if you haven't set the WooCommerce product setting "Hide out of stock items from catalog", otherwise product will be hidden) 80 80 81 = Where I set coming soonfor my products? =82 83 Enter on a product edition, and activate the checkbox labeled "Show Coming Soon badge",just below the publication date. Then save the product.84 85 = Will work with my theme? =86 87 We ll, we can't be 100% sure, but we have coded the plugin following the standard WooCommerce template system, and should work well on every theme.88 In any case, we have written it carefully to ensure it doesn’t break the layout if it doesn’t work.89 90 Please , write us on the support forum to tell us about: whether to say if it works well, or not with your theme. It will help us and others, and we will try to make it work for you if it doesn’t.91 92 = I 'm theme developer. How to be compatible? =81 = Where do I set the Coming Soon badge for my products? = 82 83 Open a product for editing and activate the checkbox labeled "Show Coming Soon badge", located just below the publication date. Then save the product. 84 85 = Will it work with my theme? = 86 87 We can’t be 100% sure, but the plugin was coded following the standard WooCommerce template system and should work well with any theme. 88 In any case, it was designed carefully to ensure it doesn’t break the layout if it isn’t fully compatible. 89 90 Please write to us on the support forum to let us know whether the plugin works well with your theme or not. Your feedback will help us and other users, and we will try to make it work for you if it doesn’t. 91 92 = I’m a theme developer. How can I make my theme compatible? = 93 93 94 94 Coming Soon for WooCommerce works with the actions found in the standard product loop and single product templates. 95 95 96 96 The used actions to print the badge code are: 97 98 For single product: do_action( 'woocommerce_before_template_part' ); 99 For product loop: do_action( 'woocommerce_shop_loop_item_title' ); 100 101 You can find this actions in the templates: 102 103 wp-content/plugins/woocommerce/templates/single-product.php (single product template) 104 wp-content/plugins/woocommerce/templates/content-product.php (print each product on loop) 105 106 ...if you want to override these files in your WooCommerce child theme, or if you’re coding a theme from scratch, you may have the same file names in your theme folder: 107 108 wp-content/themes/your-theme/woocommerce/content-product.php 109 wp-content/themes/your-theme/woocommerce/single-product.php 110 111 in this case, simply check you've this actions on your code: 97 112 98 113 For single product: do_action( 'woocommerce_after_main_content' ); 99 114 For product loop: do_action( 'woocommerce_shop_loop_item_title' ); 100 115 101 You can find this actions in the templates:102 103 wp-content/plugins/woocommerce/templates/single-product.php (single product template)104 wp-content/plugins/woocommerce/templates/content-product.php (print each product on loop)105 106 ...if you want to override this files on your WooCommerce child theme, or you're coding one from scratch,107 maybe you have the same file names on your theme folder:108 109 wp-content/themes/your-theme/woocommerce/content-product.php110 wp-content/themes/your-theme/woocommerce/single-product.php111 112 in this case, simply check you've this actions on your code:113 114 For single product: do_action( 'woocommerce_after_main_content' );115 For product loop: do_action( 'woocommerce_shop_loop_item_title' );116 117 116 ...and Coming Soon for WooCommerce will do the rest :) 117 118 = How can I debug my theme template system for compatibility with Coming Soon Badges? = 119 120 First, ensure you're logged as admin, otherwise the plugin will not show any information. 121 122 Then add this parameter to the end of any page URL: ?coming-soon-wc=1 123 124 In this way: www.mywebsite.com/?coming-soon-wc=1 125 126 Look into the code for: <!-- CSW debug... --> log info 118 127 119 128 = The badge preview is not exactly the same as the badge on the front end = … … 129 138 130 139 == Changelog == 140 141 = 1.1.3 - 2026-03-24 = 142 * Fixed: Solved PHP deprecated warning 143 * Fixed: Solved "Translation loading domain was triggered too early" notice 131 144 132 145 = 1.1.2 - 2026-03-16 =
Note: See TracChangeset
for help on using the changeset viewer.