Plugin Directory

Changeset 3486821


Ignore:
Timestamp:
03/19/2026 08:50:22 PM (9 days ago)
Author:
routedev
Message:

Fix checkout order summary not updating when Route protection is toggled on blocks-based checkout

Location:
routeapp/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • routeapp/trunk/public/js/routeapp-public-pbc.js

    r3473063 r3486821  
    6767         */
    6868        function triggerBlocksCheckoutCartUpdate() {
    69             if (isBlocksCheckoutAvailable()) {
    70                 try {
    71                     wc.blocksCheckout.extensionCartUpdate({
    72                         namespace: 'route-widget-integration',
    73                         data: {
    74                             checkbox: RouteConfig.checkbox === Route.Coverage.ActiveByDefault
    75                         }
    76                     }).then(function() {
    77                         // Cart update successful - the frontend will automatically refresh
    78                     }).catch(function(error) {
    79                         console.error('Route widget: Cart update failed:', error);
    80                         // Fallback to traditional checkout update
    81                         triggerCheckoutUpdate();
    82                     });
    83                 } catch (error) {
    84                     console.error('Route widget: Error triggering blocks checkout update:', error);
    85                     // Fallback to traditional checkout update
     69            if (!isBlocksCheckoutAvailable()) {
     70                triggerCheckoutUpdate();
     71                return;
     72            }
     73
     74            try {
     75                wc.blocksCheckout.extensionCartUpdate({
     76                    namespace: 'route-widget-integration',
     77                    data: {
     78                        checkbox: RouteConfig.checkbox === Route.Coverage.ActiveByDefault
     79                    }
     80                }).catch(function(error) {
     81                    console.error('Route widget: Cart update failed:', error);
     82                }).finally(function() {
    8683                    triggerCheckoutUpdate();
    87                 }
    88             } else {
    89                 // Fallback to traditional checkout update if blocks checkout is not available
     84                });
     85            } catch (error) {
     86                console.error('Route widget: Error triggering blocks checkout update:', error);
    9087                triggerCheckoutUpdate();
    9188            }
     
    10299                },
    103100                success: function () {
    104                     if (RouteConfig.is_cart_page) {
     101                    if (isBlocksCheckoutAvailable()) {
     102                        triggerBlocksCheckoutCartUpdate();
     103                    } else if (RouteConfig.is_cart_page) {
    105104                        triggerCartUpdate();
    106105                    } else {
    107                         // Use blocks checkout update if available, otherwise fallback to traditional
    108                         if (isBlocksCheckoutAvailable()) {
    109                             triggerBlocksCheckoutCartUpdate();
    110                         } else {
    111                             triggerCheckoutUpdate();
    112                         }
     106                        triggerCheckoutUpdate();
    113107                    }
    114108
  • routeapp/trunk/readme.txt

    r3473063 r3486821  
    66Requires at least: 4.0
    77Tested up to: 6.7.1
    8 Stable tag: 2.3.0
     8Stable tag: 2.3.1
    99Requires PHP: 5.6
    1010License: GPLv2 or later
     
    106106
    107107== Changelog ==
     108
     109= 2.3.1 =
     110* Fix checkout order summary not updating when Route protection is toggled on blocks-based checkout
    108111
    109112= 2.3.0 =
  • routeapp/trunk/routeapp.php

    r3473063 r3486821  
    1010 * Plugin URI:        https://route.com/for-merchants/
    1111 * Description:       Route allows shoppers to insure their orders with one-click during checkout, adding a layer of 3rd party trust while improving the customer shopping experience.
    12  * Version:           2.3.0
     12 * Version:           2.3.1
    1313 * Author:            Route
    1414 * Author URI:        https://route.com/
     
    2626 * Currently plugin version.
    2727 */
    28 define( 'ROUTEAPP_VERSION', '2.3.0' );
     28define( 'ROUTEAPP_VERSION', '2.3.1' );
    2929
    3030/**
Note: See TracChangeset for help on using the changeset viewer.