Skip to content

Instantly share code, notes, and snippets.

@jmabbas
Created December 7, 2018 06:13
Show Gist options
  • Save jmabbas/349eec285f10ebc5e20b1e5318613442 to your computer and use it in GitHub Desktop.
Save jmabbas/349eec285f10ebc5e20b1e5318613442 to your computer and use it in GitHub Desktop.
Electro - Paypal minicart
if( ! function_exists( 'is_wc_gateway_ppec' ) ) {
function is_wc_gateway_ppec() {
return is_woocommerce_extension_activated( 'WC_GATEWAY_PPEC' );
}
}
if ( ! function_exists( 'electro_header_mini_cart_icon' ) ) {
/**
* @since 2.0
*/
function electro_header_mini_cart_icon() {
if( true === electro_get_shop_catalog_mode() ) {
return;
}
$header_cart_icon = apply_filters( 'electro_header_cart_icon', 'ec ec-shopping-bag' );
$disable_header_cart_dropdown = apply_filters( 'electro_header_cart_dropdown_disable', false );
?><div class="header-icon <?php if ( ! $disable_header_cart_dropdown ): ?>animate-dropdown dropdown<?php endif; ?>">
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" <?php if ( ! $disable_header_cart_dropdown ): ?>data-toggle="dropdown"<?php endif; ?>>
<i class="<?php echo esc_attr( $header_cart_icon ); ?>"></i>
<span class="cart-items-count count header-icon-counter"><?php echo WC()->cart->get_cart_contents_count(); ?></span>
<span class="cart-items-total-price total-price"><?php echo WC()->cart->get_cart_subtotal(); ?></span>
</a>
<?php if ( ! $disable_header_cart_dropdown ) {
if ( is_wc_gateway_ppec() ) { ?>
<ul class="dropdown-menu dropdown-menu-mini-cart">
<li>
<?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
</li>
</ul>
<?php } else { ?>
<ul class="dropdown-menu dropdown-menu-mini-cart">
<li>
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart();?>
</div>
</li>
</ul><?php
}
} ?>
</div><?php
}
}
.site-header .widget_shopping_cart p.buttons.wcppec-cart-widget-spb {
padding: 1.5em 1em 0;
}
.single-product-wrapper .summary.entry-summary .wcppec-checkout-buttons {
width: inherit;
}
.woocommerce-cart .dropdown-menu-mini-cart,
.woocommerce-checkout .dropdown-menu-mini-cart {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment