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 | |
| /** | |
| * Programmatically alter the WooCommerce cart discount total (and apply a new discount) before it's calculated | |
| * through the woocommerce_calculate_totals hook. | |
| * | |
| * For example, if you want to apply an arbitrary discount after a certain number of products in the cart, | |
| * you can loop through that number and increment it as needed. | |
| * | |
| * In this example, I increment the discount by $8.85 after every 15 products added to the cart. | |
| * |
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
| <?xml version="1.0"?> | |
| <layout> | |
| <default> | |
| <!--Root/Default Layouts--> | |
| <reference name="root"> | |
| <!--Appending Block--> | |
| <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> | |
| </reference> | |
| <!--CSS and JS Files--> |
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 ( !class_exists( 'CWS_Plugin_v2' ) ) : | |
| class CWS_Plugin_v2 { | |
| public function hook( $hook ) { | |
| $priority = 10; | |
| $method = $this->sanitize_method( $hook ); | |
| $args = func_get_args(); | |
| unset( $args[0] ); | |
| foreach ( (array) $args as $arg ) { | |
| if ( is_int( $arg ) ) |
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 the field to the checkout | |
| **/ | |
| add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
| function my_custom_checkout_field( $checkout ) { | |
| echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
| /** |
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
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(window).load(function(){ | |
| $().hatchShow(); | |
| }); | |
| jQuery.fn.hatchShow = function(){ | |
| $('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){ | |
| var t = $(this); | |
| t.wrap("<span class='hatchshow_temp' style='display:block'>"); | |
| var pw = t.parent().width(); |