: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
exit; // Exit if accessed directly
* Access original fields: $args['mod_settings']
if (themify_is_woocommerce_active()):
wp_enqueue_script( 'tbp' );
$fields_args = wp_parse_args($args['mod_settings'], $fields_default);
unset($args['mod_settings']);
$element_id =$args['module_ID'];
$builder_id=$args['builder_id'];
$mod_name=$args['mod_name'];
$container_class = apply_filters('themify_builder_module_classes', array(
), $mod_name,$element_id, $fields_args);
if(!empty($fields_args['fullwidth']) && 'no' !== $fields_args['fullwidth']){
$container_class[] = 'buttons-fullwidth';
if(!empty($fields_args['global_styles']) && Themify_Builder::$frontedit_active===false){
$container_class[] = $fields_args['global_styles'];
$container_props = apply_filters('themify_builder_module_container_props', self::parse_animation_effect($fields_args,array(
'class' => implode(' ', $container_class),
)), $fields_args, $mod_name, $element_id);
/* this module is used on both single and archive product pages */
$is_single = is_product();
if(Themify_Builder::$frontedit_active===false){
$container_props['data-lazy']=1;
<!-- Add To Cart module -->
<div <?php echo self::get_element_attributes(self::sticky_element_props($container_props, $fields_args)); ?>>
$container_props=$container_class=null;
do_action('themify_builder_background_styling',$builder_id,array('styling'=>$fields_args,'mod_name'=>$mod_name),$element_id,'module');
$the_query = Tbp_Utils::get_wc_actual_query();
if ($the_query===null || $the_query->have_posts()){
if ( $product->get_stock_status() === 'outofstock' ) {
$label = $fields_args['label_outofstock'];
} else if ( $product->get_type() === 'variable' ) {
$label = $fields_args['label_variable'];
$label = $fields_args['label'];
if ( ! empty( $label ) ) {
TB_Add_To_Cart_Module::$cartText = $label;
add_filter( 'woocommerce_product_single_add_to_cart_text', array( 'TB_Add_To_Cart_Module', 'changeCartText' ) );
add_filter( 'woocommerce_product_add_to_cart_text', array( 'TB_Add_To_Cart_Module', 'changeCartText' ) );
if ( $fields_args['quantity'] !== 'yes' ) {
add_filter( 'wc_get_template', array( 'TB_Add_To_Cart_Module', 'filterQuantityInput' ), 10, 5 );
// on archive pages WC by default doesn't show Quantity field
if ( ! $is_single && $product->get_type() === 'simple' ) { ?>
<input type="number" class="input-text qty text filled" step="1" min="1" max="" name="quantity" value="1" title="Qty" size="4" inputmode="numeric" onchange="this.parentElement.nextElementSibling.setAttribute( 'data-quantity', this.value );">
if ( $is_single || ( $fields_args['variable_cart'] === 'yes' && $product->get_type() === 'variable' ) ) {
woocommerce_template_single_add_to_cart();
woocommerce_template_loop_add_to_cart();
if ( $the_query !== null ) {
remove_filter( 'woocommerce_product_single_add_to_cart_text', array( 'TB_Add_To_Cart_Module', 'changeCartText' ) );
remove_filter( 'woocommerce_product_add_to_cart_text', array( 'TB_Add_To_Cart_Module', 'changeCartText' ) );
remove_filter( 'wc_get_template', array( 'TB_Add_To_Cart_Module', 'filterQuantityInput' ) );
<!-- /Add To Cart module -->