Created
June 24, 2016 14:53
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref - https://eventespresso.com/topic/view-event-cart-glitch-not-working/#post-208659