Skip to content

Instantly share code, notes, and snippets.

@renrax
renrax / functions.php
Created February 2, 2022 20:16 — forked from ibndawood/functions.php
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 );
}
@renrax
renrax / functions.php
Created February 2, 2022 20:32 — forked from ibndawood/functions.php
Electro v2 - Enable wishlist and compare count
add_filter( 'electro_show_wishlist_count', '__return_true' );
add_filter( 'electro_show_compare_count', '__return_true' );
@renrax
renrax / dokan-add-to-cart.php
Created February 2, 2022 23:26 — forked from mi5t4n/dokan-add-to-cart.php
Make product purchasable based on the vendor opening and closing time in dokan plugin.
<?php
/**
* Hide or display add to cart button based on opening hours.
*/
function prefix_woocommerce_is_purchasable( $is_purchasable, $product ) {
// Get the store id.
$store_id = get_post_field( 'post_author', $product->get_id() );
// Get the store info.