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'); |
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( 'apaou_layer_parent', function() { | |
return 'woocommerce-product-gallery__image'; | |
} ); |
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 booking metadata to quote item (Bookings for WooCommerce) | |
*/ | |
function wcraq_bfwc_custom_order_item_meta( $item_id, $cart_item, $cart_id ) { | |
if ( ! empty( $cart_item['booking'] ) ) { | |
wc_add_order_item_meta( $item_id, 'booking', $cart_item['booking'], true ); | |
} | |
} | |
add_action( 'wcraq_custom_order_item_meta', 'wcraq_bfwc_custom_order_item_meta', 10, 3 ); |
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 | |
/** | |
* For Add-Ons Ultimate. Pass back to the product page the quantity in the cart when editing add-ons | |
*/ | |
add_filter( 'woocommerce_quantity_input_args', 'pewc_custom_update_quantity_value', 11, 2 ); | |
function pewc_custom_update_quantity_value( $args, $product ) { | |
if ( ! function_exists( 'pewc_user_can_edit_products' ) ) { | |
return $args; | |
} |
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 | |
/** | |
* For Min Max Quantity Order. Pass back to the product page the value of the quantity in the cart when editing add-ons | |
*/ | |
add_filter( 'wcmmqt_default_quantity', 'pewc_wcmmqt_custom_default_quantity', 11, 2 ); | |
function pewc_wcmmqt_custom_default_quantity( $default_quantity, $product ) { | |
if ( ! function_exists( 'pewc_user_can_edit_products' ) ) { | |
return $default_quantity; | |
} |
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 change_booking_text( $translated_text, $text, $domain ) { | |
if ( $domain === 'bfwc' ) { | |
switch ( $text ) { | |
case 'Quantity:': | |
$translated_text = 'Word1:'; | |
break; | |
case 'Duration:': | |
$translated_text = 'Word2:'; |
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
function modify_price_with_jquery() { | |
wp_add_inline_script('jquery-core', ' | |
jQuery(document).ready(function($) { | |
$(".ptuwc-thumbnail").text("Visual"); | |
}); | |
'); | |
} | |
add_action('wp_enqueue_scripts', 'modify_price_with_jquery'); |
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
.pewc-radio-image-wrapper label input[type=radio], .pewc-checkbox-image-wrapper label input[type=checkbox] { | |
visibility: initial; | |
} | |
.pewc-preset-style .pewc-item-field-wrapper input[type="checkbox"], .pewc-preset-style input[type="checkbox"].pewc-checkbox-form-field{ | |
opacity: 1; | |
height: 10px; | |
position: relative; | |
} |
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 | |
/** Don't round discounts prices - instead 2 decimal places **/ | |
function custom_adjusted_price( $adjusted_price ) { | |
$formatted_price = number_format( $adjusted_price, 2, '.', '' ); | |
return $formatted_price; | |
} |
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 optional_quote_fields( $fields ) { | |
/** Make fields not required **/ | |
$fields['phone']['required'] = false; | |
$fields['email']['required'] = false; | |
return $fields; |