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
| /** | |
| * Auto Complete all WooCommerce orders. | |
| * Add to theme functions.php file | |
| */ | |
| add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); | |
| function custom_woocommerce_auto_complete_order( $order_id ) { | |
| global $woocommerce; | |
| if ( !$order_id ) |
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
| function sv_add_weight_to_csv_export_import_format( $order_data, $order ) { | |
| $count = 1; | |
| // add line items | |
| foreach ( $order->get_items() as $item ) { | |
| $product = $order->get_product_from_item( $item ); | |
| if ( ! is_object( $product ) ) { |
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
| if (!function_exists('woocommerce_template_single_excerpt')) { | |
| function woocommerce_template_single_excerpt( $post ) { | |
| global $post; | |
| if ($post->post_excerpt) echo '<div itemprop="description">' . do_shortcode(wpautop(wptexturize($post->post_excerpt))) . '</div>'; | |
| } | |
| } |
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
| function wp_enqueue_woocommerce_style(){ | |
| wp_register_style( 'mytheme-woocommerce', get_template_directory_uri() . '/css/woocommerce.css' ); | |
| if ( class_exists( 'woocommerce' ) ) { | |
| wp_enqueue_style( 'mytheme-woocommerce' ); | |
| } | |
| } | |
| add_action( 'wp_enqueue_scripts', 'wp_enqueue_woocommerce_style' ); |
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
| /* Add a new country to countries list */ | |
| function woo_add_my_country( $country ) { | |
| $country["AE-DU"] = 'Dubai'; | |
| return $country; | |
| } | |
| add_filter( 'woocommerce_countries', 'woo_add_my_country', 10, 1 ); |
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
| add_filter ( 'woocommerce_product_thumbnails_columns', 'xx_thumb_cols' ); | |
| function xx_thumb_cols() { | |
| return 4; // .last class applied to every 4th thumbnail | |
| } |
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 | |
| // Bookings Date Format Tweak | |
| add_filter( 'woocommerce_bookings_date_format' , 'woocommerce_bookings_custom_date_format' ); | |
| /** | |
| * woocommerce_bookings_custom_date_format | |
| * | |
| * @access public | |
| * @since 1.0 |
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 theme default specification for product # per row | |
| function loop_columns() { | |
| return 5; // 5 products per row | |
| } | |
| add_filter('loop_shop_columns', 'loop_columns', 999); |
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 | |
| /** | |
| * Plugin Name: WooCommerce Add CSS to Emails | |
| * Plugin URI: https://gist.github.com/BFTrick/01cc414ee56ce93715ec | |
| * Description: Add CSS styles to WooCommerce emails | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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
| // Remove each style one by one | |
| add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' ); | |
| function jk_dequeue_styles( $enqueue_styles ) { | |
| unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss | |
| unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout | |
| unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation | |
| return $enqueue_styles; | |
| } | |
| // Or just remove them all in one line |
OlderNewer