Plugin Directory

Changeset 3489501


Ignore:
Timestamp:
03/24/2026 12:05:00 AM (7 days ago)
Author:
wpcentrics
Message:

uploading new version

Location:
coming-soon-for-woocommerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coming-soon-for-woocommerce/trunk/coming-soon-for-woocommerce.php

    r3483703 r3489501  
    44 * Plugin URI: https://wordpress.org/plugins/coming-soon-for-woocommerce/
    55 * Description: Show coming soon badge over products
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Author: wpcentrics
    88 * Author URI: https://www.wp-centrics.com
     
    3535defined( 'ABSPATH' ) || exit;
    3636
    37 define ('COMING_SOON_WC_VERSION', '1.1.2' );
     37define ('COMING_SOON_WC_VERSION', '1.1.3' );
    3838define ('COMING_SOON_WC_PATH', dirname(__FILE__) . '/' );
    3939define ('COMING_SOON_WC_URL', plugin_dir_url( __FILE__ ) );
     
    6262        $this->load_options();
    6363
    64         // Init stuff + comming products let  term
     64        // Init
    6565        add_action( 'init', array ( $this, 'init' ) );
    6666
     
    122122     *
    123123     * @since 1.0.0
    124      * @version 1.0.11
     124     * @version 1.1.3
    125125     */
    126126    public function load_options() {
     
    137137           
    138138            'badge_loop_style' => 'circle-text',
    139             'badge_loop_text'  => __('COMING SOON', 'coming-soon-for-woocommerce'),
     139            'badge_loop_text'  => 'COMING SOON',
    140140            'badge_loop_opts'  => array (
    141141                                    'font-size'       => '14',
     
    160160
    161161            'badge_product_style' => 'circle-text',
    162             'badge_product_text'  => __('COMING SOON', 'coming-soon-for-woocommerce'),
     162            'badge_product_text'  => 'COMING SOON',
    163163            'badge_product_opts'  => array (
    164164                                    'font-size'       => '28', // double as loop
     
    687687     *
    688688     * @since 1.0.0
    689      * @version 1.1.1
     689     * @version 1.1.3
    690690     *
    691691     */
    692692    function display_coming_soon_loop_wc_open() {
    693693       
    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 );
    695696    }
    696697
     
    699700     *
    700701     * @since 1.0.0
    701      * @version 1.1.1
     702     * @version 1.1.3
    702703     *
    703704     */
    704705    function display_coming_soon_loop_wc_close() {
    705706
    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') );
    707711    }
    708712
     
    711715     *
    712716     * @since 1.0.0
    713      * @version 1.1.1
     717     * @version 1.1.3
    714718     *
    715719     */
    716720    function wc_before_template_part ( $template_name, $template_path, $located, $args ) {
    717721
    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);
    719723
    720724        if ( $debug_param === 'show-placeholders' && current_user_can('manage_options') ) {
     
    724728        if ($template_name == 'single-product/product-image.php') {
    725729           
    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 );
    728735        }
    729736       
     
    734741     *
    735742     * @since 1.0.0
    736      * @since 1.1.1
     743     * @since 1.1.3
    737744     *
    738745     */
    739746    function wc_after_template_part ( $template_name, $template_path, $located, $args ) {
    740747
    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);
    742749
    743750        if ( $debug_param === 'show-placeholders' && current_user_can('manage_options') ) {
  • coming-soon-for-woocommerce/trunk/readme.txt

    r3483703 r3489501  
    77WC requires at least: 3.0
    88WC tested up to: 10.6.1
    9 Stable tag: 1.1.2
     9Stable tag: 1.1.3
    1010Requires PHP: 7.0
    1111Requires Plugins: woocommerce
     
    6767== Frequently Asked Questions ==
    6868
    69 = Where I setup the badges? =
    70 
    71 On admin side, go to WooCommerce > Coming Soon Badges
     69= Where I design the badges? =
     70
     71On the admin side, go to WooCommerce > Coming Soon Badges
    7272
    7373= How to disable adding to cart when the product is set to coming soon? =
    7474
    75 The plugin doesn’t do it for now. There are two ways in WooCommerce to lock a product purchase:
     75The plugin doesn’t do this yet. There are two ways in WooCommerce to prevent a product from being purchased:
    7676
    77771. You can remove the regular and sale price for a product, or
     
    79792. 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)
    8080
    81 = Where I set coming soon for 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 Well, 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
     83Open 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
     87We can’t be 100% sure, but the plugin was coded following the standard WooCommerce template system and should work well with any theme.
     88In any case, it was designed carefully to ensure it doesn’t break the layout if it isn’t fully compatible.
     89
     90Please 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? =
    9393
    9494Coming Soon for WooCommerce works with the actions found in the standard product loop and single product templates.
    9595
    9696The used actions to print the badge code are:
     97
     98For single product: do_action( 'woocommerce_before_template_part' );
     99For product loop:   do_action( 'woocommerce_shop_loop_item_title' );
     100
     101You can find this actions in the templates:
     102
     103wp-content/plugins/woocommerce/templates/single-product.php  (single product template)
     104wp-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
     108wp-content/themes/your-theme/woocommerce/content-product.php
     109wp-content/themes/your-theme/woocommerce/single-product.php
     110
     111in this case, simply check you've this actions on your code:
    97112
    98113For single product: do_action( 'woocommerce_after_main_content' );
    99114For product loop:   do_action( 'woocommerce_shop_loop_item_title' );
    100115
    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.php
    110 wp-content/themes/your-theme/woocommerce/single-product.php
    111 
    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 
    117116...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
     120First, ensure you're logged as admin, otherwise the plugin will not show any information.
     121
     122Then add this parameter to the end of any page URL: ?coming-soon-wc=1
     123
     124In this way: www.mywebsite.com/?coming-soon-wc=1
     125
     126Look into the code for: <!-- CSW debug... --> log info
    118127
    119128= The badge preview is not exactly the same as the badge on the front end =
     
    129138
    130139== 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
    131144
    132145= 1.1.2 - 2026-03-16 =
Note: See TracChangeset for help on using the changeset viewer.