runamuk0
runamuk0

Reputation: 784

Upgrade to Woocommerce 2.3.10 caused checkout to block

Environment:

I just upgraded to WC 2.3.10 and then tried a test purchase. When I got to the checkout page the checkout area is grayed out (class="blockUI blockOverlay") and you cannot continue the purchase. This was working prior to the update using WC 2.3.8. The code below seems to be the problem. If I remove or comment it out then the checkout works, however the UPS shipping fails. The code updates the weight, height, length and width so that the UPS shipping will calculate correctly. I have tried numerous variations with no resolution.

// This updates the cart data prior to the shipping calculations
add_action('woocommerce_before_calculate_totals', 'rs_before_calculate_totals');
function rs_before_calculate_totals($cart_object) {
    foreach ($cart_object->cart_contents as $key => $value) {
        if ($value['product_id'] == PRICECALCPRODUCTNUMBER) {
            $addons = $value['addons'];
            foreach ($addons as $addon) {
                if ($addon['name'] == 'Custom Weight - Value') {
                    echo $addon['name'] . ' - ' . $addon['value'] . "<br/>";
                    $value['data']->weight = $addon['value'];
                }

                if ($addon['name'] == 'Custom Width - Value') {
                    echo $addon['name'] . ' - ' . $addon['value'] . "<br/>";
                    $value['data']->width = $addon['value'];
                }

                if ($addon['name'] == 'Custom Height - Value') {
                    echo $addon['name'] . ' - ' . $addon['value'] . "<br/>";
                    $value['data']->height = $addon['value'];
                }

                if ($addon['name'] == 'Custom Length - Value') {
                    echo $addon['name'] . ' - ' . $addon['value'] . "<br/>";
                    $value['data']->length = $addon['value'];
                }
            }
        }
    }
}

Upvotes: 0

Views: 1192

Answers (2)

runamuk0
runamuk0

Reputation: 784

I finally found the answer to the problem. I had inserted "echo" statements in the functions.php for my theme and this was causing a hidden error condition that I could not see. I removed the "echo" statements and things started working again.

Upvotes: 1

user290456
user290456

Reputation: 25

I also am getting the greyed out "blockUI blockOverlay" effect, as of this latest woocommerce 2.3.10, and from your environment I see we share the same theme - storefront. (and same WP: 4.2.2).

For me, PayPal works fine, and Stripe will successfully accept payment but then greys out like yours and never progresses to the thank you page. Still searching for solution.

Upvotes: 0

Related Questions