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 | |
function custom_enable_variations_grid($enable, $product_id) { | |
// Add your specific product IDs here | |
$specific_product_ids = array(234,324,336); // Replace with your product IDs | |
if (in_array($product_id, $specific_product_ids)) { | |
return true; // Enable the grid for specific products | |
} |
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 | |
function tester_remove_fields_from_before_button() { | |
global $product; | |
if ( $product->get_type() == 'variable' ) { | |
remove_action( 'woocommerce_before_add_to_cart_button', 'pewc_product_extra_fields' ); |
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 | |
function custom_wcmo_is_content_restricted( $is_restricted, $restricted_content ) { | |
if ( $is_restricted ) { | |
// if Restriction Method is User Role, get the value of "If Restricted, Redirect To", usually the login page | |
$redirect_page = get_option( 'wcmo_redirect_restricted', false ); | |
if ( $redirect_page ) { | |
// get the translated ID for the login page using WPML's filter | |
$redirect_page_translated = apply_filters( 'wpml_object_id', $redirect_page, 'page', false ); | |
if ( get_the_ID() == $redirect_page_translated ) { | |
// we are on the translated page, allow this |
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( 'wcmo_registration_fields', function( $fields ) { | |
foreach ( $fields as $key => $field ) { | |
switch ( $key ) { | |
case "first_name": | |
$fields[$key]["label"] = "Voornaam"; | |
break; | |
case "last_name": |
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 | |
function prefix_required_quote_fields( $fields ) { | |
$fields['phone']['required'] = true; | |
return $fields; | |
} |
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 | |
/*** Hide child product category if it's empty ***/ | |
add_filter( 'pewc_filter_item_start_list', function( $item, $group, $group_id, $post_id ) { | |
if ( $item['field_type'] == "product-categories" && empty( $item['child_products'] ) ) { | |
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
<?php | |
/** Add the default currency field to calculation values in cart **/ | |
add_filter( 'pewc_filter_item_value_in_cart', function( $field_value, $field ) { | |
if ( $field['type'] == "calculation" ) { | |
$field_value = get_woocommerce_currency_symbol() . $field_value; | |
} | |
return $field_value; | |
}, 10, 2 ); |
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
/** Show 4 columns on iPad, Tablets **/ | |
@media (min-width: 481px) and (max-width: 768px){ | |
.pewc-radio-images-wrapper .pewc-radio-image-wrapper, .pewc-checkboxes-images-wrapper .pewc-checkbox-image-wrapper { | |
width: 25%; | |
} | |
} | |
/** Show 4 columns on Mobile devices **/ |
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( 'prefix_filter_field_option_name', function( $option_value, $key, $item, $product ) { | |
$qty_radio_field_id = 3153; // Quantity (Radio Group) field | |
if ( $item['field_id'] == $qty_radio_field_id ) { | |
$option_value .= '<span class="qty-discounted-price"> | |
</span>'; | |
$option_value .= '<span class="qty-percent-savings"> |
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 | |
function prefix_pewc_products_for_cats_limit($limit) { | |
// Increase the limit to 120 | |
$limit = 120; | |
return $limit; | |
} | |
add_filter('pewc_products_for_cats_limit', 'prefix_pewc_products_for_cats_limit'); |