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 | |
| $coupon_code = 'UNIQUECODE'; // Code | |
| $amount = '10'; // Amount | |
| $discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product | |
| $coupon = array( | |
| 'post_title' => $coupon_code, | |
| 'post_content' => '', | |
| 'post_status' => 'publish', | |
| 'post_author' => 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
| <?php | |
| add_filter( 'woocommerce_get_price_html', 'price_plus_vat' ); | |
| function price_plus_vat( $price ) { | |
| return $price . ' ' . __( '+ VAT', 'woocommerce' ); | |
| } | |
| ?> |
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 | |
| add_filter( 'woocommerce_product_tax_class', 'big_apple_get_tax_class', 1, 2 ); | |
| function big_apple_get_tax_class( $tax_class, $product ) { | |
| global $woocommerce; | |
| if ( $woocommerce->cart->subtotal <= 110 ) | |
| $tax_class = 'Zero Rate'; | |
| return $tax_class; |
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 code should be added to functions.php of your theme | |
| **/ | |
| add_filter('woocommerce_empty_price_html', 'custom_call_for_price'); | |
| function custom_call_for_price() { | |
| return 'Call for price'; | |
| } |
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
| var getparams = function(param) { | |
| var url = window.location.search.substring(1); | |
| var urlvars = url.split('&'); | |
| for (var i = 0; i < urlvars.length; i++) { | |
| var paramname = urlvars[i].split('='); | |
| if ( paramname[0] == param) { | |
| return paramname[1]; | |
| } | |
| } | |
| }; |
NewerOlder