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 | |
/* | |
File : functions.php (in your theme) | |
Override "woocommerce_before_shop_loop" hook. | |
Add a check : (Line 41 - 43) | |
Avoid error if administrator choosing "rating" in administration and rating are disabled. | |
IF "woocommerce_enable_review_rating" option equal "no" | |
AND | |
"woocommerce_default_catalog_orderby" option equal "rating" |
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 Variation Settings | |
add_action( 'woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3 ); | |
// Save Variation Settings | |
add_action( 'woocommerce_save_product_variation', 'save_variation_settings_fields', 10, 2 ); | |
/** | |
* Create new fields for variations |