Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created June 24, 2016 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/b2491effae7cf7471058392e3edbfe37 to your computer and use it in GitHub Desktop.
Save Pebblo/b2491effae7cf7471058392e3edbfe37 to your computer and use it in GitHub Desktop.
A workaround that allows you to use the MER Cart widget within a sidebar on the registration-checkout page. This function simply removes the #checkout bookmark from the link to prevent X Theme from simply scrolling to that bookmark.
<?php //Please do not include the opening php tag if you already have one.
//This function simply removes the '#checkout' book mark from the view event cart link used within the MER Cart Widget.
//This is a workaround for using the Widget on the registration-checkout with theme X.
function tw_ee_remove_checkout_hash_from_cart_widget( $template_args ) {
if( array_key_exists( 'view_event_cart_url', $template_args ) ) {
$template_args[ 'view_event_cart_url' ] = str_replace( '#checkout', '', $template_args[ 'view_event_cart_url' ] );
}
return $template_args;
}
add_filter( 'FHEE__EEH_Template__display_template__template_args', 'tw_ee_remove_checkout_hash_from_cart_widget' );
@Pebblo
Copy link
Author

Pebblo commented Jun 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment