Slide 13
Slide 13 text
Filters - Example
Ways to Customize WooCommerce > Actions, Filters, Events > Filters
public function single_add_to_cart_text() {
return apply_filters( 'woocommerce_product_single_add_to_cart_text', __( 'Add to cart', 'woocommerce' ), $this );
}
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wc_filter_example', 10, 2 );
function wc_filter_example( $original_text, $product ) {
return __( 'Αγόρασε Τώρα!', 'storefront-child' );
}
apply_filters in WooCommerce Core file
add_filter in your child theme or plugin $tag $function
$tag $value_to_filter $arg
$args_number