Plugin Directory

Changeset 3272734


Ignore:
Timestamp:
04/14/2025 06:54:06 PM (10 months ago)
Author:
iambherulal
Message:

1.2.0 Version released

Location:
easy-store-customizer/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • easy-store-customizer/trunk/README.txt

    r3224923 r3272734  
    33Tags: woocommerce, store customizer, shop customizer, product page, quantity buttons
    44Requires at least: 6.0
    5 Tested up to: 6.7
    6 Stable tag: 1.1.0
     5Tested up to: 6.7.2
     6Stable tag: 1.2.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020- **Rename the "Add to Cart" button label**: Customize the text for different product types for both the shop and single product pages.
    2121- **Number of Products per Page**: Change the default number of products displayed per page from default 12 to any number you prefer.
     22- **Hide Price & Add to Cart for Logged Out Users**: Hide product prices and the Add to Cart button from visitors who aren't logged in. Great for wholesale shops or member-only stores.
     23- **Display Stock Availability**: Show customers how many items are left in stock directly on the product page. Creates urgency and keeps shoppers informed.
     24- **Show Message to Customers Who Purchased the Product**: Display custom messages only to customers who already bought a specific product. Perfect for suggesting related items or providing usage tips.
    2225
    2326#### **Product Page**
     
    5760== Changelog ==
    5861
    59 = 1.1.0 - 19-01-2024 =
     62= 1.2.0 - 15-04-2025 =
     63* New - Product Page - Show Stock Availability.
     64* New - Product Page - Show Message to Customers Who Purchased the Product.
     65* New - Product Page - Hide Price & Add to Cart for Logged Out Users.
     66
     67= 1.1.0 - 19-01-2025 =
    6068* Fix - Single product page button label update same as archive page.
    6169* Improvement - Code optimization.
  • easy-store-customizer/trunk/admin/partials/easy-store-customizer-admin-display.php

    r3224923 r3272734  
    3535                     */
    3636                    $this->generate_feature_control('shop_product_per_page', $options);
     37
     38                    /**
     39                     *  Hide Price & Add to Cart for Logged Out Users
     40                     *
     41                     */
     42                    $this->generate_feature_control('shop_hide_add_to_cart_price', $options);
     43
     44                    /**
     45                     *  Display Stock Availability
     46                     *
     47                     */
     48                    $this->generate_feature_control('shop_display_stock_availability', $options);
     49
     50                    /**
     51                     *  Already Purchased Message
     52                     *
     53                     */
     54                    $this->generate_feature_control('shop_display_has_purchased_product_message', $options);
     55
    3756                    ?>
    3857                </div>
  • easy-store-customizer/trunk/easy-store-customizer.php

    r3224923 r3272734  
    1616 * Plugin Name:       Easy Store Customizer
    1717 * Description:       Easily customize your WooCommerce store with features like "Add to Cart" button labels, product display settings, and quantity controls.
    18  * Version:           1.1.0
     18 * Version:           1.2.0
    1919 * Author:            Bheru Lal Gameti
    2020 * Author URI:        https://100xwpdev.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
     
    2626 * Requires PHP: 8.0
    2727 * Requires at least: 6.0
    28  * Tested up to: 6.7
     28 * Tested up to: 6.7.2
    2929 *
    3030 */
     
    4040 * Rename this for your plugin and update it as you release new versions.
    4141 */
    42 define('EASY_STORE_CUSTOMIZER_VERSION', '1.1.0');
     42define('EASY_STORE_CUSTOMIZER_VERSION', '1.2.0');
    4343
    4444/**
  • easy-store-customizer/trunk/includes/class-easy-store-customizer-features.php

    r3224923 r3272734  
    104104        return $product_count;
    105105    }
     106    public function esc_shop_hide_add_to_cart_price($price, $product)
     107    {
     108        $label = $this->settings->get('shop_hide_add_to_cart_price', 'label') ?? __('Login to see prices', 'easy-store-customizer');
     109
     110        if (! is_user_logged_in()) {
     111            $price = '<div><a href="' . get_permalink(wc_get_page_id('myaccount')) . '">' . $label . '</a></div>';
     112            remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
     113            remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30);
     114            add_filter('woocommerce_is_purchasable', '__return_false');
     115            add_filter('woocommerce_loop_add_to_cart_link', '__return_empty_string', 10);
     116        }
     117        return $price;
     118    }
     119    public function esc_shop_display_stock_availability()
     120    {
     121        global $product;
     122        echo wp_kses_post(wc_get_stock_html($product));
     123    }
     124    public function esc_shop_has_purchased_product_message()
     125    {
     126        global $product;
     127        if (! is_user_logged_in()) return;
     128        $label = $this->settings->get('shop_display_has_purchased_product_message', 'label') ?? __('Previously bought', 'easy-store-customizer');
     129        if (wc_customer_bought_product('', get_current_user_id(), $product->get_id())) {
     130            echo '<p class="previously-bought-product">' . esc_html($label) . '</p>';
     131        }
     132    }
    106133
    107134    public function esc_product_input_hide_number_arrows()
  • easy-store-customizer/trunk/includes/class-easy-store-customizer-settings.php

    r3224923 r3272734  
    6868                'options' => [
    6969                    'count' => 16,
     70                ]
     71            ],
     72            'shop_hide_add_to_cart_price' => [
     73                'label' => __('Hide Price & Add to Cart for Logged Out Users', 'easy-store-customizer'),
     74                'description' => __('Hide the price and Add to Cart button for users who are not logged in.', 'easy-store-customizer'),
     75                'status' => 0,
     76                'options' => [
     77                    'label' => 'Login to see price',
     78                ]
     79            ],
     80            'shop_display_stock_availability' => [
     81                'label' => __('Display Stock Availability', 'easy-store-customizer'),
     82                'description' => __('Display stock availability on the product page.', 'easy-store-customizer'),
     83                'status' => 0
     84            ],
     85            'shop_display_has_purchased_product_message' => [
     86                'label' => __('Show Message to Customers Who Purchased the Product', 'easy-store-customizer'),
     87                'description' => __('Display a message to customers who have purchased the product.', 'easy-store-customizer'),
     88                'status' => 0,
     89                'options' => [
     90                    'label' => "Previously bought this product",
    7091                ]
    7192            ],
  • easy-store-customizer/trunk/includes/class-easy-store-customizer.php

    r3224923 r3272734  
    9393            $this->version = EASY_STORE_CUSTOMIZER_VERSION;
    9494        } else {
    95             $this->version = '1.1.0';
     95            $this->version = '1.2.0';
    9696        }
    9797        $this->plugin_name = 'easy-store-customizer';
     
    221221        $this->loader->add_action('wp_enqueue_scripts', $this->public, 'enqueue_styles');
    222222
     223        // Shop Page
     224
    223225        if ($this->settings->is_enabled('shop_add_to_cart')) {
    224226            $this->loader->add_filter('woocommerce_product_add_to_cart_text', $public_features, 'esc_rename_add_to_cart_button_label', 9999, 2);
    225227            $this->loader->add_filter('woocommerce_product_single_add_to_cart_text', $public_features, 'esc_rename_add_to_cart_button_label', 9999, 2);
    226228        }
     229        if ($this->settings->is_enabled('shop_product_per_page')) {
     230            $this->loader->add_filter('loop_shop_per_page', $public_features, 'esc_shop_product_per_page', 9999, 2);
     231        }
     232        if ($this->settings->is_enabled('shop_hide_add_to_cart_price')) {
     233            $this->loader->add_filter('woocommerce_get_price_html', $public_features, 'esc_shop_hide_add_to_cart_price', 10, 2);
     234        }
     235        if ($this->settings->is_enabled('shop_display_stock_availability')) {
     236            $this->loader->add_action('woocommerce_after_shop_loop_item', $public_features, 'esc_shop_display_stock_availability', 10);
     237        }
     238        if ($this->settings->is_enabled('shop_display_has_purchased_product_message')) {
     239            $this->loader->add_action('woocommerce_after_shop_loop_item', $public_features, 'esc_shop_has_purchased_product_message');
     240        }
     241        // Product Page
    227242
    228243        if ($this->settings->is_enabled('product_qty_input_plus_minus')) {
     
    231246            $this->loader->add_action('woocommerce_before_single_product', $public_features, 'esc_product_qty_input_button_script');
    232247        }
    233         if ($this->settings->is_enabled('shop_product_per_page')) {
    234             $this->loader->add_filter('loop_shop_per_page', $public_features, 'esc_shop_product_per_page', 9999, 2);
    235         }
    236248        if ($this->settings->is_enabled('product_qty_input_arrows')) {
    237249            $this->loader->add_action('wp_enqueue_scripts', $public_features, 'esc_product_input_hide_number_arrows');
  • easy-store-customizer/trunk/public/css/easy-store-customizer-public.css

    r3203853 r3272734  
    88    padding: 14px;
    99}
     10
     11.woocommerce div.product form.cart div.quantity {
     12    display: flex;
     13    gap: 8px;
     14}
     15
     16.woocommerce div.product form.cart div.quantity .qty {
     17    margin-right: 0;
     18}
Note: See TracChangeset for help on using the changeset viewer.