Woocommerce 'Proceed to Paypal' button not working

Hi
My ‘proceed to paypal’ button is not working in checkout while x-child theme is active.

if i choose default x theme, or just wp 2019 theme it will work fine, but button just reloads the page if child theme is active.

i’ve tried restoring an old version of woocommerce, but same thing happens.
i’ve deactivated all plugins, which does not resolve it.
Seems to be related to the theme/child theme.

I have the latest versions of woo and x theme installed, and i’m using the Renew Stack

Can anyone help?

Thanks

Hello Little,

Thanks for writing in! Are you experiencing the issue in Moon Fruit Photography site? I have checked that site and the Proceed to Paypal button seems working on my end. Please clear your browser cache or use private browsing mode and test your site again.

Kindly let us know how it goes.

Hi Thanks for getting back to me.

i think i’ve identified the issue. it doesn’t seem to like a function i have in my child theme functions file. i was using it to add the referral meta to the customer order. it’s always worked before, (for a year or more) but for some reason it doesn’t like it now.

i’ve removed the function for now, but ideally i’d still like to have that on my orders. Any idea how?

Thanks

Hello Little,

Would you mind sharing the code you have added in your child theme’s functions.php?
There could be a missing character or incorrect syntax.

Thanks in advance.

This is the bit that seems to be causing the issue (which i’ve now removed)

add_action('woocommerce_checkout_update_order_meta', 'add_referral_meta'); 
function add_referral_meta( $order_id, $posted ){
	$ref_url = $_COOKIE['origin']; 
    update_post_meta( $order_id, 'referrer', $ref_url ); 
}

Hello Little,

Did you create this code or this came from a 3rd party developer? Please check this code with the creator. This might no longer be applicable with the latest WooCommerce version. You must test for conflict using an older version of WooCommerce and the latest one.

Please let us know how it goes.

OK Thank you

One last thing, i’m also getting an error in woo status logs

CRITICAL Uncaught Error: Call to undefined function x_masthead_class()

this is what i have in my child theme header

<header class="<?php x_masthead_class(); ?>" role="banner">
    <?php x_get_view( 'global', '_topbar' ); ?>
    <?php x_get_view( 'global', '_navbar' ); ?>
	
</header>

Can you see why that might be throwing an error?

Many Thanks for your help

Hey Little,

That code alone will not cause that issue and I’ve just personally tested it. The parent theme must have been corrupted in your site. Please try updating X and Cornerstone to the latest version. You can see the latest version in our Changelog at http://theme.co/changelog

Thanks.

OK, Thank you.

You can close this topic now, thanks very much for your help :slight_smile:

You’re very welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.