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 | |
| /** | |
| * woocommerce_single_product_summary hook | |
| * | |
| * @hooked woocommerce_template_single_title - 5 | |
| * @hooked woocommerce_template_single_rating - 10 | |
| * @hooked woocommerce_template_single_price - 10 | |
| * @hooked woocommerce_template_single_excerpt - 20 | |
| * @hooked woocommerce_template_single_add_to_cart - 30 | |
| * @hooked woocommerce_template_single_meta - 40 |
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 | |
| //*** Support Title Tag | |
| add_theme_support( 'title-tag' ); | |
| define('THEME_URI', get_template_directory_uri() ); | |
| define( 'THEME_PATH' , get_template_directory() ); | |
| // INCLUDE THEME FILE |
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 our Custom Fields to simple products | |
| */ | |
| function mytheme_woo_add_custom_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; | |
| // Text Field |
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: Change Single Product Layout | |
| Plugin URI: http://www.damiencarbery.com | |
| Description: Change layout of Single Product page by changing add_action() order. | |
| Author: Damien Carbery | |
| Version: 0.1 | |
| */ | |
| add_action( 'woocommerce_before_single_product', 'cspl_change_single_product_layout' ); |
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_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); | |
| /** | |
| * custom_woocommerce_template_loop_add_to_cart | |
| */ | |
| function custom_woocommerce_product_add_to_cart_text() { | |
| global $product; | |
| $product_type = $product->product_type; | |
| switch ( $product_type ) { |
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( 'wpcf7_form_elements', 'loc_wpcf7_form_elements' ); | |
| function loc_wpcf7_form_elements( $form ) { | |
| $form = do_shortcode( $form ); | |
| return $form; | |
| } |
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 loc_stock_in_shop() { | |
| global $product; | |
| if ( $product->stock ) { | |
| if ( number_format($product->stock) < 3 ) { | |
| echo '<div class="hurryup">Hurry up! Only ' . number_format($product->stock,0,'','') . ' left!</div>'; | |
| } | |
| } | |
| echo '<style> | |
| .hurryup { | |
| color: #ff0000 !important; |
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 loc_disable_feed() { | |
| wp_die( __('Sorry. We do not use or have RSS.') ); | |
| } | |
| add_action('do_feed', 'loc_disable_feed', 1); | |
| add_action('do_feed_rdf', 'loc_disable_feed', 1); | |
| add_action('do_feed_rss', 'loc_disable_feed', 1); | |
| add_action('do_feed_rss2', 'loc_disable_feed', 1); | |
| add_action('do_feed_atom', 'loc_disable_feed', 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( 'gettext', 'loc_woo_translate', 999 ); | |
| function loc_woo_translate( $translated ) { | |
| $translated = str_ireplace( 'Out of stock', 'Coming Soon!', $translated ); | |
| return $translated; | |
| } |