Plugin Directory

Changeset 2566264


Ignore:
Timestamp:
07/17/2021 10:32:05 AM (5 years ago)
Author:
ivanchernyakov
Message:

Continue Shopping Anywhere for WooCommerce - 1.2.0

Location:
continue-shopping-anywhere-for-woocommerce
Files:
34 added
4 edited

Legend:

Unmodified
Added
Removed
  • continue-shopping-anywhere-for-woocommerce/trunk/README.txt

    r2209653 r2566264  
    33Tags: continue shopping, woocommerce, shopping, ecommerce, notice
    44Requires at least: 4.6
    5 Tested up to: 5.3.0
     5Tested up to: 5.8
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848== Changelog ==
    4949
     50= 1.2.0 - 2021/07/17 =
     51* New: Added "Out of Stock only" option for single page
     52* New: Added "After Product Summary" and "After Product" options for single page
     53* Tweak: Tested with WP 5.8 and Woo 5.5
     54
    5055= 1.1.0 - 2019/12/11 =
    5156* Tweak: Added ability to change position on Single product page.
  • continue-shopping-anywhere-for-woocommerce/trunk/admin/partials/continue-shopping-anywhere-admin-display-settings.php

    r2209653 r2566264  
    99 * @since      1.0.0
    1010 * @since      1.1.0 - Added position for single page
     11 * @since      1.2.0 - Single page - when to show and new position
    1112 *
    1213 * @package    Continue_Shopping_Anywhere
     
    201202                        'woocommerce_before_single_product_summary' =>  'Before Product Summary',
    202203                        'woocommerce_before_single_product' =>  'Before Product',
     204                        'woocommerce_after_single_product_summary'  =>  'After Product Summary',
     205                        'woocommerce_after_single_product'  =>  'After Product',
    203206                    );
    204207                    $default_position_option = 'woocommerce_before_single_product_summary';
     
    212215                    );
    213216
     217                    // when to show
     218                    $single_conditions = array(
     219                        'always'    =>  'Always',
     220                        'out_of_stock'  =>  'Out of Stock only',
     221                    );
     222                    $default_condition_option = 'always';
     223                    $single_condition = array(
     224                        'title' => 'When to show?',
     225                        'type'  => 'radio',
     226                        'default'   => $default_condition_option,
     227                        'desc'     => '',
     228                        'options' => $single_conditions,
     229                        'id'    => 'woocsa_single_condition',
     230                    );
     231
    214232                    // all options
    215233                    $account_settings = array(
     
    226244                            'id'    => 'woocsa_single_apply',
    227245                        ),
     246                        $single_condition,
    228247                        $single_position,
    229248                        $single_type,
  • continue-shopping-anywhere-for-woocommerce/trunk/continue-shopping-anywhere.php

    r2209653 r2566264  
    1717 * Plugin URI:        https://wordpress.org/plugins/continue-shopping-anywhere-for-woocommerce
    1818 * Description:       Adds a continue shopping link on any woocommerce page.
    19  * Version:           1.1.0
     19 * Version:           1.2.0
    2020 * Author:            Ivan Chernyakov
    2121 * Author URI:        https://businessupwebsite.com
     
    2424 * Text Domain:       continue-shopping-anywhere
    2525 * Domain Path:       /languages
    26  * WC tested up to: 3.8.0
     26 * WC tested up to: 5.5
    2727 */
    2828
     
    3737 * Rename this for your plugin and update it as you release new versions.
    3838 */
    39 define( 'CONTINUE_SHOPPING_ANYWHERE_VERSION', '1.1.0' );
     39define( 'CONTINUE_SHOPPING_ANYWHERE_VERSION', '1.2.0' );
    4040
    4141/**
  • continue-shopping-anywhere-for-woocommerce/trunk/public/class-continue-shopping-anywhere-public.php

    r2158848 r2566264  
    176176     *
    177177     * @since    1.0.0
     178     * @since    1.2.0 - Single page out of stock check
    178179     */
    179180    public function custom_redirect_always_shown( $page_name ) {
     
    181182            return;
    182183        }
     184
     185        if ($page_name == 'single' && get_option('woocsa_single_condition') == 'out_of_stock'){
     186            global $product;
     187            if ( $product->get_manage_stock() && $product->get_stock_quantity() <= 0){
     188            }
     189            else
     190                return;
     191        }
     192
    183193        $continue = get_option( 'woocsa_'.$page_name.'_type_always' );
    184194        $custom_link = get_option( 'woocsa_'.$page_name.'_custom_link' );
Note: See TracChangeset for help on using the changeset viewer.