This file contains 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
/** | |
* Trim zeros in price decimals | |
**/ | |
add_filter( 'woocommerce_price_trim_zeros', '__return_true' ); |
This file contains 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 // don't include this line in your functions.php, since it already starts with it. | |
/** | |
* Don't show fees that are 0.00 | |
**/ | |
add_filter( 'si_show_all_payment_terms', '__return_false' ); |
This file contains 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 // don't add this line since it's already in your functions.php file | |
/** | |
* Edited invoices | |
*/ | |
function _si_information_meta_box_args( $args ) { | |
if ( 'auto-draft' == $args['post']->post_status ) { // only adjust drafts | |
$args['due_date'] = strtotime('first day of next month'); | |
} | |
return $args; |
This file contains 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
/** | |
* Snippet to set default weight and Dimension if it's not set for any product. | |
* Created at : 14 May 2018 | |
* Updated at : 16 May 2018 | |
* PluginHive Plugins : https://www.pluginhive.com/product-category/woocommerce-plugin/ | |
* Gist Link : https://gist.github.com/xadapter/4fb8dbfc6c025630558e43488775eb7d | |
*/ | |
// To set Default Length | |
add_filter( 'woocommerce_product_get_length', 'xa_product_default_length' ); |
This file contains 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 // don't add this line since it's already in your functions.php file | |
function _si_redirect_url_meta_fields( $fields ) { | |
if ( '' === $fields['payment_redirect']['default'] ) { | |
$fields['payment_redirect']['default'] = 'http://yoursite.com/url/'; | |
} | |
return $fields; | |
} | |
add_filter( 'si_redirect_url_meta_fields', '_si_redirect_url_meta_fields' ); |
This file contains 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
/* example of use */ | |
h1:before { | |
font-family: 'etModules'; | |
content: "\24"; | |
} | |
/* codes */ | |
.arrow_up:before { | |
content: "\21"; |
This file contains 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 another product depending on the cart total | |
*/ | |
add_action( 'template_redirect', 'add_product_to_cart' ); | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
$product_id = 2831; //replace with your product id | |
$found = false; | |
$cart_total = 30; //replace with your cart total needed to add above item |
This file contains 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 USPS Flat rate envelopes from the available options | |
* Once added the customer will not see any rates for envelopes | |
* Only Small, Medium, and Large Flat Rate boxes will be used | |
*/ | |
add_filter( 'wc_usps_flat_rate_boxes', 'custom_usps_flat_rate_boxes' ); | |
function custom_usps_flat_rate_boxes( $flat_rate_boxes ) { | |
unset($flat_rate_boxes["d29"]); | |
unset($flat_rate_boxes["d30"]); |
This file contains 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 | |
function ClearLocalCacheButton() { ?> | |
// Create Button | |
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache"> | |
<span>Clear Cache</span> | |
</a> | |
<script type="text/javascript"> | |
// Move Button to Divi Tabs | |
jQuery(window).load(function(){ |
This file contains 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 | |
function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) { | |
// Put your custom text here in a key => value pair | |
// Example: 'Text you want to change' => 'This is what it will be changed to' | |
// The text you want to change is the key, and it is case-sensitive | |
// The text you want to change it to is the value | |
// You can freely add or remove key => values, but make sure to separate them with a comma | |
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events" |
NewerOlder