View prefix_enable_image_editing.php
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 | |
/** | |
* Enable image editing for certain products | |
*/ | |
function prefix_enable_image_editing( $enabled ) { | |
$product_id = get_the_ID(); | |
if( in_array( $product_id, array( 123, 456, 789 ) ) { | |
$enabled = 'yes'; | |
} | |
return $enabled; |
View pewc_rename_uploaded_file.php
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 | |
/** | |
* Fix issue with Divi compatibility | |
*/ | |
remove_filter( 'sanitize_file_name', 'pewc_rename_uploaded_file' ); |
View ptuwc_placeholder_label.php
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 | |
/** | |
* Filter the 'Product tags' placeholder | |
*/ | |
function prefix_ptuwc_taxonomy_label( $label, $filterable_column ) { | |
if( $filterable_column == 'product_tag' ) { | |
$label = 'My new placeholder'; | |
} | |
return $label; | |
} |
View bfwc_auto_set_end.php
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 | |
/** | |
* Display a single calendar | |
* Only for use with single day bookings | |
*/ | |
function prefix_auto_set_end( $auto, $product_id ) { | |
return 'yes'; | |
} | |
add_filter( 'bfwc_auto_set_end', 'prefix_auto_set_end', 10, 2 ); |
View filter-field-class.php
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_filter_single_product_classes( $classes, $item ) { | |
$classes[] = 'my-new-class'; | |
return $classes; | |
} | |
add_filter( 'pewc_filter_single_product_classes', 'prefix_filter_single_product_classes', 10, 2 ); |
View woocommerce-payment-gateway-fee.php
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 a fee when the user checks out with PayPal | |
*/ | |
function wcfad_apply_payment_gateway_fee() { | |
$payment_method = WC()->session->get( 'chosen_payment_method' ); | |
// Only apply the fee if the payment gateway is PayPal | |
// Note that you might need to check this slug, depending on the PayPal gateway you're using | |
if( $payment_method == 'ppec_paypal' ) { | |
$label = __( 'PayPal fee', 'wcfad' ); |
View simple.php
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 | |
/** | |
* Simple product add to cart | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/simple.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |
View pewc_child_product_independent_quantity.php
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 | |
/** | |
* Force a child product to be automatically selected | |
*/ | |
function prefix_filter_default_child_independent_quantity( $quantity_field_value, $child_product_id, $item ) { | |
if( $child_product_id == 9999 ) { // Change this to your child product ID | |
return 1; | |
} | |
return $quantity_field_value; | |
} |
View prefix_adjust_document_item_product_shortcode.php
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 add-on data to Germanized for WooCommerce invoices | |
* You'll also need to add a [document_item_product data="aou_addons"] shortcode under the line item in the invoice template | |
*/ | |
function prefix_adjust_document_item_product_shortcode( $result, $atts, $document, $shortcodes ) { | |
if ( $atts['data'] !== 'aou_addons' ) { | |
return $result; | |
} |
View wcmo_redirect_url.php
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 | |
/** | |
* Find which category is protected by a given password | |
* @return term_id | |
*/ | |
function prefix_get_product_category_by_password( $password ) { | |
$terms = get_terms( array( | |
'taxonomy' => 'product_cat' | |
) ); | |
if( $terms ) { |
NewerOlder