Support

Home Forums Event Espresso Premium PayPal Commerce set_checkout_anchor

PayPal Commerce set_checkout_anchor

Posted: January 4, 2025 at 4:49 pm

Viewing 1 reply thread


cmeseminars

January 4, 2025 at 4:49 pm

Today I moved my site from PayPal Express Checkout with Smart Buttons to PayPal Commerce. After deactivating PayPal Express Checkout with Smart Buttons, my registration form stopped displaying. For example, I would click the “Register Now” button, be sent tot he Registration form (https://www.cmeseminars.com/registration-checkout/?uts=1736034026#checkout), and the page would appear to be blank. Upon inspection in Chrome inspector, I found the function set_checkout_anchor was outputting an the A anchor id=”checkout” with the inline style set to “float: left; margin-left: -999em;”. When I removed the margin-left CSS rule, the registration form displayed correctly.

Question: Is there any way to modify the function set_checkout_anchor to not include the margin-left inline rule? Currently I directly modified the file EED_Single_Page_Checkout.modeule.php, but I presume that change will be wiped out the next time EE releases a core update, which is problematic.

I noticed in the KB the function.php addition EE Support suggested, but it seems to me like that would remove the A anchor all together, which would break the on page javascript.

add_action( ‘loop_start’, ‘ee_move_cart_markup’, 1 );
function ee_move_cart_markup(){
if (! class_exists(‘EED_Single_Page_Checkout)) {
return;
}
if( is_page( ) ) {
remove_action( ‘loop_start’, array( EED_Single_Page_Checkout::instance(), ‘set_checkout_anchor’ ), 1 );
}
}


Tony

  • Support Staff

January 6, 2025 at 2:25 am

Hi there,

The easiest way to modify that will be to add coms custom CSS to override the margin.

.page-id-5958 a#checkout {
    margin: 0;
}

Add that to Appearance -> Customize -> Additional CSS and specifically targets just that anchor on that page.

I noticed in the KB the function.php addition EE Support suggested, but it seems to me like that would remove the A anchor all together, which would break the on page javascript.

May I ask which on page JavaScript breaks? I’m not aware of any that targets the checkout anchor specifically.

Viewing 1 reply thread

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso