Changeset 3231619
- Timestamp:
- 01/30/2025 01:20:02 AM (12 months ago)
- Location:
- markup-by-attribute-for-woocommerce/trunk
- Files:
-
- 7 edited
-
markup-by-attribute-for-woocommerce.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
src/backend/handlers/pricesethandler.php (modified) (5 diffs)
-
src/backend/handlers/priceupdatehandler.php (modified) (2 diffs)
-
src/backend/product.php (modified) (1 diff)
-
src/backend/settings.php (modified) (1 diff)
-
src/frontend/options.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
markup-by-attribute-for-woocommerce/trunk/markup-by-attribute-for-woocommerce.php
r3228316 r3231619 8 8 * 9 9 * @package markup-by-attribute-for-woocommerce 10 * @version 4.3. 210 * @version 4.3.4 11 11 * @license GPL-2.0+ 12 12 */ … … 24 24 * Text Domain: markup-by-attribute 25 25 * Domain Path: /languages 26 * Version: 4.3. 326 * Version: 4.3.4 27 27 * Stable tag: trunk 28 28 * Tested up to: 6.7.1 … … 93 93 // Set plugin information 94 94 define('MT2MBA_PLUGIN_PREFIX', 'MT2MBA'); 95 define('MT2MBA_VERSION', '4.3. 3');95 define('MT2MBA_VERSION', '4.3.4'); 96 96 define('MT2MBA_DB_VERSION', 2.2); 97 97 define('MT2MBA_SITE_URL', get_bloginfo('wpurl')); … … 117 117 * 118 118 array("message_name", "This is a dismissable messages."), 119 *120 119 */ 121 120 ], -
markup-by-attribute-for-woocommerce/trunk/readme.txt
r3228316 r3231619 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl-3.0.html 12 Version: 4.3. 312 Version: 4.3.4 13 13 Stable tag: trunk 14 14 Tested up to: 6.7.1 … … 186 186 187 187 == Changelog == 188 = 4.3.4 = 189 *Release Date: January 2025* 190 191 **Bug Fixes** 192 * Fixed a misnamed function in abstract class priceUpdateHandler 193 * Corrected for a WP issue regarding update_post_meta() 194 195 = 4.3.2 = 196 *Release Date: January 2025* 197 198 **Features** 199 * Added Spanish translation files. Plugin now supports German, French, Italian, Polish, Swedish, and Spanish translations 200 188 201 = 4.3.3 = 189 202 *Release Date: January 2025* -
markup-by-attribute-for-woocommerce/trunk/src/backend/handlers/pricesethandler.php
r3217045 r3231619 7 7 * Used when directly setting variation prices through bulk actions. 8 8 * 9 * @package mt2Tech\MarkupByAttribute\Backend\Handlers9 * @package mt2Tech\MarkupByAttribute\Backend\Handlers 10 10 */ 11 11 class PriceSetHandler extends PriceMarkupHandler { … … 89 89 if ($this->base_price == 0 && MT2MBA_ALLOW_ZERO === 'yes') { 90 90 // Set {price_type} base price metadata to 0 91 // update_post_meta() does not appear to change cached records. Deleting the 92 // record before rewriting it appears to be the only way to update the cache. 93 delete_post_meta($product_id, "mt2mba_base_{$this->price_type}"); 91 94 update_post_meta($product_id, "mt2mba_base_{$this->price_type}", 0); 92 95 // Fall through to Regular Price check … … 98 101 } 99 102 100 // Else ({base_price} is not numeric, 101 } else { 103 } else { // Else ({base_price} is not numeric, 102 104 // Remove {price_type} base price metadata 103 105 delete_post_meta($product_id, "mt2mba_base_{$this->price_type}"); … … 241 243 */ 242 244 private function handleBasePriceUpdate($product_id, $rounded_base) { 245 // update_post_meta() does not appear to change cached records. Deleting the 246 // record before rewriting it appears to be the only way to update the cache. 247 delete_post_meta($product_id, "mt2mba_base_{$this->price_type}"); 243 248 update_post_meta($product_id, "mt2mba_base_{$this->price_type}", $rounded_base); 244 249 if ($this->price_type === REGULAR_PRICE) { … … 287 292 * Combines existing description with markup details based on settings. 288 293 * 289 * @param WC_Product $variationThe variation product object290 * @param string $base_price_descriptionBase price description text291 * @param string $markup_descriptionMarkup-specific description text292 * @param float $variation_priceThe calculated variation price293 * @return stringComplete variation description294 * @param WC_Product $variation The variation product object 295 * @param string $base_price_description Base price description text 296 * @param string $markup_description Markup-specific description text 297 * @param float $variation_price The calculated variation price 298 * @return string Complete variation description 294 299 */ 295 300 protected function buildVariationDescription($variation, $base_price_description, $markup_description, $variation_price) { -
markup-by-attribute-for-woocommerce/trunk/src/backend/handlers/priceupdatehandler.php
r3217045 r3231619 29 29 * @param array $variations List of variation IDs 30 30 */ 31 public function calculateAndApplyMarkups($bulk_action, $data, $product_id, $variations) {31 public function processProductMarkups ($bulk_action, $data, $product_id, $variations) { 32 32 // If base price metadata is present, that means the product contains variables with attribute pricing. 33 33 $base_price = get_metadata("post", $product_id, "mt2mba_base_{$this->price_type}", true); … … 47 47 // * variable_sale_price 48 48 $handler = new PriceSetHandler("variable_{$this->price_type}", $new_data, $product_id, $variations); 49 $handler-> calculateAndApplyMarkups($bulk_action, $data, $product_id, $variations);49 $handler->processProductMarkups ($bulk_action, $data, $product_id, $variations); 50 50 } 51 51 } -
markup-by-attribute-for-woocommerce/trunk/src/backend/product.php
r3228226 r3231619 29 29 // Add base price fields to product general options panel 30 30 add_action('woocommerce_product_options_general_product_data', [$this, 'addBasePriceFields']); 31 31 32 // Handle AJAX requests to reapply markups to variations 32 add_action('wp_ajax_handleMarkupReapplication', [$this, 'handleMarkupReapplication'] , 10, 1);33 add_action('wp_ajax_handleMarkupReapplication', [$this, 'handleMarkupReapplication']); 33 34 34 35 // Handle AJAX requests to get formatted base price for confirmation messages -
markup-by-attribute-for-woocommerce/trunk/src/backend/settings.php
r3228316 r3231619 240 240 'name' => __('Max Variations', 'markup-by-attribute-for-woocommerce'), 241 241 'desc' => __('Maximum number of variations that can be created per run.', 'markup-by-attribute-for-woocommerce') . '<br/>' . 242 __( '<em>Use Cautiously:</em> WooCommerce limits the number of linked variations you can create at a time to 50 to prevent server overload. '.243 'Setting the number too high can cause timeout errors; you may have to experiment. '.244 'You can always create more by running \'Create variations from all attributes\' again.', 'markup-by-attribute-for-woocommerce'),242 __("<em>Use Cautiously:</em> WooCommerce limits the number of linked variations you can create at a time to 50 to " . 243 "prevent server overload. Setting the number too high can cause timeout errors; you may have to experiment. You " . 244 "can always create more by running 'Create variations from all attributes' again.", 'markup-by-attribute-for-woocommerce'), 245 245 'id' => 'mt2mba_max_variations', 246 246 'type' => 'number', -
markup-by-attribute-for-woocommerce/trunk/src/frontend/options.php
r3228226 r3231619 94 94 $class = $args['class']; 95 95 $show_option_none = $args['show_option_none'] ? TRUE : FALSE; 96 $show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __('Choose an option', ' woocommerce');96 $show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __('Choose an option', 'markup-by-attribute-for-woocommerce'); 97 97 $options = $args['options']; 98 98
Note: See TracChangeset
for help on using the changeset viewer.