Plugin Directory

Changeset 3460410


Ignore:
Timestamp:
02/12/2026 11:26:45 PM (7 days ago)
Author:
pimwick
Message:

v2.7 - Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5

Location:
pw-woocommerce-affiliates
Files:
3 edited
30 copied

Legend:

Unmodified
Added
Removed
  • pw-woocommerce-affiliates/tags/2.7/changelog.txt

    r3419594 r3460410  
     1= 2.7 =
     2* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
     3
    14= 2.6 =
    25* Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
  • pw-woocommerce-affiliates/tags/2.7/pw-affiliates.php

    r3419594 r3460410  
    44 * Plugin URI: https://www.pimwick.com/affiliates/
    55 * Description: Affiliate tracking for your WooCommerce store.
    6  * Version: 2.6
     6 * Version: 2.7
    77 * Author: Pimwick, LLC
    88 * Author URI: https://www.pimwick.com
     
    1010 * Domain Path: /languages
    1111 * WC requires at least: 4.0
    12  * WC tested up to: 10.4
     12 * WC tested up to: 10.5
    1313 * Requires Plugins: woocommerce
    1414*/
     
    3131Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    3232*/
    33 define( 'PWWA_VERSION', '2.6' );
     33define( 'PWWA_VERSION', '2.7' );
    3434
    3535defined( 'ABSPATH' ) or exit;
     
    116116            add_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( $this, 'woocommerce_order_data_store_cpt_get_orders_query' ), 10, 2 );
    117117            add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'woocommerce_checkout_update_order_meta' ), 10, 2 );
     118            add_action( 'woocommerce_store_api_checkout_update_order_meta', array( $this, 'woocommerce_store_api_checkout_update_order_meta' ) );
    118119            add_action( 'woocommerce_cart_totals_before_order_total', array( $this, 'woocommerce_cart_totals_before_order_total' ) );
    119120            add_action( 'woocommerce_review_order_before_order_total', array( $this, 'woocommerce_review_order_before_order_total' ) );
     
    235236
    236237    function woocommerce_checkout_update_order_meta( $order_id, $data ) {
     238        $order = wc_get_order( $order_id );
     239        if ( $order ) {
     240            $this->process_affiliate_commission( $order );
     241        }
     242    }
     243
     244    function woocommerce_store_api_checkout_update_order_meta( $order ) {
     245        $this->process_affiliate_commission( $order );
     246    }
     247
     248    function process_affiliate_commission( $order ) {
     249        if ( $order->meta_exists( '_pw_affiliate_code' ) ) {
     250            return;
     251        }
     252
    237253        $code = $this->get_affiliate_code_from_session();
    238254        if ( empty( $code ) ) {
     
    242258        $affiliate = pwwa_get_active_affiliate( $code );
    243259        if ( $affiliate ) {
    244             $order = new WC_Order( $order_id );
    245 
    246260            $pre_tax = boolval( get_option( 'pw_affiliates_commission_before_tax', '1' ) );
    247261            $total_commission = 0;
  • pw-woocommerce-affiliates/tags/2.7/readme.txt

    r3419594 r3460410  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 2.6
     8Stable tag: 2.7
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363== Changelog ==
    6464
     65= 2.7 =
     66* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
     67
    6568= 2.6 =
    6669* Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
     
    9093* Compatibility with WordPress 6.5 and WooCommerce 8.7
    9194
    92 = 1.42 =
    93 * Confirmed compatibility with WordPress 6.4
    94 
    9595= Previous versions =
    9696* See changelog.txt
     
    9898== Upgrade Notice ==
    9999
    100 = 2.6 =
    101 * Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
     100= 2.7 =
     101* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
    102102
    103103
  • pw-woocommerce-affiliates/trunk/changelog.txt

    r3419594 r3460410  
     1= 2.7 =
     2* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
     3
    14= 2.6 =
    25* Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
  • pw-woocommerce-affiliates/trunk/pw-affiliates.php

    r3419594 r3460410  
    44 * Plugin URI: https://www.pimwick.com/affiliates/
    55 * Description: Affiliate tracking for your WooCommerce store.
    6  * Version: 2.6
     6 * Version: 2.7
    77 * Author: Pimwick, LLC
    88 * Author URI: https://www.pimwick.com
     
    1010 * Domain Path: /languages
    1111 * WC requires at least: 4.0
    12  * WC tested up to: 10.4
     12 * WC tested up to: 10.5
    1313 * Requires Plugins: woocommerce
    1414*/
     
    3131Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    3232*/
    33 define( 'PWWA_VERSION', '2.6' );
     33define( 'PWWA_VERSION', '2.7' );
    3434
    3535defined( 'ABSPATH' ) or exit;
     
    116116            add_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( $this, 'woocommerce_order_data_store_cpt_get_orders_query' ), 10, 2 );
    117117            add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'woocommerce_checkout_update_order_meta' ), 10, 2 );
     118            add_action( 'woocommerce_store_api_checkout_update_order_meta', array( $this, 'woocommerce_store_api_checkout_update_order_meta' ) );
    118119            add_action( 'woocommerce_cart_totals_before_order_total', array( $this, 'woocommerce_cart_totals_before_order_total' ) );
    119120            add_action( 'woocommerce_review_order_before_order_total', array( $this, 'woocommerce_review_order_before_order_total' ) );
     
    235236
    236237    function woocommerce_checkout_update_order_meta( $order_id, $data ) {
     238        $order = wc_get_order( $order_id );
     239        if ( $order ) {
     240            $this->process_affiliate_commission( $order );
     241        }
     242    }
     243
     244    function woocommerce_store_api_checkout_update_order_meta( $order ) {
     245        $this->process_affiliate_commission( $order );
     246    }
     247
     248    function process_affiliate_commission( $order ) {
     249        if ( $order->meta_exists( '_pw_affiliate_code' ) ) {
     250            return;
     251        }
     252
    237253        $code = $this->get_affiliate_code_from_session();
    238254        if ( empty( $code ) ) {
     
    242258        $affiliate = pwwa_get_active_affiliate( $code );
    243259        if ( $affiliate ) {
    244             $order = new WC_Order( $order_id );
    245 
    246260            $pre_tax = boolval( get_option( 'pw_affiliates_commission_before_tax', '1' ) );
    247261            $total_commission = 0;
  • pw-woocommerce-affiliates/trunk/readme.txt

    r3419594 r3460410  
    66Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 2.6
     8Stable tag: 2.7
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6363== Changelog ==
    6464
     65= 2.7 =
     66* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
     67
    6568= 2.6 =
    6669* Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
     
    9093* Compatibility with WordPress 6.5 and WooCommerce 8.7
    9194
    92 = 1.42 =
    93 * Confirmed compatibility with WordPress 6.4
    94 
    9595= Previous versions =
    9696* See changelog.txt
     
    9898== Upgrade Notice ==
    9999
    100 = 2.6 =
    101 * Confirmed compatibility with WordPress 6.9 and WooCommerce 10.4.
     100= 2.7 =
     101* Fixed an issue where affiliate commission might not apply when using Blocks based Cart and Checkout. Confirmed compatibility with WooCommerce 10.5
    102102
    103103
Note: See TracChangeset for help on using the changeset viewer.