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_get_price_html', 'wc_ninja_add_sc_price_display', 20 ); | |
function wc_ninja_add_sc_price_display( $price ) { | |
echo do_shortcode( '[woocommerce_currency_converter] ' ); | |
return $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
function custom_flatsome_woocommerce_shop_loop_excerpt(){ | |
if(!flatsome_option('short_description_in_grid')) return; ?> | |
<p class="box-excerpt is-small"> | |
<?php /*echo get_the_excerpt();*/ ?> | |
<?php echo wp_trim_words( get_the_excerpt(), 10); ?> | |
</p> | |
<?php | |
} | |
add_action('flatsome_product_box_after', 'custom_flatsome_woocommerce_shop_loop_excerpt', 21); |
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 | |
/** | |
* An email to ask the vendor to check availability of a booking. | |
* | |
* @extends \WC_Email | |
* | |
* Code copied from: https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/ | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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 | |
/** | |
* Client wants only logged in users to see prices and buy non-sale items while allowing all users to see prices and buy | |
* on sale items | |
*/ | |
/** | |
* | |
* filters woocommerce_is_purchasable for not onsale items | |
* |
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_action('comment_unapproved_to_approved', 'comment_approved'); | |
function comment_approved($comment) { | |
$comment_product_id = $comment ->comment_post_ID; | |
if ( get_post_type($comment_product_id) == 'product' ) { | |
//if is true | |
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 // don't include this in your functions.php, since the start of the file should already have it | |
add_filter( 'si_disable_create_invoice_on_est_acceptance', '__return_true' ); |
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 // don't include this in your functions.php, since the start of the file should already have it | |
function maybe_send_invoice_notification( SI_Invoice $invoice, $status = '' ) { | |
if ( SI_Invoice::STATUS_PENDING === $status ) { | |
$client = $invoice->get_client(); | |
if ( ! is_a( $client, 'SI_Client' ) ) { | |
return; | |
} | |
$recipients = $client->get_associated_users(); | |
if ( empty( $recipients ) ) { |
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 | |
function change_yoast_seo_og_meta() { | |
add_filter( 'wpseo_opengraph_desc', 'change_desc' ); | |
} | |
function change_desc( $desc ) { | |
// This article is actually a landing page for an eBook | |
if( is_singular( 123 ) ) { |
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 | |
// Remove that PHP above if you are having errors come up after saving the file. | |
/** | |
* Hide shipping rates when free shipping is available. | |
* Updated to support WooCommerce 2.6 Shipping Zones. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ |
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 | |
/** | |
* DO NOT EDIT THIS FILE! Instead customize it via a theme override. | |
* | |
* Any edit will not be saved when this plugin is upgraded. Not upgrading will prevent you from receiving new features, | |
* limit our ability to support your site and potentially expose your site to security risk that an upgrade has fixed. | |
* | |
* https://sproutapps.co/support/knowledgebase/sprout-invoices/customizing-templates/ | |
* |