This file contains 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
<? | |
/** | |
* Remove product page tabs | |
*/ | |
add_filter( 'woocommerce_product_tabs', 'my_remove_all_product_tabs', 98 ); | |
function my_remove_all_product_tabs( $tabs ) { | |
//unset( $tabs['description'] ); // Remove the description tab | |
//unset( $tabs['reviews'] ); // Remove the reviews tab |
This file contains 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_billing_fields', 'wc_optional_billing_fields', 10, 1 ); | |
function wc_optional_billing_fields( $address_fields ) { | |
$address_fields['billing_email']['required'] = false; | |
$address_fields['billing_address_1']['required'] = false; | |
$address_fields['billing_address_2']['required'] = false; | |
//$address_fields['billing_mrkvnp_street']['required'] = false; |
This file contains 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( 'gutenberg_use_widgets_block_editor', '__return_false' ); | |
add_filter( 'use_widgets_block_editor', '__return_false' ); |
This file contains 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 | |
add_filter( 'woocommerce_get_availability', 'custom_override_get_availability', 10, 2); | |
function custom_override_get_availability( $availability, $_product ) { | |
if ( $_product->is_in_stock() ) $availability['availability'] = __('В наявності', 'woocommerce'); | |
return $availability; | |
} |
This file contains 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 | |
// Добавляем валюту гривня в WooCommerce | |
add_filter('woocommerce_currencies', 'add_my_currency'); | |
function add_my_currency($currencies) { | |
$currencies['UAH'] = __('Українська гривня', 'woocommerce'); | |
return $currencies; | |
} |
This file contains 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 | |
// Відключити оновлення деяких плагінів | |
add_filter( 'site_transient_update_plugins', function ( $value ) { | |
unset( $value->response['megamenu-pro/megamenu-pro.php'] ); | |
unset( $value->response['woocommerce-smart-coupons/woocommerce-smart-coupons.php'] ); | |
unset( $value->response['faview-virtual-reviews-for-woocommerce/faview-virtual-reviews-for-woocommerce.php'] ); | |
return $value; | |
} ); |
This file contains 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 | |
// Додайте чекбокс на сторінку оформлення замовлення | |
add_action( 'woocommerce_after_checkout_billing_form', 'add_no_call_checkbox' ); | |
function add_no_call_checkbox( $checkout ) { | |
woocommerce_form_field( 'no_call', array( | |
'type' => 'checkbox', | |
'class' => array('form-row-wide'), | |
'label' => __('Телефонувати мені не потрібно.'), | |
), $checkout->get_value( 'no_call' )); |
This file contains 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 | |
/** | |
* Отключаем принудительную проверку новых версий WP, плагинов и темы в админке, | |
* чтобы она не тормозила, когда долго не заходил и зашел... | |
* Все проверки будут происходить незаметно через крон или при заходе на страницу: "Консоль > Обновления". | |
* | |
* @see https://wp-kama.ru/filecode/wp-includes/update.php | |
* @author Kama (https://wp-kama.ru) | |
* @version 1.1 | |
*/ |
This file contains 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
// Custom validation for Billing Phone checkout field | |
add_action('woocommerce_checkout_process', 'custom_validate_billing_phone'); | |
function custom_validate_billing_phone() { | |
$is_correct = preg_match('/^[0-9]{10}$/', $_POST['billing_phone']); | |
if ( $_POST['billing_phone'] && !$is_correct) { | |
wc_add_notice( __( 'Напишите правильно свой номер телефона.<strong>Он должен состоять только из 10 цифр</strong>. Например: <strong>0990603439</strong>' ), 'error' ); | |
} | |
} |
This file contains 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
/** | |
* QREUZ SNIPPET FOR WOOCOMMERCE / WORDPRESS | |
* | |
* @TITLE Google Customer Reviews Snippet for WooCommerce | |
* @VERSION 1.4.2 | |
* @DESCRIPTION Implements the necessary snippets to WooCommerce for collecting Google Customer Reviews from customers after purchase | |
* @FOR Google Customer Reviews, https://support.google.com/merchants/answer/7124319 | |
* @LINK https://qreuz.com/snippets/google-customer-reviews-snippet-for-woocommerce/ | |
* @AUTHOR Qreuz GmbH <[email protected]> | |
* @LICENSE GNU GPL v3 https://www.gnu.org/licenses/gpl-3.0 |
NewerOlder