Changeset 3272734
- Timestamp:
- 04/14/2025 06:54:06 PM (10 months ago)
- Location:
- easy-store-customizer/trunk
- Files:
-
- 7 edited
-
README.txt (modified) (3 diffs)
-
admin/partials/easy-store-customizer-admin-display.php (modified) (1 diff)
-
easy-store-customizer.php (modified) (3 diffs)
-
includes/class-easy-store-customizer-features.php (modified) (1 diff)
-
includes/class-easy-store-customizer-settings.php (modified) (1 diff)
-
includes/class-easy-store-customizer.php (modified) (3 diffs)
-
public/css/easy-store-customizer-public.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easy-store-customizer/trunk/README.txt
r3224923 r3272734 3 3 Tags: woocommerce, store customizer, shop customizer, product page, quantity buttons 4 4 Requires at least: 6.0 5 Tested up to: 6.7 6 Stable tag: 1. 1.05 Tested up to: 6.7.2 6 Stable tag: 1.2.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 - **Rename the "Add to Cart" button label**: Customize the text for different product types for both the shop and single product pages. 21 21 - **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. 22 25 23 26 #### **Product Page** … … 57 60 == Changelog == 58 61 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 = 60 68 * Fix - Single product page button label update same as archive page. 61 69 * Improvement - Code optimization. -
easy-store-customizer/trunk/admin/partials/easy-store-customizer-admin-display.php
r3224923 r3272734 35 35 */ 36 36 $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 37 56 ?> 38 57 </div> -
easy-store-customizer/trunk/easy-store-customizer.php
r3224923 r3272734 16 16 * Plugin Name: Easy Store Customizer 17 17 * Description: Easily customize your WooCommerce store with features like "Add to Cart" button labels, product display settings, and quantity controls. 18 * Version: 1. 1.018 * Version: 1.2.0 19 19 * Author: Bheru Lal Gameti 20 20 * Author URI: https://100xwpdev.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 26 26 * Requires PHP: 8.0 27 27 * Requires at least: 6.0 28 * Tested up to: 6.7 28 * Tested up to: 6.7.2 29 29 * 30 30 */ … … 40 40 * Rename this for your plugin and update it as you release new versions. 41 41 */ 42 define('EASY_STORE_CUSTOMIZER_VERSION', '1. 1.0');42 define('EASY_STORE_CUSTOMIZER_VERSION', '1.2.0'); 43 43 44 44 /** -
easy-store-customizer/trunk/includes/class-easy-store-customizer-features.php
r3224923 r3272734 104 104 return $product_count; 105 105 } 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 } 106 133 107 134 public function esc_product_input_hide_number_arrows() -
easy-store-customizer/trunk/includes/class-easy-store-customizer-settings.php
r3224923 r3272734 68 68 'options' => [ 69 69 '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", 70 91 ] 71 92 ], -
easy-store-customizer/trunk/includes/class-easy-store-customizer.php
r3224923 r3272734 93 93 $this->version = EASY_STORE_CUSTOMIZER_VERSION; 94 94 } else { 95 $this->version = '1. 1.0';95 $this->version = '1.2.0'; 96 96 } 97 97 $this->plugin_name = 'easy-store-customizer'; … … 221 221 $this->loader->add_action('wp_enqueue_scripts', $this->public, 'enqueue_styles'); 222 222 223 // Shop Page 224 223 225 if ($this->settings->is_enabled('shop_add_to_cart')) { 224 226 $this->loader->add_filter('woocommerce_product_add_to_cart_text', $public_features, 'esc_rename_add_to_cart_button_label', 9999, 2); 225 227 $this->loader->add_filter('woocommerce_product_single_add_to_cart_text', $public_features, 'esc_rename_add_to_cart_button_label', 9999, 2); 226 228 } 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 227 242 228 243 if ($this->settings->is_enabled('product_qty_input_plus_minus')) { … … 231 246 $this->loader->add_action('woocommerce_before_single_product', $public_features, 'esc_product_qty_input_button_script'); 232 247 } 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 }236 248 if ($this->settings->is_enabled('product_qty_input_arrows')) { 237 249 $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 8 8 padding: 14px; 9 9 } 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.