Plugin Directory

Changeset 3231619


Ignore:
Timestamp:
01/30/2025 01:20:02 AM (12 months ago)
Author:
MarkTomlinson
Message:

4.3.4

*Release Date: January 2025*

Bug Fixes

  • Fixed a misnamed function in abstract class priceUpdateHandler
  • Corrected for a WP issue regarding update_post_meta()
Location:
markup-by-attribute-for-woocommerce/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • markup-by-attribute-for-woocommerce/trunk/markup-by-attribute-for-woocommerce.php

    r3228316 r3231619  
    88 *
    99 * @package markup-by-attribute-for-woocommerce
    10  * @version 4.3.2
     10 * @version 4.3.4
    1111 * @license GPL-2.0+
    1212 */
     
    2424 * Text Domain:             markup-by-attribute
    2525 * Domain Path:             /languages
    26  * Version:                 4.3.3
     26 * Version:                 4.3.4
    2727 * Stable tag:              trunk
    2828 * Tested up to:            6.7.1
     
    9393    // Set plugin information
    9494    define('MT2MBA_PLUGIN_PREFIX', 'MT2MBA');
    95     define('MT2MBA_VERSION', '4.3.3');
     95    define('MT2MBA_VERSION', '4.3.4');
    9696    define('MT2MBA_DB_VERSION', 2.2);
    9797    define('MT2MBA_SITE_URL', get_bloginfo('wpurl'));
     
    117117             *
    118118            array("message_name", "This is a dismissable messages."),
    119              *
    120119             */
    121120        ],
  • markup-by-attribute-for-woocommerce/trunk/readme.txt

    r3228316 r3231619  
    1010License:                GPLv3
    1111License URI:            https://www.gnu.org/licenses/gpl-3.0.html
    12 Version:                4.3.3
     12Version:                4.3.4
    1313Stable tag:             trunk
    1414Tested up to:           6.7.1
     
    186186
    187187== 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
    188201= 4.3.3 =
    189202*Release Date: January 2025*
  • markup-by-attribute-for-woocommerce/trunk/src/backend/handlers/pricesethandler.php

    r3217045 r3231619  
    77 * Used when directly setting variation prices through bulk actions.
    88 *
    9  * @package mt2Tech\MarkupByAttribute\Backend\Handlers
     9 * @package mt2Tech\MarkupByAttribute\Backend\Handlers
    1010 */
    1111class PriceSetHandler extends PriceMarkupHandler {
     
    8989                if ($this->base_price == 0 && MT2MBA_ALLOW_ZERO === 'yes') {
    9090                    // 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}");
    9194                    update_post_meta($product_id, "mt2mba_base_{$this->price_type}", 0);
    9295                    // Fall through to Regular Price check
     
    98101                }
    99102
    100             // Else ({base_price} is not numeric,
    101             } else {
     103            } else {    // Else ({base_price} is not numeric,
    102104                // Remove {price_type} base price metadata
    103105                delete_post_meta($product_id, "mt2mba_base_{$this->price_type}");
     
    241243     */
    242244    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}");
    243248        update_post_meta($product_id, "mt2mba_base_{$this->price_type}", $rounded_base);
    244249        if ($this->price_type === REGULAR_PRICE) {
     
    287292     * Combines existing description with markup details based on settings.
    288293     *
    289      * @param   WC_Product $variation           The variation product object
    290      * @param   string   $base_price_description Base price description text
    291      * @param   string   $markup_description   Markup-specific description text
    292      * @param   float     $variation_price    The calculated variation price
    293      * @return string Complete variation description
     294     * @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
    294299     */
    295300    protected function buildVariationDescription($variation, $base_price_description, $markup_description, $variation_price) {
  • markup-by-attribute-for-woocommerce/trunk/src/backend/handlers/priceupdatehandler.php

    r3217045 r3231619  
    2929     * @param   array   $variations     List of variation IDs
    3030     */
    31     public function calculateAndApplyMarkups($bulk_action, $data, $product_id, $variations) {
     31    public function processProductMarkups ($bulk_action, $data, $product_id, $variations) {
    3232        // If base price metadata is present, that means the product contains variables with attribute pricing.
    3333        $base_price = get_metadata("post", $product_id, "mt2mba_base_{$this->price_type}", true);
     
    4747            //   * variable_sale_price
    4848            $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);
    5050        }
    5151    }
  • markup-by-attribute-for-woocommerce/trunk/src/backend/product.php

    r3228226 r3231619  
    2929        // Add base price fields to product general options panel
    3030        add_action('woocommerce_product_options_general_product_data', [$this, 'addBasePriceFields']);
     31
    3132        // 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']);
    3334
    3435        // Handle AJAX requests to get formatted base price for confirmation messages
  • markup-by-attribute-for-woocommerce/trunk/src/backend/settings.php

    r3228316 r3231619  
    240240                'name'      => __('Max Variations', 'markup-by-attribute-for-woocommerce'),
    241241                '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'),
    245245                'id'        => 'mt2mba_max_variations',
    246246                'type'      => 'number',
  • markup-by-attribute-for-woocommerce/trunk/src/frontend/options.php

    r3228226 r3231619  
    9494        $class                  = $args['class'];
    9595        $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');
    9797        $options                = $args['options'];
    9898   
Note: See TracChangeset for help on using the changeset viewer.