Changeset 3451281
- Timestamp:
- 02/01/2026 08:40:56 AM (3 weeks ago)
- Location:
- alpha-single-product-for-elementor/trunk
- Files:
-
- 7 edited
-
README.md (modified) (2 diffs)
-
alpha-single-product-for-elementor.php (modified) (3 diffs)
-
assets/css/alpha-sp-widget.css (modified) (1 diff)
-
include/class-alpha-single-product-widget.php (modified) (8 diffs)
-
include/class-alpha-single-product.php (modified) (2 diffs)
-
languages/alpha-single-product-for-elementor.pot (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alpha-single-product-for-elementor/trunk/README.md
r3276980 r3451281 16 16 **Tags**: single-product, elementor, woocommerce, product, page builder 17 17 **Requires at least**: 6.0 18 **Tested up to**: 6. 818 **Tested up to**: 6.9 19 19 **Requires PHP**: 7.4 20 **Stable tag**: 1. 120 **Stable tag**: 1.2.0 21 21 **License**: GPLv3 22 22 **License URI**: [GPLv3 License](https://www.gnu.org/licenses/gpl-3.0.html) … … 88 88 ## Upgrade Notice 89 89 90 ### 1.2.0 91 - New optional placeholder state so pages don’t appear blank when no product is selected. 92 90 93 ### 1.1 91 92 94 - Compatibility for WP 6.8 -
alpha-single-product-for-elementor/trunk/alpha-single-product-for-elementor.php
r3276980 r3451281 6 6 * Author: Ali Ali 7 7 * Author URI: https://github.com/Ali7Ali 8 * Version: 1. 18 * Version: 1.2.0 9 9 * Text Domain: alpha-single-product-for-elementor 10 10 * Domain Path: /languages … … 36 36 } 37 37 38 define( 'ALPHASP_VERSION', '1. 1' );38 define( 'ALPHASP_VERSION', '1.2.0' ); 39 39 define( 'ALPHASP_PLUGIN_FILE', __FILE__ ); 40 40 define( 'ALPHASP_PLUGIN_URL', plugins_url( '/', ALPHASP_PLUGIN_FILE ) ); … … 53 53 * @return void 54 54 */ 55 function alpha _single_product_addon() {55 function alphasp_single_product_addon() { 56 56 // Load the main plugin class. 57 57 \Elementor_Alpha_Single_Product_Addon\Alpha_Single_Product_For_Elementor::instance(); 58 58 } 59 add_action( 'plugins_loaded', 'alpha _single_product_addon' );59 add_action( 'plugins_loaded', 'alphasp_single_product_addon' ); -
alpha-single-product-for-elementor/trunk/assets/css/alpha-sp-widget.css
r2932965 r3451281 1 .alpha-sp-product{box-sizing:border-box;display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;width:100%;justify-content:center;}.sp-product-wrapper{position:relative}.sp-product-image{max-width:none!important}.sp-product-action{bottom:15px;left:0;right:0;top:auto;transform:translateY(0);display:flex;flex-direction:row;justify-content:space-between;position:absolute;z-index:9}.sp-product-action .cta-bt,.sp-product-action .elementor-button,.sp-product-action .sp-cart-button{background-color:#00000000}.sp-product-info,.sp-product-info2{max-width: 50%;}.sp-product-action,.sp-product-action2{display: flex; justify-content: space-between;}.sp-cart-button{position:relative}.sp-cart-button a{width:100%}.sp-product-info{position:relative}.sp-cart-button a.added{display:none} 1 .alpha-sp-product{box-sizing:border-box;display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;width:100%;justify-content:center;}.sp-product-wrapper{position:relative}.sp-product-image{max-width:none!important}.sp-product-action{bottom:15px;left:0;right:0;top:auto;transform:translateY(0);display:flex;flex-direction:row;justify-content:space-between;position:absolute;z-index:9}.sp-product-action .cta-bt,.sp-product-action .elementor-button,.sp-product-action .sp-cart-button{background-color:#00000000}.sp-product-info,.sp-product-info2{max-width: 50%;}.sp-product-action,.sp-product-action2{display: flex; justify-content: space-between;}.sp-cart-button{position:relative}.sp-cart-button a{width:100%}.sp-product-info{position:relative}.sp-cart-button a.added{display:none}.alpha-sp-placeholder{border:1px dashed #c7c7c7;padding:16px;text-align:center;width:100%;display:flex;align-items:center;justify-content:center}.alpha-sp-placeholder .sp-placeholder-message{color:#555;font-size:14px;line-height:1.5;margin:0} -
alpha-single-product-for-elementor/trunk/include/class-alpha-single-product-widget.php
r3276980 r3451281 97 97 'multiple' => false, 98 98 'options' => $this->alphasp_post_name( 'product' ), 99 ) 100 ); 101 102 $this->add_control( 103 'show_placeholder', 104 array( 105 'label' => __( 'Placeholder When Empty', 'alpha-single-product-for-elementor' ), 106 'type' => Controls_Manager::SWITCHER, 107 'label_on' => esc_html__( 'Show', 'alpha-single-product-for-elementor' ), 108 'label_off' => esc_html__( 'Hide', 'alpha-single-product-for-elementor' ), 109 'return_value' => 'yes', 110 'default' => 'yes', 111 'description' => __( 'Display a placeholder when no product is selected or the product is unavailable.', 'alpha-single-product-for-elementor' ), 112 ) 113 ); 114 115 $this->add_control( 116 'placeholder_text', 117 array( 118 'label' => __( 'Placeholder Message', 'alpha-single-product-for-elementor' ), 119 'type' => Controls_Manager::TEXTAREA, 120 'default' => __( 'Select a product to display.', 'alpha-single-product-for-elementor' ), 121 'condition' => array( 122 'show_placeholder' => 'yes', 123 ), 124 'rows' => 3, 125 'placeholder' => __( 'Select a product to display.', 'alpha-single-product-for-elementor' ), 99 126 ) 100 127 ); … … 620 647 return $options; 621 648 } 649 650 return $options; 622 651 } 623 652 … … 643 672 $per_page = 1; 644 673 645 $cart_action_classes = 'class="sp-cart-button ' . esc_attr( $settings['product_action_button_class'] ) . '"'; 674 $product_id = isset( $settings['alphasp_product_id'] ) ? absint( $settings['alphasp_product_id'] ) : 0; 675 676 if ( ! $product_id ) { 677 $this->render_placeholder( $settings, true ); 678 return; 679 } 680 681 $cart_button_class = isset( $settings['product_action_button_class'] ) ? $settings['product_action_button_class'] : ''; 682 $cart_action_classes = 'class="sp-cart-button ' . esc_attr( $cart_button_class ) . '"'; 646 683 647 684 add_filter( … … 669 706 ); 670 707 671 $args['p'] = $ settings['alphasp_product_id'];708 $args['p'] = $product_id; 672 709 673 710 // Action Button. … … 678 715 } 679 716 680 if ( $settings['product_action_button_text']) {717 if ( ! empty( $settings['product_action_button_text'] ) ) { 681 718 // To change add to cart text on single product page. 682 719 add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'add_to_cart_text' ) ); … … 690 727 $products = new \WP_Query( $args ); 691 728 if ( $products->have_posts() ) : 692 ?>693 <?php694 729 while ( $products->have_posts() ) : 695 730 $products->the_post(); … … 708 743 </a> 709 744 </div> 710 <?php if ( 'yes' !== $settings['product_info_location'] ) : ?>745 <?php if ( ! isset( $settings['product_info_location'] ) || 'yes' !== $settings['product_info_location'] ) : ?> 711 746 <div class="sp-product-action"> 712 747 <div class="sp-product-info"> … … 730 765 endwhile; 731 766 wp_reset_postdata(); 732 ?> 733 <?php endif; ?> 767 else : 768 $this->render_placeholder( $settings, false ); 769 endif; 770 ?> 734 771 </div> 735 772 <?php 736 773 } 774 775 /** 776 * Render placeholder when no product is selected or available. 777 * 778 * @param array $settings Widget settings. 779 * @param bool $with_wrapper Whether to wrap with the widget container. 780 * @return void 781 */ 782 protected function render_placeholder( $settings, $with_wrapper = true ) { 783 if ( ! isset( $settings['show_placeholder'] ) || 'yes' !== $settings['show_placeholder'] ) { 784 return; 785 } 786 787 $placeholder_text = ! empty( $settings['placeholder_text'] ) ? $settings['placeholder_text'] : __( 'Select a product to display.', 'alpha-single-product-for-elementor' ); 788 ?> 789 <div class="<?php echo esc_attr( true === $with_wrapper ? 'alpha-sp-product alpha-sp-placeholder' : 'alpha-sp-placeholder' ); ?>"> 790 <div class="sp-placeholder-message"><?php echo wp_kses_post( $placeholder_text ); ?></div> 791 </div> 792 <?php 793 } 737 794 } -
alpha-single-product-for-elementor/trunk/include/class-alpha-single-product.php
r3276980 r3451281 81 81 82 82 /** 83 * Load the plugin text domain.84 */85 public function i18n() {86 load_plugin_textdomain( 'alpha-single-product-for-elementor', false, ALPHASP_PLUGIN_LANGUAGES );87 }88 89 /**90 83 * Compatibility Checks 91 84 * … … 129 122 */ 130 123 public function init() { 131 132 $this->i18n();133 134 124 add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'frontend_styles' ) ); 135 125 add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) ); -
alpha-single-product-for-elementor/trunk/languages/alpha-single-product-for-elementor.pot
r3190431 r3451281 1 # Copyright (C) 202 4Ali Ali1 # Copyright (C) 2026 Ali Ali 2 2 # This file is distributed under the GPLv3. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Alpha Single Product For Elementor 1. 0.6\n"5 "Project-Id-Version: Alpha Single Product For Elementor 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/alpha-single-product-for-elementor\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-11-15T23:27:12+00:00\n"12 "POT-Creation-Date: 2026-02-01T08:38:24+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 40 40 msgstr "" 41 41 42 #: include/class-alpha-single-product-widget.php:4 142 #: include/class-alpha-single-product-widget.php:44 43 43 msgid "Alpha SP Widget" 44 44 msgstr "" … … 57 57 msgstr "" 58 58 59 #: include/class-alpha-single-product-widget.php:105 60 msgid "Placeholder When Empty" 61 msgstr "" 62 63 #: include/class-alpha-single-product-widget.php:107 64 msgid "Show" 65 msgstr "" 66 59 67 #: include/class-alpha-single-product-widget.php:108 68 msgid "Hide" 69 msgstr "" 70 71 #: include/class-alpha-single-product-widget.php:111 72 msgid "Display a placeholder when no product is selected or the product is unavailable." 73 msgstr "" 74 75 #: include/class-alpha-single-product-widget.php:118 76 msgid "Placeholder Message" 77 msgstr "" 78 79 #: include/class-alpha-single-product-widget.php:120 80 #: include/class-alpha-single-product-widget.php:125 81 #: include/class-alpha-single-product-widget.php:787 82 msgid "Select a product to display." 83 msgstr "" 84 85 #: include/class-alpha-single-product-widget.php:135 60 86 msgid "Product Settings" 61 87 msgstr "" 62 88 63 #: include/class-alpha-single-product-widget.php:1 1589 #: include/class-alpha-single-product-widget.php:142 64 90 msgid "Title, Price, and Button Location" 65 91 msgstr "" 66 92 67 #: include/class-alpha-single-product-widget.php:1 1793 #: include/class-alpha-single-product-widget.php:144 68 94 msgid "Under" 69 95 msgstr "" 70 96 71 #: include/class-alpha-single-product-widget.php:1 1897 #: include/class-alpha-single-product-widget.php:145 72 98 msgid "Above" 73 99 msgstr "" 74 100 75 #: include/class-alpha-single-product-widget.php:1 27101 #: include/class-alpha-single-product-widget.php:154 76 102 msgid "Hide Title" 77 103 msgstr "" 78 104 79 #: include/class-alpha-single-product-widget.php:1 39105 #: include/class-alpha-single-product-widget.php:166 80 106 msgid "Hide Price" 81 107 msgstr "" 82 108 83 #: include/class-alpha-single-product-widget.php:1 51109 #: include/class-alpha-single-product-widget.php:178 84 110 msgid "Action Button Text" 85 111 msgstr "" 86 112 87 #: include/class-alpha-single-product-widget.php:1 53113 #: include/class-alpha-single-product-widget.php:180 88 114 msgid "ADD TO CART" 89 115 msgstr "" 90 116 91 #: include/class-alpha-single-product-widget.php:1 60117 #: include/class-alpha-single-product-widget.php:187 92 118 msgid "Add CSS Class" 93 119 msgstr "" 94 120 95 #: include/class-alpha-single-product-widget.php:1 68121 #: include/class-alpha-single-product-widget.php:195 96 122 msgid "Product Image Size" 97 123 msgstr "" 98 124 99 #: include/class-alpha-single-product-widget.php: 177125 #: include/class-alpha-single-product-widget.php:204 100 126 msgid "Width PX" 101 127 msgstr "" 102 128 103 #: include/class-alpha-single-product-widget.php: 191129 #: include/class-alpha-single-product-widget.php:218 104 130 msgid "Height PX" 105 131 msgstr "" 106 132 107 #: include/class-alpha-single-product-widget.php:2 06133 #: include/class-alpha-single-product-widget.php:233 108 134 msgid "Style" 109 135 msgstr "" 110 136 111 #: include/class-alpha-single-product-widget.php:2 23112 #: include/class-alpha-single-product-widget.php: 476137 #: include/class-alpha-single-product-widget.php:250 138 #: include/class-alpha-single-product-widget.php:508 113 139 msgid "Border Radius" 114 140 msgstr "" 115 141 116 #: include/class-alpha-single-product-widget.php:2 43117 #: include/class-alpha-single-product-widget.php: 496118 #: include/class-alpha-single-product-widget.php: 581142 #: include/class-alpha-single-product-widget.php:270 143 #: include/class-alpha-single-product-widget.php:528 144 #: include/class-alpha-single-product-widget.php:613 119 145 msgid "Border Color" 120 146 msgstr "" 121 147 122 #: include/class-alpha-single-product-widget.php:2 55148 #: include/class-alpha-single-product-widget.php:282 123 149 msgid "Padding" 124 150 msgstr "" 125 151 126 #: include/class-alpha-single-product-widget.php:2 67127 #: include/class-alpha-single-product-widget.php:3 24128 #: include/class-alpha-single-product-widget.php: 377152 #: include/class-alpha-single-product-widget.php:294 153 #: include/class-alpha-single-product-widget.php:353 154 #: include/class-alpha-single-product-widget.php:408 129 155 msgid "Margin" 130 156 msgstr "" 131 157 132 #: include/class-alpha-single-product-widget.php: 280158 #: include/class-alpha-single-product-widget.php:307 133 159 msgid "Product Title" 134 160 msgstr "" 135 161 136 #: include/class-alpha-single-product-widget.php: 298162 #: include/class-alpha-single-product-widget.php:327 137 163 msgid "Title Color" 138 164 msgstr "" 139 165 140 #: include/class-alpha-single-product-widget.php:3 11166 #: include/class-alpha-single-product-widget.php:340 141 167 msgid "Title Hover Color" 142 168 msgstr "" 143 169 144 #: include/class-alpha-single-product-widget.php:3 46170 #: include/class-alpha-single-product-widget.php:375 145 171 msgid "Product Price" 146 172 msgstr "" 147 173 148 #: include/class-alpha-single-product-widget.php:3 55174 #: include/class-alpha-single-product-widget.php:384 149 175 msgid "Price Color" 150 176 msgstr "" 151 177 152 #: include/class-alpha-single-product-widget.php:4 01178 #: include/class-alpha-single-product-widget.php:432 153 179 msgid "Action Button Style" 154 180 msgstr "" 155 181 156 #: include/class-alpha-single-product-widget.php:4 09182 #: include/class-alpha-single-product-widget.php:440 157 183 msgid "Button" 158 184 msgstr "" 159 185 160 #: include/class-alpha-single-product-widget.php:4 23186 #: include/class-alpha-single-product-widget.php:454 161 187 msgid "Normal" 162 188 msgstr "" 163 189 164 #: include/class-alpha-single-product-widget.php:4 30165 #: include/class-alpha-single-product-widget.php:5 57190 #: include/class-alpha-single-product-widget.php:461 191 #: include/class-alpha-single-product-widget.php:589 166 192 msgid "Text Color" 167 193 msgstr "" 168 194 169 #: include/class-alpha-single-product-widget.php:4 51170 #: include/class-alpha-single-product-widget.php: 569195 #: include/class-alpha-single-product-widget.php:484 196 #: include/class-alpha-single-product-widget.php:601 171 197 msgid "Background Color" 172 198 msgstr "" 173 199 174 #: include/class-alpha-single-product-widget.php:5 08200 #: include/class-alpha-single-product-widget.php:540 175 201 msgid "Button Padding" 176 202 msgstr "" 177 203 178 #: include/class-alpha-single-product-widget.php:5 28204 #: include/class-alpha-single-product-widget.php:560 179 205 msgid "Button Margin" 180 206 msgstr "" 181 207 182 #: include/class-alpha-single-product-widget.php:5 50208 #: include/class-alpha-single-product-widget.php:582 183 209 msgid "Hover" 184 210 msgstr "" 185 211 186 #: include/class-alpha-single-product-widget.php:6 04212 #: include/class-alpha-single-product-widget.php:635 187 213 msgid "Select" 188 214 msgstr "" 189 215 190 #: include/class-alpha-single-product-widget.php:6 24216 #: include/class-alpha-single-product-widget.php:658 191 217 msgid "Add to Cart" 192 218 msgstr "" 193 219 194 #: include/class-alpha-single-product-widget.php:6 51195 #: include/class-alpha-single-product.php:1 44220 #: include/class-alpha-single-product-widget.php:693 221 #: include/class-alpha-single-product.php:136 196 222 msgid "Go to cart" 197 223 msgstr "" 198 224 199 225 #. translators: 1: Plugin name 2: Elementor 200 #: include/class-alpha-single-product.php:163 201 #: include/class-alpha-single-product.php:199 226 #. translators: 1: Plugin name 2: WooCommerce 227 #: include/class-alpha-single-product.php:155 228 #: include/class-alpha-single-product.php:219 202 229 msgid "\"%1$s\" requires \"%2$s\" to be installed and activated." 203 230 msgstr "" 204 231 205 #: include/class-alpha-single-product.php:1 64206 #: include/class-alpha-single-product.php:2 00207 #: include/class-alpha-single-product.php:2 36208 #: include/class-alpha-single-product.php: 258232 #: include/class-alpha-single-product.php:156 233 #: include/class-alpha-single-product.php:220 234 #: include/class-alpha-single-product.php:284 235 #: include/class-alpha-single-product.php:317 209 236 msgid "Alpha Single Product Widget for Elementor" 210 237 msgstr "" 211 238 212 #: include/class-alpha-single-product.php:1 65213 #: include/class-alpha-single-product.php:2 37239 #: include/class-alpha-single-product.php:157 240 #: include/class-alpha-single-product.php:285 214 241 msgid "Elementor" 215 242 msgstr "" 216 243 217 #: include/class-alpha-single-product.php:17 4244 #: include/class-alpha-single-product.php:170 218 245 msgid "Activate Elementor" 219 246 msgstr "" … … 223 250 msgstr "" 224 251 225 #: include/class-alpha-single-product.php:2 01252 #: include/class-alpha-single-product.php:221 226 253 msgid "WooCommerce" 227 254 msgstr "" 228 255 229 #: include/class-alpha-single-product.php:2 10256 #: include/class-alpha-single-product.php:234 230 257 msgid "Activate WooCommerce" 231 258 msgstr "" 232 259 233 #: include/class-alpha-single-product.php:2 13260 #: include/class-alpha-single-product.php:241 234 261 msgid "Install WooCommerce" 235 262 msgstr "" 236 263 237 #. translators: 1: Plugin name 2: Elementor3: Required Elementor version238 #: include/class-alpha-single-product.php:2 35264 #. translators: 1: Plugin name, 2: Elementor, 3: Required Elementor version 265 #: include/class-alpha-single-product.php:283 239 266 msgid "\"%1$s\" requires the \"%2$s\" plugin version %3$s or greater." 240 267 msgstr "" 241 268 242 #. translators: 1: Plugin name 2: PHP3: Required PHP version243 #: include/class-alpha-single-product.php: 257269 #. translators: 1: Plugin name, 2: PHP, 3: Required PHP version 270 #: include/class-alpha-single-product.php:316 244 271 msgid "\"%1$s\" requires \"%2$s\" version %3$s or greater." 245 272 msgstr "" 246 273 247 #: include/class-alpha-single-product.php: 259274 #: include/class-alpha-single-product.php:318 248 275 msgid "PHP" 249 276 msgstr "" -
alpha-single-product-for-elementor/trunk/readme.txt
r3276980 r3451281 4 4 Tags: single-product, elementor, woocommerce, product, page builder 5 5 Requires at least: 6.0 6 Tested up to: 6. 86 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1. 18 Stable tag: 1.2.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 57 57 == Upgrade Notice == 58 58 59 = 1.2.0 = 60 * Optional placeholder state so pages don’t appear blank when no product is selected. 61 59 62 = 1.1 = 60 63 * Compatibility for WP 6.8
Note: See TracChangeset
for help on using the changeset viewer.