Plugin Directory

Changeset 3321046


Ignore:
Timestamp:
07/02/2025 08:42:34 AM (9 months ago)
Author:
mlmsoft
Message:

Version 3.9.5

Location:
mlm-soft-integration/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mlm-soft-integration/trunk/CHANGELOG.md

    r3308520 r3321046  
    22
    33## Changelog ##
     4
     5## 2025-07-01 - version 3.9.5
     6* Updated `EWalletCouponFrontend` class. [EWalletCouponFrontend.php]
     7* Prevent coupon being removed from URL. See an issue [MLM-3112] [EWalletCouponModule.php]
    48
    59## 2025-06-08 - version 3.9.4
  • mlm-soft-integration/trunk/integrations/woocommerce/paymentGateways/eWallet/coupons/EWalletCouponFrontend.php

    r3308520 r3321046  
    8888        }
    8989
     90        /**
     91         * @since 3.9.5
     92         */
     93        $removeElems = [
     94            '#major-publishing-actions',
     95            '.edit-post-status',
     96            '.edit-visibility',
     97            '.edit-timestamp',
     98            '#free_shipping',
     99            '#minor-publishing>div:first-child'
     100        ];
     101        if ( ! $this->hasUserManageCouponRole() ) {
     102            $removeElems[] = '#usage_restriction_coupon_data';
     103            $removeElems[] = '#usage_limit_coupon_data';
     104        }
     105        $removeElems = '"'.implode('","', $removeElems).'"';
    90106        ?>
    91107<script type='text/javascript'>
    92108    /* <![CDATA[ */
    93109    if ('function' === typeof jQuery) {
    94         let removeElems = ['#major-publishing-actions', '.edit-post-status', '.edit-visibility', '.edit-timestamp', '#free_shipping'];
     110        let removeElems = [<?php echo $removeElems; ?>];
    95111        removeElems.map((elem)=>{jQuery(elem).remove()});
    96112        let disableElems = ['#title','#discount_type','#coupon_amount','#expiry_date'];
  • mlm-soft-integration/trunk/integrations/woocommerce/paymentGateways/eWallet/modules/EWalletCouponModule.php

    r3042880 r3321046  
    2424        add_action('woocommerce_decrease_coupon_usage_count', [$this, 'decreaseCouponUsageCount']);
    2525        add_action(self::E_WALLET_COUPON_EXPIRED_ACTION, [$this, 'couponExpired'], 10, 1);
     26       
     27        /**
     28         * @since 3.9.5
     29         */
     30        add_action('wp_loaded', array($this, 'checkActions' ), 5);         
     31    }
     32
     33    /**
     34     * @since 3.9.5
     35     */
     36    public function checkActions()
     37    {
     38        /**
     39         * Prevent coupon being removed from URL.
     40         *
     41         * @see `update_cart_action` function in woocommerce\includes\class-wc-form-handler.php
     42         */
     43        if ( isset( $_GET['remove_coupon'] ) ) {
     44            $couponCode = sanitize_text_field($_GET['remove_coupon']);
     45            if ( EWalletCoupon::isEWalletCoupon($couponCode) ) {
     46                $redirect = wc_get_page_permalink('myaccount');
     47                wp_redirect($redirect);
     48                exit();
     49            }
     50        }
    2651    }
    2752
  • mlm-soft-integration/trunk/mlm-soft-integration.php

    r3308520 r3321046  
    44Plugin Name: MLM Soft Integration
    55Description: WP integration with mlm-soft.com cloud platform
    6 Version: 3.9.4
     6Version: 3.9.5
    77Author: MLM Soft Ltd.
    88Author URI: https://mlm-soft.com
Note: See TracChangeset for help on using the changeset viewer.