This file contains hidden or 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 | |
| if ( ! function_exists( 'wc_rest_get_product_images' ) ) { | |
| add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 ); | |
| /** | |
| * Get the images for a product or product variation | |
| * and returns all image sizes. | |
| * | |
| * @param WP_REST_Request $request Request object. | |
| * @param WC_Product|WC_Product_Variation $product Product instance. |
This file contains hidden or 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
| //This command must occur after you create your tracker object and before you use any of the enhanced ecommerce specific functionality. | |
| ga('require', 'ec'); |
This file contains hidden or 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
| //Override woocommerce product categories widgets | |
| add_action( 'widgets_init', 'floweb_override_woocommerce_widgets', 15 ); | |
| function floweb_override_woocommerce_widgets() { | |
| // Ensure our parent class exists to avoid fatal error | |
| if ( class_exists( 'WC_Widget_Cart' ) ) { | |
| unregister_widget( 'WC_Widget_Cart' ); | |
| require get_template_directory() . '/functions/custom-widgets/floweb-class-wc-widget-cart.php'; | |
| register_widget( 'Floweb_WC_Widget_Cart' ); | |
| } | |
| } |
OlderNewer