Skip to content

Instantly share code, notes, and snippets.

@bainternet
Created October 11, 2018 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bainternet/17ebbd069763eb17dc7ef5de5faa0ad0 to your computer and use it in GitHub Desktop.
Save bainternet/17ebbd069763eb17dc7ef5de5faa0ad0 to your computer and use it in GitHub Desktop.
dd support for "Addify - Hide Product Price" to Elementor Price, and Add to Cart widgets
<?php
/**
* Add support for "Addify - Hide Product Price" to
* Elementor Price, and Add to Cart widgets
*/
add_filter( 'elementor/widget/render_content', function ( $widget_content, $widget ) {
global $product;
// Make sure its an add to cart or price widget
$widget_name = $widget->get_name();
if ( ! in_array( $widget_name, [ 'wc-add-to-cart', 'woocommerce-product-price' ] ) ) {
return $widget_content;
}
// Make sure the 3rd party plugin is loaded
if ( ! function_exists( 'show_text_add_to_cart_link' ) ) {
return $widget_content;
}
return show_text_add_to_cart_link( $widget_content, $product );
}, 10 ,2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment