Skip to content

Instantly share code, notes, and snippets.

View pewc_child_product_independent_quantity.php
<?php
/**
* Use this filter to set a different default quantity for child products
*/
function prefix_filter_default_child_independent_quantity( $quantity_field_value, $child_product_id, $item ) {
return 1;
}
add_filter( 'pewc_child_product_independent_quantity', 'prefix_filter_default_child_independent_quantity', 10, 3 );
View pewc_conditions_timer.php
<?php
function pewc_conditions_timer( $time ) {
return 500;
}
add_filter( 'pewc_conditions_timer', 'pewc_conditions_timer' );
function pewc_calculations_timer( $time ) {
return 500;
}
add_filter( 'pewc_calculations_timer', 'pewc_calculations_timer' );
View prefix_loop_add_to_cart_link_elessi.php
View pewc_close_accordion.php
<?php
/**
* Toggle accordion closed when one is opened
*/
function prefix_toggle_accordion_closed( $toggle, $post_id ) {
return 'yes';
}
add_filter( 'pewc_close_accordion', 'prefix_toggle_accordion_closed', 10, 2 );
View pewc_min_max_val_step.php
<?php
/**
* Filter the step value for min and max values
*/
function prefix_min_max_val_step( $step, $item ) {
return 0.01;
}
add_filter( 'pewc_min_max_val_step', 'prefix_min_max_val_step', 10, 2 );
View prefix_show_option_prices_per_field.php
<?php
function prefix_show_option_prices_per_field( $display, $field ) {
if( isset( $field['field_type'] ) && $field['field_type'] == 'select' ) {
return false;
}
return $display;
}
add_filter( 'pewc_show_option_prices', 'prefix_show_option_prices_per_field', 10, 2 );
View products-columns-no-images.css
.pewc-column-wrapper .pewc-checkbox-image-wrapper {
display: block;
}
ul.pewc-product-extra-groups .pewc-item:not(.pewc-item-checkbox) label {
display: none !important;
}
View prefix_add_group_to_field_name.php
<?php
/**
* Display child products as meta in parent product
*/
add_filter( 'pewc_display_child_product_meta', '__return_true' );
/**
* Add the group name to fields
*/
function prefix_add_group_to_field_name( $value, $field ) {
View prefix_test_wcptu_callback.php
<?php
/**
* Very simple example of using a custom callback with Product Table Ultimate
* @return Array Return an array of product IDs
*/
function prefix_test_wcptu_callback() {
return array( 190 );
}
View woocommerce-stats.txt
<a href="https://pluginrepublic.com/woocommerce-stats/"><img width="968px" alt="WooCommerce stats infographic" src="https://pluginrepublic.com/wp-content/uploads/2021/02/woocommerce-stats-1.jpg"></a>