This file contains hidden or 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 | |
/** | |
* 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. |
This file contains hidden or 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
add_filter( 'electro_show_wishlist_count', '__return_true' ); | |
add_filter( 'electro_show_compare_count', '__return_true' ); |
This file contains hidden or 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
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 ); | |
} |
This file contains hidden or 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
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 ); | |
} |
This file contains hidden or 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
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' |
This file contains hidden or 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
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' ); | |
} |
This file contains hidden or 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 // Do not include this if already open! | |
/** | |
* Code goes in theme functions.php. | |
*/ | |
add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' ); | |
function custom_woocommerce_product_subcategories_args( $args ) { | |
$args['exclude'] = get_option( 'default_product_cat' ); | |
return $args; |
This file contains hidden or 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
This code adds the Checkbox field to Dokan and to WooCommerce. | |
But | |
If the administrator on the Wordpress side edits, the box is saved. | |
If the seller edits via Dokan, the box will remain unchecked after he saves the page. | |
This file contains hidden or 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
/** | |
* Замена стандартных текстов на страницах | |
* | |
* @param $translated_text | |
* @param $text | |
* @param $domain | |
* | |
* @return mixed|string | |
*/ | |
function art_shop_strings( $translated_text, $text, $domain ) { |
This file contains hidden or 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 | |
//Exemple 1 | |
add_filter('gettext', 'translate_text'); | |
add_filter('ngettext', 'translate_text'); | |
function translate_text($translated) { | |
$translated = str_ireplace('Choose and option', 'Select', $translated); | |
return $translated; |
NewerOlder