Plugin Directory

Changeset 3426751


Ignore:
Timestamp:
12/24/2025 10:25:17 AM (3 months ago)
Author:
themepure
Message:

Updated to 4.0.4

Location:
shopbuild/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • shopbuild/trunk/functions.php

    r3414980 r3426751  
    14351435            'classes'      => apply_filters('woocommerce_quantity_input_classes', array('input-text', 'qty', 'text'), $product),
    14361436            'max_value'    => apply_filters('woocommerce_quantity_input_max', -1, $product),
    1437             'min_value'    => apply_filters('woocommerce_quantity_input_min', 0, $product),
     1437            'min_value'    => apply_filters('woocommerce_quantity_input_min', 1, $product),
    14381438            'step'         => apply_filters('woocommerce_quantity_input_step', 1, $product),
    14391439            'pattern'      => apply_filters('woocommerce_quantity_input_pattern', has_filter('woocommerce_stock_amount', 'intval') ? '[0-9]*' : ''),
     
    14501450
    14511451        // Apply sanity to min/max args - min cannot be lower than 0.
    1452         $args['min_value'] = max($args['min_value'], 0);
     1452        $args['min_value'] = max($args['min_value'], 1);
    14531453        $args['max_value'] = 0 < $args['max_value'] ? $args['max_value'] : '';
    14541454
  • shopbuild/trunk/public/js/pure-wc-shopbuild.js

    r3414980 r3426751  
    235235    }
    236236
     237    function quantity_arrow_keys() {
     238        $(document).on('keydown', '.strb-cart-input', function(e) {
     239            var $input = $(this);
     240            var currentVal = parseFloat($input.val());
     241            var step = parseFloat($input.attr('step')) || 1;
     242            var min = parseFloat($input.attr('min'));
     243            var max = parseFloat($input.attr('max'));
     244
     245            // Arrow Up
     246            if (e.which === 38) {
     247                e.preventDefault();
     248                if (isNaN(currentVal)) currentVal = 0;
     249                var newVal = currentVal + step;
     250                if (!isNaN(max) && newVal > max) newVal = max;
     251                $input.val(newVal).trigger('change');
     252            }
     253            // Arrow Down
     254            else if (e.which === 40) {
     255                e.preventDefault();
     256                if (isNaN(currentVal)) currentVal = 0;
     257                var newVal = currentVal - step;
     258                if (!isNaN(min) && newVal < min) newVal = min;
     259                $input.val(newVal).trigger('change');
     260            }
     261        });
     262    }
     263
    237264    $(function() {
    238265        // Your code here
    239266        countdown();
    240267        products_price_filter();
     268        quantity_arrow_keys();
    241269    });
    242270
  • shopbuild/trunk/public/widgets/elementor/single-product-compare.php

    r3414980 r3426751  
    103103        }
    104104
    105         if (empty($storebuild_product)) {
    106             return;
    107         }
     105        $storebuild_product = $storebuild_product?? $product;
     106       
    108107
    109108        $output = sprintf('<button data-bs-toggle="tooltip" type="button" data-bs-placement="bottom" class="strb-product-details-action-btn button wp-element-button pure-tooltip pure-wc-compare-btn" data-id="%s" title="Add To Compare">
     
    115114            </svg>
    116115            Compare
    117         </button>', $product->get_id());
     116        </button>', $storebuild_product->get_id());
    118117
    119118        print wp_kses($output, storebuild_get_kses_extended_ruleset());
  • shopbuild/trunk/public/widgets/elementor/single-product-thumbnail.php

    r3425313 r3426751  
    277277                'type' => \Elementor\Controls_Manager::COLOR,
    278278                'selectors' => [
    279                     '{{WRAPPER}} .strb-product-details-thumbnail span.onsale' => 'background-color: {{VALUE}}',
     279                    '{{WRAPPER}} .strb-product-details-thumbnail span.onsale, {{WRAPPER}} .strb-single-product-gallery .onsale' => 'background-color: {{VALUE}}',
    280280                ],
    281281            ]
     
    288288                'type' => \Elementor\Controls_Manager::COLOR,
    289289                'selectors' => [
    290                     '{{WRAPPER}} .strb-product-details-thumbnail span.onsale, {{WRAPPER}} .strb-product-details-thumbnail span.onsale' => 'color: {{VALUE}}',
     290                    '{{WRAPPER}} .strb-product-details-thumbnail span.onsale, {{WRAPPER}} .strb-single-product-gallery .onsale' => 'color: {{VALUE}}',
    291291                ],
    292292            ]
     
    298298                'name' => 'storebuild_product_sale_typography',
    299299                'label' => esc_html__('Typography', 'shopbuild'),
    300                 'selector' => '{{WRAPPER}} .strb-product-details-thumbnail span.onsale, {{WRAPPER}} .strb-product-details-thumbnail span.onsale',
     300                'selector' => '{{WRAPPER}} .strb-product-details-thumbnail span.onsale, {{WRAPPER}} .strb-single-product-gallery .onsale',
    301301            ]
    302302        );
  • shopbuild/trunk/public/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php

    r3414980 r3426751  
    1414// verify nonce
    1515if(isset($_POST['add-to-cart-nonce-' . $product->get_id()]) && !wp_verify_nonce( wp_unslash( sanitize_text_field(wp_unslash($_POST['add-to-cart-nonce-' . $product->get_id()]))), 'add-to-cart-' . $product->get_id() )) {
    16     $storebuild_quantity = 0;
     16    $storebuild_quantity = 1;
    1717}else{
    1818    $storebuild_quantity = (isset( $_POST['quantity'] )) ? absint( wp_unslash($_POST['quantity']) ) : $product->get_min_purchase_quantity();
     
    2929            'min_value'   => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
    3030            'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
    31             'input_value' => esc_attr($quantity),
     31            'input_value' => esc_attr($storebuild_quantity),
    3232        )
    3333    );
  • shopbuild/trunk/readme.txt

    r3425313 r3426751  
    88WC requires at least: 5.6
    99WC tested up to: 8.2
    10 Stable tag: 4.0.3
     10Stable tag: 4.0.4
    1111License: GPLv2
    1212License URI: https://www.gnu.org/licenses/gpl-2.1.html
     
    529529* Fixed array to string conversion warning in product search form.
    530530
     531= 4.0.4 =
     532* Added arrow key support for quantity input fields.
     533
    531534== Upgrade Notice ==
    532535
  • shopbuild/trunk/shopbuild.php

    r3425313 r3426751  
    1212 *
    1313 * @link              https://storebuild.shop
    14  * @since             4.0.3
     14 * @since             4.0.4
    1515 * @package           Storebuild
    1616 *
     
    1919 * Plugin URI:        https://storebuild.shop
    2020 * Description:       Build your shop with amazing woocommerce tools. Customize your shop and product page. Order invoices, order tracking now in one package.
    21  * Version:           4.0.3
     21 * Version:           4.0.4
    2222 * Author:            ThemePure
    2323 * Author URI:        https://themepure.net
     
    3737}
    3838
    39 define('STOREBUILD_VERSION', '4.0.3');
     39define('STOREBUILD_VERSION', '4.0.4');
    4040define('STOREBUILD_PATH', plugin_dir_path(__FILE__));
    4141define('STOREBUILD_URL', plugins_url('/', __FILE__));
Note: See TracChangeset for help on using the changeset viewer.