Changeset 3203768
- Timestamp:
- 12/06/2024 05:10:36 PM (16 months ago)
- Location:
- woo-price-from-in-variable-products/trunk
- Files:
-
- 6 added
- 5 edited
-
languages/woocommerce-price-from-in-variable-products-de_DE.mo (added)
-
languages/woocommerce-price-from-in-variable-products-de_DE.po (added)
-
languages/woocommerce-price-from-in-variable-products-es_ES.mo (added)
-
languages/woocommerce-price-from-in-variable-products-es_ES.po (added)
-
languages/woocommerce-price-from-in-variable-products-fr_FR.mo (added)
-
languages/woocommerce-price-from-in-variable-products-fr_FR.po (added)
-
languages/woocommerce-price-from-in-variable-products-pt_PT.mo (modified) (previous)
-
languages/woocommerce-price-from-in-variable-products-pt_PT.po (modified) (3 diffs)
-
languages/woocommerce-price-from-in-variable-products.pot (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
woocommerce-price-from-in-variable-products.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
woo-price-from-in-variable-products/trunk/languages/woocommerce-price-from-in-variable-products-pt_PT.po
r2502775 r3203768 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: W ooCommerce Price From in Variable Products\n"3 "Project-Id-Version: WebDig.Dev WooCommerce Price From in Variable Products\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 20 19-04-21 06:14+0000\n"6 "PO-Revision-Date: 20 19-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" 9 9 "Language: pt_PT\n" 10 10 "Plural-Forms: nplurals=2; plural=n != 1;\n" … … 13 13 "Content-Transfer-Encoding: 8bit\n" 14 14 "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" 16 16 17 #: woocommerce-price-from-in-variable-products.php: 2418 #: woocommerce-price-from-in-variable-products.php: 2817 #: woocommerce-price-from-in-variable-products.php:32 18 #: woocommerce-price-from-in-variable-products.php:36 19 19 #, php-format 20 20 msgid "<span class=\"pricefrom\">From </span>%1$s" 21 msgstr "<span class=\ "pricefrom\">Desde </span>%1$s"21 msgstr "<span class=\\\"pricefrom\\\">Desde </span>%1$s" 22 22 23 #: woocommerce-price-from-in-variable-products.php: 5923 #: woocommerce-price-from-in-variable-products.php:72 24 24 #, php-format 25 25 msgid "From %1$s" 26 26 msgstr "Desde %1$s" 27 27 28 #. Debug message 29 msgid "HPOS is enabled, and the plugin is compatible." 30 msgstr "O HPOS está ativado e o plugin é compatível." 31 32 #. Debug message 33 msgid "HPOS is not enabled, or there is a compatibility issue." 34 msgstr "O HPOS não está ativado ou existe um problema de compatibilidade." 35 28 36 #. URI of the plugin 29 37 #. Author URI of the plugin 30 msgid "https://webdig.pt" 31 msgstr "https://webdig.pt" 38 msgid "https://webdig.dev" 39 msgstr "https://webdig.dev" 40 41 #. Instruction message 42 msgid "" 43 "No additional configuration is required. The plugin will automatically " 44 "adjust price display for variable and grouped products." 45 msgstr "" 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." 32 48 33 49 #. Description of the plugin 34 50 msgid "" 35 51 "Show only the lowest prices in WooCommerce variable products and lowest sale " 36 "price "52 "price." 37 53 msgstr "" 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 58 msgid "" 59 "This plugin is fully compatible with WooCommerce High-Performance Order " 60 "Storage (HPOS) and Remote Logging." 61 msgstr "" 62 "Este plugin é totalmente compatível com o WooCommerce High-Performance Order " 63 "Storage (HPOS) e Registo Remoto." 40 64 41 65 #. Author of the plugin … … 44 68 45 69 #. Name of the plugin 46 msgid "W ooCommerce Price From in Variable Products"47 msgstr "W ooCommerce PreçosDesde em Produtos Variáveis"70 msgid "WebDig.Dev WooCommerce Price From in Variable Products" 71 msgstr "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 #, fuzzy2 1 msgid "" 3 2 msgstr "" 4 "Project-Id-Version: W ooCommerce Price From in Variable Products\n"3 "Project-Id-Version: WebDig.Dev WooCommerce Price From in Variable Products\n" 5 4 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 20 19-04-21 06:14+0000\n"5 "POT-Creation-Date: 2024-12-06 16:00+0000\n" 7 6 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 9 8 "Language-Team: \n" 10 9 "Language: \n" 11 "Plural-Forms: nplurals= INTEGER; plural=EXPRESSION;\n"10 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 12 11 "MIME-Version: 1.0\n" 13 12 "Content-Type: text/plain; charset=UTF-8\n" 14 13 "Content-Transfer-Encoding: 8bit\n" 15 14 "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" 17 16 18 #: woocommerce-price-from-in-variable-products.php: 2419 #: woocommerce-price-from-in-variable-products.php: 2817 #: woocommerce-price-from-in-variable-products.php:32 18 #: woocommerce-price-from-in-variable-products.php:36 20 19 #, php-format 21 20 msgid "<span class=\"pricefrom\">From </span>%1$s" 22 21 msgstr "" 23 22 24 #: woocommerce-price-from-in-variable-products.php: 5923 #: woocommerce-price-from-in-variable-products.php:72 25 24 #, php-format 26 25 msgid "From %1$s" … … 29 28 #. URI of the plugin 30 29 #. Author URI of the plugin 31 msgid "https://webdig. pt"30 msgid "https://webdig.dev" 32 31 msgstr "" 33 32 … … 35 34 msgid "" 36 35 "Show only the lowest prices in WooCommerce variable products and lowest sale " 37 "price "36 "price." 38 37 msgstr "" 39 38 … … 43 42 44 43 #. Name of the plugin 45 msgid "W ooCommerce Price From in Variable Products"44 msgid "WebDig.Dev WooCommerce Price From in Variable Products" 46 45 msgstr "" 46 47 #. Compatibility message 48 msgid "This plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS) and Remote Logging." 49 msgstr "" 50 51 #. Instruction message 52 msgid "No additional configuration is required. The plugin will automatically adjust price display for variable and grouped products." 53 msgstr "" 54 55 #. Debug message 56 msgid "HPOS is enabled, and the plugin is compatible." 57 msgstr "" 58 59 #. Debug message 60 msgid "HPOS is not enabled, or there is a compatibility issue." 61 msgstr "" -
woo-price-from-in-variable-products/trunk/readme.txt
r2968412 r3203768 1 === W ooCommerce -Price From in Variable Products ===1 === WebDig.Dev WooCommerce Price From in Variable Products === 2 2 Contributors: webdigpt 3 Tags: Woo commerce, Variations, Price, Prices, Sales Products, Variable Products, Price From4 Requires at least: 5. 25 Tested up to: 6. 3.16 Requires PHP: 5.2.47 Stable tag: trunk3 Tags: 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 4 Requires at least: 5.6 5 Tested up to: 6.7.1 6 Requires PHP: 7.4 7 Stable tag: 1.2.5 8 8 License: GPLv2+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Show only the lowest prices in WooCommerce variable products and lowest sale price 11 Show only the lowest prices in WooCommerce variable products and lowest sale price. 12 12 13 13 == Description == 14 Show only the lowest prices in WooCommerce variable products and lowest sale price to encourage sells. 14 WebDig.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 16 The plugin is fully compatible with WooCommerce's High-Performance Order Storage (HPOS) and Remote Logging, ensuring seamless integration with modern WooCommerce features. 15 17 16 18 == Installation == 17 Just activate the plugin and it’s done. 19 1. 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. 20 2. Activate the plugin through the 'Plugins' screen in WordPress. 21 3. No additional configuration is required. The plugin will automatically adjust price display for variable and grouped products. 18 22 19 23 == Screenshots == 20 1. WooCommerce Price From in Variable Products before plugin activation21 2. WooCommerce Price From in Variable Products after activation24 1. Default WooCommerce price display for variable products (before plugin activation). 25 2. Modified price display after activating the plugin. 22 26 23 27 == Changelog == 24 28 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 25 72 = 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. 29 75 30 76 = 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. 33 78 34 79 = 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 1 1 <?php 2 2 /* 3 * Plugin Name: W ooCommerce Price From in Variable Products4 * Plugin URI: https:// plugins.webdig.pt5 * 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. 6 6 * Author: WebDig 7 * Version: 1. 0.28 * Author URI: https://webdig. pt7 * Version: 1.2.5 8 * Author URI: https://webdig.dev 9 9 * Text Domain: woocommerce-price-from-in-variable-products 10 10 * 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 13 16 * 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 19 defined( 'ABSPATH' ) or exit; // Segurança 20 21 // Declarar compatibilidade com HPOS 22 add_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 31 add_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 40 function woocommerce_price_from_load_textdomain() { 41 load_plugin_textdomain( 'woocommerce-price-from-in-variable-products', false, plugin_dir_path( __FILE__ ) . 'languages/' ); 18 42 } 19 add_action( 'plugins_loaded', 'woocommerce_price_from_in_variable_products_load_plugin_textdomain' ); 20 //Simple products 43 add_action( 'plugins_loaded', 'woocommerce_price_from_load_textdomain' ); 44 45 // Formatação de Preços - Produtos Variáveis 21 46 function 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 } 31 59 } 32 60 return $price; 33 61 } 62 add_filter( 'woocommerce_variable_price_html', 'wc_variation_price_format', 10, 2 ); 34 63 add_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 );36 64 37 //Grouped products 38 // Show product prices in WooCommerce 2.0 format 65 // Preços em Produtos Agrupados 66 function 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 } 39 83 add_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.