Skip to content

Instantly share code, notes, and snippets.

View Kodzhesyan's full-sized avatar
🎯
Focusing

Roman Kodzhesyan

🎯
Focusing
View GitHub Profile
@Kodzhesyan
Kodzhesyan / functions.php
Created March 5, 2023 17:25
Remove product page tabs
<?
/**
* 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
@Kodzhesyan
Kodzhesyan / functions.php
Last active May 15, 2025 11:58
custom_restrict_gateways_by_product
<?
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(
@Kodzhesyan
Kodzhesyan / functions.php
Last active January 21, 2026 11:42
Динамічне ціноутворення: Купуйте більше — платіть менше!
/**
* Динамічне ціноутворення: керування через адмінку, вивід на сторінці товару та підтримка шорткоду.
*/
namespace WPWC_QuantityPricing;
if (!defined('ABSPATH')) exit;
/**
* Клас для керування оптовими цінами