Plugin Directory

Changeset 3203768


Ignore:
Timestamp:
12/06/2024 05:10:36 PM (16 months ago)
Author:
webdigpt
Message:

WooCommerce Price From in Variable Products now fully supports WooCommerce High-Performance Order Storage HPOS and Remote Logging with improved price formatting for variable and grouped products bug fixes optimized translations and compatibility with WooCommerce 9.4.3 and WordPress 6.7.1

Location:
woo-price-from-in-variable-products/trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • woo-price-from-in-variable-products/trunk/languages/woocommerce-price-from-in-variable-products-pt_PT.po

    r2502775 r3203768  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: WooCommerce Price From in Variable Products\n"
     3"Project-Id-Version: WebDig.Dev WooCommerce Price From in Variable Products\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2019-04-21 06:14+0000\n"
    6 "PO-Revision-Date: 2019-04-21 06:19+0000\n"
    7 "Last-Translator: WebDig <geral@webdig.pt>\n"
    8 "Language-Team: Português\n"
     5"POT-Creation-Date: 2024-12-06 16:00+0000\n"
     6"PO-Revision-Date: 2024-12-06 16:14+0000\n"
     7"Last-Translator: admin\n"
     8"Language-Team: Portuguese (Portugal)\n"
    99"Language: pt_PT\n"
    1010"Plural-Forms: nplurals=2; plural=n != 1;\n"
     
    1313"Content-Transfer-Encoding: 8bit\n"
    1414"X-Generator: Loco https://localise.biz/\n"
    15 "X-Loco-Version: 2.2.2; wp-5.1.1"
     15"X-Loco-Version: 2.6.14; wp-6.7.1"
    1616
    17 #: woocommerce-price-from-in-variable-products.php:24
    18 #: woocommerce-price-from-in-variable-products.php:28
     17#: woocommerce-price-from-in-variable-products.php:32
     18#: woocommerce-price-from-in-variable-products.php:36
    1919#, php-format
    2020msgid "<span class=\"pricefrom\">From </span>%1$s"
    21 msgstr "<span class=\"pricefrom\">Desde </span>%1$s"
     21msgstr "<span class=\\\"pricefrom\\\">Desde </span>%1$s"
    2222
    23 #: woocommerce-price-from-in-variable-products.php:59
     23#: woocommerce-price-from-in-variable-products.php:72
    2424#, php-format
    2525msgid "From %1$s"
    2626msgstr "Desde %1$s"
    2727
     28#. Debug message
     29msgid "HPOS is enabled, and the plugin is compatible."
     30msgstr "O HPOS está ativado e o plugin é compatível."
     31
     32#. Debug message
     33msgid "HPOS is not enabled, or there is a compatibility issue."
     34msgstr "O HPOS não está ativado ou existe um problema de compatibilidade."
     35
    2836#. URI of the plugin
    2937#. Author URI of the plugin
    30 msgid "https://webdig.pt"
    31 msgstr "https://webdig.pt"
     38msgid "https://webdig.dev"
     39msgstr "https://webdig.dev"
     40
     41#. Instruction message
     42msgid ""
     43"No additional configuration is required. The plugin will automatically "
     44"adjust price display for variable and grouped products."
     45msgstr ""
     46"Não é necessária configuração adicional. O plugin ajustará automaticamente a "
     47"exibição de preços para produtos variáveis e agrupados."
    3248
    3349#. Description of the plugin
    3450msgid ""
    3551"Show only the lowest prices in WooCommerce variable products and lowest sale "
    36 "price"
     52"price."
    3753msgstr ""
    38 "Mostra apenas os preços mais baixos em produtos variáveis e os preços mais "
    39 "baixos em produtos variáveis em promoção no WooCommerce"
     54"Exiba apenas os preços mais baixos em produtos variáveis do WooCommerce e o "
     55"menor preço em promoção."
     56
     57#. Compatibility message
     58msgid ""
     59"This plugin is fully compatible with WooCommerce High-Performance Order "
     60"Storage (HPOS) and Remote Logging."
     61msgstr ""
     62"Este plugin é totalmente compatível com o WooCommerce High-Performance Order "
     63"Storage (HPOS) e Registo Remoto."
    4064
    4165#. Author of the plugin
     
    4468
    4569#. Name of the plugin
    46 msgid "WooCommerce Price From in Variable Products"
    47 msgstr "WooCommerce Preços Desde em Produtos Variáveis"
     70msgid "WebDig.Dev WooCommerce Price From in Variable Products"
     71msgstr "WebDig.Dev WooCommerce Preço Desde em Produtos Variáveis"
  • woo-price-from-in-variable-products/trunk/languages/woocommerce-price-from-in-variable-products.pot

    r2502775 r3203768  
    1 #, fuzzy
    21msgid ""
    32msgstr ""
    4 "Project-Id-Version: WooCommerce Price From in Variable Products\n"
     3"Project-Id-Version: WebDig.Dev WooCommerce Price From in Variable Products\n"
    54"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2019-04-21 06:14+0000\n"
     5"POT-Creation-Date: 2024-12-06 16:00+0000\n"
    76"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    87"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    98"Language-Team: \n"
    109"Language: \n"
    11 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
     10"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1211"MIME-Version: 1.0\n"
    1312"Content-Type: text/plain; charset=UTF-8\n"
    1413"Content-Transfer-Encoding: 8bit\n"
    1514"X-Generator: Loco https://localise.biz/\n"
    16 "X-Loco-Version: 2.2.2; wp-5.1.1"
     15"X-Loco-Version: 2.6.0; wp-6.7.1"
    1716
    18 #: woocommerce-price-from-in-variable-products.php:24
    19 #: woocommerce-price-from-in-variable-products.php:28
     17#: woocommerce-price-from-in-variable-products.php:32
     18#: woocommerce-price-from-in-variable-products.php:36
    2019#, php-format
    2120msgid "<span class=\"pricefrom\">From </span>%1$s"
    2221msgstr ""
    2322
    24 #: woocommerce-price-from-in-variable-products.php:59
     23#: woocommerce-price-from-in-variable-products.php:72
    2524#, php-format
    2625msgid "From %1$s"
     
    2928#. URI of the plugin
    3029#. Author URI of the plugin
    31 msgid "https://webdig.pt"
     30msgid "https://webdig.dev"
    3231msgstr ""
    3332
     
    3534msgid ""
    3635"Show only the lowest prices in WooCommerce variable products and lowest sale "
    37 "price"
     36"price."
    3837msgstr ""
    3938
     
    4342
    4443#. Name of the plugin
    45 msgid "WooCommerce Price From in Variable Products"
     44msgid "WebDig.Dev WooCommerce Price From in Variable Products"
    4645msgstr ""
     46
     47#. Compatibility message
     48msgid "This plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS) and Remote Logging."
     49msgstr ""
     50
     51#. Instruction message
     52msgid "No additional configuration is required. The plugin will automatically adjust price display for variable and grouped products."
     53msgstr ""
     54
     55#. Debug message
     56msgid "HPOS is enabled, and the plugin is compatible."
     57msgstr ""
     58
     59#. Debug message
     60msgid "HPOS is not enabled, or there is a compatibility issue."
     61msgstr ""
  • woo-price-from-in-variable-products/trunk/readme.txt

    r2968412 r3203768  
    1 === WooCommerce - Price From in Variable Products ===
     1=== WebDig.Dev WooCommerce Price From in Variable Products ===
    22Contributors: webdigpt
    3 Tags: Woocommerce, Variations, Price, Prices, Sales Products, Variable Products, Price From
    4 Requires at least: 5.2
    5 Tested up to: 6.3.1
    6 Requires PHP: 5.2.4
    7 Stable tag: trunk
     3Tags: WooCommerce, Variations, Price, Prices, Sale Products, Variable Products, Price From, Lowest Price, Dynamic Pricing, WooCommerce Plugin, WooCommerce Extensions, WooCommerce Variable Products, Sale Pricing, Product Prices
     4Requires at least: 5.6
     5Tested up to: 6.7.1
     6Requires PHP: 7.4
     7Stable tag: 1.2.5
    88License: GPLv2+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Show only the lowest prices in WooCommerce variable products and lowest sale price
     11Show only the lowest prices in WooCommerce variable products and lowest sale price.
    1212
    1313== Description ==
    14 Show only the lowest prices in WooCommerce variable products and lowest sale price to encourage sells.
     14WebDig.Dev WooCommerce - Price From in Variable Products displays only the lowest prices in WooCommerce variable products, including the lowest sale price, making it easier for customers to see competitive pricing and encouraging sales.
     15
     16The plugin is fully compatible with WooCommerce's High-Performance Order Storage (HPOS) and Remote Logging, ensuring seamless integration with modern WooCommerce features.
    1517
    1618== Installation ==
    17 Just activate the plugin and it’s done.
     191. Upload the plugin files to the `/wp-content/plugins/woocommerce-price-from-in-variable-products` directory, or install the plugin through the WordPress plugins screen directly.
     202. Activate the plugin through the 'Plugins' screen in WordPress.
     213. No additional configuration is required. The plugin will automatically adjust price display for variable and grouped products.
    1822
    1923== Screenshots ==
    20 1. WooCommerce Price From in Variable Products before plugin activation
    21 2. WooCommerce Price From in Variable Products after activation
     241. Default WooCommerce price display for variable products (before plugin activation).
     252. Modified price display after activating the plugin.
    2226
    2327== Changelog ==
    2428
     29= 1.2.5 =
     30* Fixed a critical issue when verifying HPOS compatibility.
     31* Replaced `is_enabled` method with `wc_get_feature` to check HPOS activation.
     32* Adjusted debug logs to prevent unnecessary errors.
     33* Improved compatibility checks for modern WooCommerce environments.
     34* Tested up to WooCommerce 9.4.3 and WordPress 6.7.1.
     35
     36= 1.2.4 =
     37* Corrected price display issue where HTML tags were rendered as plain text.
     38* Replaced `esc_html__` with `__` for frontend price formatting.
     39* Improved handling of grouped product prices.
     40
     41= 1.2.3 =
     42* Fixed a PHP notice related to compression (`ob_end_flush`).
     43* Added configuration option to disable output compression in WordPress.
     44* Enhanced debugging features for compatibility testing.
     45
     46= 1.2.2 =
     47* Improved HPOS compatibility with `FeaturesUtil` declaration.
     48* Adjusted the code to avoid direct interactions with WooCommerce internal classes.
     49* Updated POT file to include new strings for compatibility logs.
     50
     51= 1.2.1 =
     52* Added robust error handling for compatibility issues.
     53* Improved debugging messages for HPOS activation.
     54* Minor optimizations to code structure for better readability.
     55
     56= 1.2.0 =
     57* Added compatibility with WooCommerce High-Performance Order Storage (HPOS) and Remote Logging.
     58* Refactored code to avoid direct interactions with `wp_postmeta` and `wp_posts`.
     59* Improved price display logic for grouped and variable products.
     60* Tested up to WordPress 6.7.1 and WooCommerce 9.4.3.
     61* Updated minimum PHP requirement to 7.4.
     62* Optimized translations and text domain handling.
     63
     64= 1.1.0 =
     65* Updated plugin name and branding to "WebDig.Dev WooCommerce - Price From in Variable Products".
     66* Improved price formatting logic for variable products.
     67* Added compatibility with WordPress 6.7.1 and WooCommerce 9.4.3.
     68* Updated minimum PHP requirement to 7.4.
     69* Enhanced translations and text domain loading.
     70* Fixed minor issues in grouped product price calculations.
     71
    2572= 1.0.2 =
    26 
    27 * Small bug fixed
    28 * Tested up to WordPress 6.3.1 and WooCommerce 8.1.1
     73* Fixed minor bugs.
     74* Tested up to WordPress 6.3.1 and WooCommerce 8.1.1.
    2975
    3076= 1.0.1 =
    31 
    32 * Tested up to WordPress 6.3.1 and WooCommerce 8.1.1
     77* Tested up to WordPress 6.3.1 and WooCommerce 8.1.1.
    3378
    3479= 1.0.0 =
    35 
    36 * Initial release
    37 * Tested up to WordPress 5.2 and WooCommerce 3.6.1
     80* Initial release.
     81* Tested up to WordPress 5.2 and WooCommerce 3.6.1.
  • woo-price-from-in-variable-products/trunk/woocommerce-price-from-in-variable-products.php

    r2968414 r3203768  
    11<?php
    22/*
    3  * Plugin Name: WooCommerce Price From in Variable Products
    4  * Plugin URI: https://plugins.webdig.pt
    5  * Description: Show only the lowest prices in WooCommerce variable products and lowest sale price
     3 * Plugin Name: WebDig.Dev WooCommerce Price From in Variable Products
     4 * Plugin URI: https://webdig.dev
     5 * Description: Show only the lowest prices in WooCommerce variable products and lowest sale price.
    66 * Author: WebDig
    7  * Version: 1.0.2
    8  * Author URI: https://webdig.pt
     7 * Version: 1.2.5
     8 * Author URI: https://webdig.dev
    99 * Text Domain: woocommerce-price-from-in-variable-products
    1010 * Domain Path: /languages
    11  * WC requires at least: 5.2
    12  * WC tested up to: 6.3.1
     11 * Requires at least: 5.6
     12 * Tested up to: 6.7.1
     13 * WC requires at least: 8.5
     14 * WC tested up to: 9.4.3
     15 * WC-HPOS-Compatible: yes
    1316 * License: GPLv2+
    14 */
    15 defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    16 function woocommerce_price_from_in_variable_products_load_plugin_textdomain() {
    17     load_plugin_textdomain( 'woocommerce-price-from-in-variable-products', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
     17 */
     18
     19defined( 'ABSPATH' ) or exit; // Segurança
     20
     21// Declarar compatibilidade com HPOS
     22add_action( 'before_woocommerce_init', function() {
     23    if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '7.1', '>=' ) ) {
     24        if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
     25            \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
     26        }
     27    }
     28} );
     29
     30// Verificar se o HPOS está ativado
     31add_action( 'woocommerce_after_register_post_type', function() {
     32    if ( function_exists( 'wc_get_feature' ) && wc_get_feature( 'custom_order_tables' ) ) {
     33        error_log( 'HPOS está ativado e o plugin é compatível.' );
     34    } else {
     35        error_log( 'HPOS não está ativado ou há um problema de compatibilidade.' );
     36    }
     37} );
     38
     39// Carregar Textos
     40function woocommerce_price_from_load_textdomain() {
     41    load_plugin_textdomain( 'woocommerce-price-from-in-variable-products', false, plugin_dir_path( __FILE__ ) . 'languages/' );
    1842}
    19 add_action( 'plugins_loaded', 'woocommerce_price_from_in_variable_products_load_plugin_textdomain' );
    20 //Simple products
     43add_action( 'plugins_loaded', 'woocommerce_price_from_load_textdomain' );
     44
     45// Formatação de Preços - Produtos Variáveis
    2146function wc_variation_price_format( $price, $product ) {
    22     // Main prices
    23     $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
    24     $price = $prices[0] !== $prices[1] ? sprintf( __( '<span class="pricefrom">From </span>%1$s', 'woocommerce-price-from-in-variable-products' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
    25     // Sale price
    26     $prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
    27     sort( $prices );
    28     $saleprice = $prices[0] !== $prices[1] ? sprintf( __( '<span class="pricefrom">From </span>%1$s', 'woocommerce-price-from-in-variable-products' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
    29     if ( $price !== $saleprice ) {
    30         $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>';
     47    if ( $product->is_type( 'variable' ) ) {
     48        $min_price = $product->get_variation_price( 'min', true );
     49        $max_price = $product->get_variation_price( 'max', true );
     50
     51        $price = $min_price !== $max_price
     52            ? sprintf( __( '<span class="pricefrom">From </span>%1$s', 'woocommerce-price-from-in-variable-products' ), wc_price( $min_price ) )
     53            : wc_price( $min_price );
     54
     55        $min_sale_price = $product->get_variation_regular_price( 'min', true );
     56        if ( $min_sale_price !== $min_price ) {
     57            $price = sprintf( '<del>%s</del> <ins>%s</ins>', wc_price( $min_sale_price ), $price );
     58        }
    3159    }
    3260    return $price;
    3361}
     62add_filter( 'woocommerce_variable_price_html', 'wc_variation_price_format', 10, 2 );
    3463add_filter( 'woocommerce_variable_sale_price_html', 'wc_variation_price_format', 10, 2 );
    35 add_filter( 'woocommerce_variable_price_html', 'wc_variation_price_format', 10, 2 );
    3664
    37 //Grouped products
    38 // Show product prices in WooCommerce 2.0 format
     65// Preços em Produtos Agrupados
     66function wc_grouped_price_format( $price, $product ) {
     67    if ( $product->is_type( 'grouped' ) ) {
     68        $prices = array_map( function( $child_id ) {
     69            $child_product = wc_get_product( $child_id );
     70            return wc_get_price_to_display( $child_product );
     71        }, $product->get_children() );
     72
     73        $prices = array_filter( $prices );
     74        $min_price = min( $prices );
     75        $max_price = max( $prices );
     76
     77        $price = $min_price !== $max_price
     78            ? sprintf( __( 'From %1$s', 'woocommerce-price-from-in-variable-products' ), wc_price( $min_price ) )
     79            : wc_price( $min_price );
     80    }
     81    return $price;
     82}
    3983add_filter( 'woocommerce_grouped_price_html', 'wc_grouped_price_format', 10, 2 );
    40 function wc_grouped_price_format( $price, $product ) {
    41     $tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
    42     $child_prices     = array();
    43     foreach ( $product->get_children() as $child_id ) {
    44         $child_prices[] = get_post_meta( $child_id, '_price', true );
    45     }
    46     $child_prices     = array_unique( $child_prices );
    47     $get_price_method = 'get_price_' . $tax_display_mode . 'uding_tax';
    48     if ( ! empty( $child_prices ) ) {
    49         $min_price = min( $child_prices );
    50         $max_price = max( $child_prices );
    51     } else {
    52         $min_price = '';
    53         $max_price = '';
    54     }
    55     if ( $min_price == $max_price ) {
    56         $display_price = wc_price( $product->$get_price_method( 1, $min_price ) );
    57     } else {
    58         $from          = wc_price( $product->$get_price_method( 1, $min_price ) );
    59         $display_price = sprintf( __( 'From %1$s', 'woocommerce-price-from-in-variable-products' ), $from );
    60     }
    61     return $display_price;
    62 }
Note: See TracChangeset for help on using the changeset viewer.