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 $attr | |
* | |
* @return array | |
* | |
* @testedwith WooCommerce 6.0 | |
* @author Artem Abramovich | |
*/ |
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
/** | |
* Подключение скриптов и стилей только на страницах WooCommerce | |
* | |
* @testedwith WooCommerce 5.5 | |
* @verphp 7.0 | |
* @author Artem Abramovich | |
*/ | |
function art_connection_css_js_only_woocommerce_pages() { | |
if ( is_woocommerce() || is_cart() || is_checkout() || is_account_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
function electro_get_sale_flash( $html, $post, $product ) { | |
if( is_user_logged_in() ) { | |
$html = '<span class="onsale">-' . electro_get_savings_on_sale( $product, 'percentage' ) . '</span>'; | |
return apply_filters( 'electro_get_sale_flash', $html, $post, $product ); | |
} | |
} |
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 | |
//Remove the <?php while using it in your theme's functions.php file | |
//Add store open-show information before single product add-to-cart button | |
add_action('woocommerce_before_add_to_cart_form', 'dokan_open_close', 1000); | |
function dokan_open_close() { | |
global $product; |
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( 'wpcf7_before_send_mail', 'created_post_in_cf7' ); | |
function created_post_in_cf7( $contact_form ) { | |
$title = $_POST['text-title-post'] && ! empty( $_POST['text-title-post'] ) ? sanitize_text_field( $_POST['text-title-post'] ) : ''; | |
$content = $_POST['text-contant-post'] && ! empty( $_POST['text-contant-post'] ) ? wp_strip_all_tags( $_POST['text-contant-post'] ) : ''; | |
$field = $_POST['text-field-post'] && ! empty( $_POST['text-field-post'] ) ? sanitize_text_field( $_POST['text-field-post'] ) : ''; | |
$ars = [ | |
'post_type' => 'post', | |
'post_title' => $title, |
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( 'woocommerce_product_categories_widget_args', 'el_child_exclude_uncategory' ); | |
function el_child_exclude_uncategory( $cat_args ) { | |
$cat_args['exclude'] = get_option( 'default_product_cat' ); | |
return $cat_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
add_filter( 'woocommerce_product_categories_widget_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
<?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_action( 'init', 'el_child_copyright_in_handheld' ); | |
function el_child_copyright_in_handheld() { | |
add_action( 'electro_footer_v2_handheld', 'electro_copyright_bar_v2', 81 ); | |
add_action( 'electro_mobile_footer_v1', 'electro_copyright_bar_v2', 100 ); | |
add_action( 'electro_mobile_footer_v2', 'electro_copyright_bar_v2', 100 ); | |
} |
NewerOlder