Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / functions.php
Created June 12, 2020 09:08
Electro - Single product page add recently viewed products after recommended products
/**
* Track product views.
*/
if( ! function_exists( 'electro_wc_track_product_view' ) ) {
function electro_wc_track_product_view() {
if ( ! is_singular( 'product' ) ) {
return;
}
global $post;
@anastransvelo
anastransvelo / style.css
Created May 21, 2020 14:24
electro custom news letter style
span.wpcf7-not-valid-tip {
position: absolute;
bottom: -70px;
}
div.wpcf7-validation-errors,
div.wpcf7-acceptance-missing {
color: #fff;
}
@farookibrahim
farookibrahim / functions.php
Created May 1, 2020 10:06
Electro - Footer replace payment icons with social icons
if ( ! function_exists( 'electro_copyright_bar_v2' ) ) {
function electro_copyright_bar_v2() {
$website_title_with_url = sprintf( '<a href="%s">%s</a>', esc_url( home_url( '/' ) ), get_bloginfo( 'name' ) );
$footer_copyright_text = apply_filters( 'electro_footer_copyright_text', sprintf( __( '&copy; %s - All Rights Reserved', 'electro' ), $website_title_with_url ) );
$credit_card_icons = apply_filters( 'electro_footer_credit_card_icons', '' );
if ( apply_filters( 'electro_enable_footer_credit_block', true ) ) : ?>
<div class="copyright-bar">
@yousufansa
yousufansa / functions.php
Created January 22, 2020 05:56
Electro - Mobile Header Cart Link issue on Offcanvas Cart Enabled Fix
if ( ! function_exists( 'electro_handheld_footer_bar_cart_link' ) ) {
function electro_handheld_footer_bar_cart_link() {
$header_cart_icon = apply_filters( 'electro_header_cart_icon', 'ec ec-shopping-bag' );
if ( is_woocommerce_activated() ) {
$cart_link = wc_get_cart_url();
?>
<a class="footer-cart-contents" href="<?php echo esc_url( $cart_link ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'electro' ); ?>">
<i class="<?php echo esc_attr( $header_cart_icon ); ?>"></i>
<span class="cart-items-count count"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() );?></span>
</a>
@yousufansa
yousufansa / functions.php
Created November 12, 2019 12:29
Electro - Exclude Out of Stock Products From Live Search
if ( !function_exists( 'electro_child_wc_live_search_query_custom_args' ) ) {
function electro_child_wc_live_search_query_custom_args( $args ) {
$args['stock_status'] = array( 'instock', 'onbackorder' );
return $args;
}
}
add_filter( 'electro_wc_live_search_query_args', 'electro_child_wc_live_search_query_custom_args' );
@anastransvelo
anastransvelo / style.css
Last active February 28, 2021 00:06
Electro advanced-woo-search search form style
.aws-container .aws-search-form {
height: 41px;
}
.aws-container .aws-search-form .aws-loader {
right: 20px;
}
.aws-container .aws-search-form .aws-search-clear span {
top: 0;
@yousufansa
yousufansa / style.css
Created August 13, 2019 13:18
Electro - Add to Cart Button Custom Color
.owl-item>.product:not(:hover) .add-to-cart-wrap .button::before,
.owl-item>.product:not(:hover) .added_to_cart::before,
li.product:not(:hover) .add-to-cart-wrap .button::before,
li.product:not(:hover) .added_to_cart::before {
background-color: #000;
}
.products.show-btn>li.product .added_to_cart:before,
.products.show-btn>li.product .button:before {
background: 0 0;
@yousufansa
yousufansa / style.css
Created August 13, 2019 08:10
Electro - Hide Footer Brand Carousel on Mobile
@media (max-width: 568px) {
.site-content+.brands-carousel {
display: none;
}
}
@yousufansa
yousufansa / functions.php
Created July 15, 2019 08:17
Electro - Remove Catalog Ordering Dropdown from Shop Page
if ( !function_exists( 'electro_child_disable_catalog_ordering_toggle' ) ) {
function electro_child_disable_catalog_ordering_toggle() {
remove_action( 'electro_shop_control_bar', 'woocommerce_catalog_ordering', 20 );
}
}
add_action( 'init', 'electro_child_disable_catalog_ordering_toggle' );
@yousufansa
yousufansa / functions.php
Created June 13, 2019 15:07
Electro - Elementor Pro Custom Header/Footer Issue Fix
if ( ! function_exists( 'el_child_get_header_after' ) ) {
function el_child_get_header_after() {
if( did_action( 'elementor_pro/init' ) ) {
?>
<div id="content" class="site-content" tabindex="-1">
<div class="container">
<?php
}
}
}