Problem: I would like to set the value of a custom field automatically whenever a WooCommerce Order is created from the front-end of the site.
Solution: Use a custom code snippet with the save_post hook to programmatically set the custom field value:
function tssupp_set_select_value_1 ( $post_id, $post, $update ) {
$field_slug = 'custom-field-slug';
$forced_value = '1';
$post_type_slug = 'shop_order';
// you should not edit anything below this line
// - bail on wrong post type or on update
$post_type = get_post_type( $post_id );
if ( $post_type !== $post_type_slug || $update ) {
return;
}
update_post_meta( $post_id, 'wpcf-' . $field_slug, $forced_value );
}
// 1688213: Automatically select custom field value when order is created
add_action( 'save_post', 'tssupp_set_select_value_1', 100, 3);
Problem:
The user encounters a warning from WooCommerce about Toolset WooCommerce Views not being tested with the latest WooCommerce version.
Solution:
We try to be compatible with all the popular themes and plugins for WordPress. The Toolset WooCommerce Views is indeed compatible with the latest version of WooCommerce. This warning will be fixed in the upcoming release.
Problem:
The user would like to display the WooCommerce rating only if they exist
Solution:
1. Activate "_wc_average_rating" hidden custom field in Toolset->Settings->Frontend Content, first section. Check this screenshot http://prntscr.com/t0pel9
2. Use the custom field on the condition:
[wpv-conditional if="( $(_wc_average_rating) gt '0' )"]
When it is true
[/wpv-conditional]
[wpv-conditional if="( $(_wc_average_rating) gt '0' )" evaluate="false"]
When it is false
[/wpv-conditional]