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
| /** | |
| * Динамічне ціноутворення: керування через адмінку, вивід на сторінці товару та підтримка шорткоду. | |
| */ | |
| namespace WPWC_QuantityPricing; | |
| if (!defined('ABSPATH')) exit; | |
| /** | |
| * Клас для керування оптовими цінами |
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_available_payment_gateways', 'custom_restrict_gateways_by_product', 10, 1 ); | |
| function custom_restrict_gateways_by_product( $available_gateways ) { | |
| if ( is_admin() || WC()->cart->is_empty() ) { | |
| return $available_gateways; | |
| } | |
| // Тут вказуєте ідентифікатори саме тих продуктів І/АБО варіацій | |
| $product_gateway_map = array( |
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
| <? | |
| /** | |
| * 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 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_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 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( 'gutenberg_use_widgets_block_editor', '__return_false' ); | |
| add_filter( 'use_widgets_block_editor', '__return_false' ); |
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 | |
| 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 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 | |
| // Добавляем валюту гривня в WooCommerce | |
| add_filter('woocommerce_currencies', 'add_my_currency'); | |
| function add_my_currency($currencies) { | |
| $currencies['UAH'] = __('Українська гривня', 'woocommerce'); | |
| return $currencies; | |
| } |
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 | |
| // Відключити оновлення деяких плагінів | |
| 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 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 | |
| // Додайте чекбокс на сторінку оформлення замовлення | |
| 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 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 | |
| /** | |
| * Отключаем принудительную проверку новых версий WP, плагинов и темы в админке, | |
| * чтобы она не тормозила, когда долго не заходил и зашел... | |
| * Все проверки будут происходить незаметно через крон или при заходе на страницу: "Консоль > Обновления". | |
| * | |
| * @see https://wp-kama.ru/filecode/wp-includes/update.php | |
| * @author Kama (https://wp-kama.ru) | |
| * @version 1.1 | |
| */ |
NewerOlder