Skip to content

Instantly share code, notes, and snippets.

View ibndawood's full-sized avatar
💭
I may be slow to respond.

Kader Ibrahim S ibndawood

💭
I may be slow to respond.
View GitHub Profile
@ibndawood
ibndawood / functions.php
Created January 30, 2019 08:37
Electro v2 - Show brand name in product loop
add_action( 'woocommerce_shop_loop_item_title', 'ec_template_loop_product_brand', 41 );
function ec_template_loop_product_brand() {
global $product;
$product_id = electro_wc_get_product_id( $product );
$brands_tax = electro_get_brands_taxonomy();
$terms = get_the_terms( $product_id, $brands_tax );
$brand_name = '';
@ibndawood
ibndawood / functions.php
Last active July 29, 2023 22:56
Electro v2 - Enable wishlist and compare count
add_filter( 'electro_show_wishlist_count', '__return_true' );
add_filter( 'electro_show_compare_count', '__return_true' );
@ibndawood
ibndawood / functions.php
Last active March 28, 2023 17:18
WooCommerce - Changing the currency sign of UAE Dirham
add_filter( 'woocommerce_currency_symbol', 'wc_change_uae_currency_symbol', 10, 2 );
function wc_change_uae_currency_symbol( $currency_symbol, $currency ) {
switch ( $currency ) {
case 'AED':
$currency_symbol = 'AED';
break;
}
return $currency_symbol;
@ibndawood
ibndawood / functions.php
Last active February 17, 2023 11:22
WooCommerce - Remove h2 tag from product title
<?php
/**
* Show the product title in the product loop. By default this is an H2.
*/
function woocommerce_template_loop_product_title() {
?><span class="<?php echo esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ); ?>"><?php the_title(); ?></span><?php
}
@ibndawood
ibndawood / functions.php
Last active April 11, 2022 06:46
Electro v2 - Remove departments v2 menu from header v6
function electro_set_header_v6_hooks() {
remove_action( 'electro_header_logo_area', 'electro_off_canvas_nav', 20 );
}
@ibndawood
ibndawood / functions.php
Created March 23, 2020 07:05
Electro v2 - Remove Wishlist and Compare from Header Icons
add_action( 'init', 'ec_child_edit_header_icons', 20 );
function ec_child_edit_header_icons() {
remove_action( 'electro_header_icons', 'electro_compare_header_icon', 70 );
remove_action( 'electro_header_icons', 'electro_wishlist_header_icon', 80 );
}
@ibndawood
ibndawood / functions.php
Created June 24, 2018 11:32
Electro v2 - Show rating in grid view
add_action( 'init', 'ec_child_add_rating' );
function ec_child_add_rating() {
remove_action( 'woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 70 );
add_action( 'woocommerce_after_shop_loop_item_title', 'electro_template_loop_rating', 140 );
}
@ibndawood
ibndawood / functions.php
Created May 2, 2018 10:23
Electro v2 - Add compare and wishlist to mobile header
add_filter( 'electro_handheld_header_links', 'ec_child_add_wishlist_compare', 10 );
function ec_child_add_wishlist_compare( $links ) {
$links['wishlist'] = array(
'priority' => 40,
'callback' => 'ec_child_wishlist_header_link'
);
$links['compare'] = array(
'priority' => 40,
'callback' => 'ec_child_compare_header_link'
@ibndawood
ibndawood / functions.php
Last active February 2, 2022 19:35
Electro - Always display attributes in Specifications tab
add_action( 'woocommerce_before_single_product', 'ec_child_modify_display_specs_attr' );
function ec_child_modify_display_specs_attr() {
global $post;
update_post_meta( $post->ID, '_specifications_display_attributes', 'yes' );
}
@ibndawood
ibndawood / functions.php
Created May 3, 2017 12:15
Electro - Remove search bar from header v1 and v3
add_action( 'init', 'ec_child_remove_navbar_search' );
function ec_child_remove_navbar_search() {
remove_action( 'electro_header_v3', 'electro_navbar_search', 20 );
remove_action( 'electro_header_v1', 'electro_navbar_search', 20 );
}