Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter( 'pewc_enable_formulas_in_prices', '__return_true' );
.woocommerce-variation-add-to-cart, :is(.elementor-widget-woocommerce-product-add-to-cart,.woocommerce div.product .elementor-widget-woocommerce-product-add-to-cart,.elementor-widget-wc-add-to-cart,.woocommerce div.product .elementor-widget-wc-add-to-cart) form.cart:not(.grouped_form):not(.variations_form) {
display: flex;
flex-wrap: wrap;
}
.pewc-product-extra-groups-wrap {
width: 100%
}
<?php
/**
* Filter BXGY rule by brand taxonomy instead of category
*/
function demo_bxgy_taxonomy( $taxonomy, $rule, $rule_id ) {
$taxonomy = 'product_brand'; // Change this to the taxonomy or tag of your choice
return $taxonomy;
}
add_filter( 'wcfad_validate_bxgy_rule_taxonomy', 'demo_bxgy_taxonomy', 10, 3 );
<?php
/**
* Hide all field and option prices on the front end
*/
function demo_hide_all_add_on_prices( $item, $group, $group_id, $post_id ) {
$item['price_visibility'] = 'hidden';
$item['option_price_visibility'] = 'hidden';
return $item;
}
add_filter( 'pewc_filter_item_start_list', 'demo_hide_all_add_on_prices', 10, 4 );
<?php
// Ignore categories with override disabled
add_filter( 'wcmo_ignore_disabled_category_rules', '__return_false' );
// Enable the 'Update data' prompt again
add_filter( 'wcmo_update_done', '__return_false' );
<?php
/**
* Filter directory path for template files in Order Bump
*/
function my_wcob_template_dir( $dir ) {
return '/www/kinsta/public/plugins/wp-content/themes/my-child-theme/wcob-templates/'; // Update this path as required
}
add_filter( 'wcob_template_dir', 'my_wcob_template_dir' );
.pewc-has-hex .pewc-radio-images-wrapper img {
visibility: hidden;
height: 0;
display: none;
}
.pewc-hex {
height: 30px;
width: 30px;
}
.cropper-view-box {
border-radius: 50%;
}
.cropper-face {
background-color:inherit !important;
}
<?php
function test_page_count_method( $method ) {
// return 'imagick'; // Use this if you have the Imagick PHP extension installed
return 'preg_match_all';
}
add_filter( 'wcpauau_page_count_method', 'test_page_count_method' );
<?php
add_action( 'wp_footer', function() {
?>
<style>
.pewc-has-extra-fields .pewc-item-products-radio-list[data-product-quantity-select="1"] .pewc-radio-wrapper .pewc-radio-list-label-wrapper {
display: none !important;
}
.pewc-has-extra-fields .pewc-item-products-radio-list[data-product-quantity-select="1"] .pewc-child-quantity-field-select {
width: 50px !important;
margin-left: auto;