Hello again,
Hope you can help me with this. I would like to add a custom function code with class for visual composer.
add_filter( 'woocommerce_loop_add_to_cart_link', 'businessbloomer_add_target_blank', 10, 2 );
function businessbloomer_add_target_blank( $product, $args ){
$link = sprintf( '<a href="%s" target="_blank" data-quantity="%s" class="%s" %s>%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
esc_html( $product->add_to_cart_text() )
);
return $link;
}
So let me explain what i need: I’m currently have a custom product builder and i will put your popup with some products on them, but when i will click on products i will like them to open in a new tab.
I’m thinking adding a custom classes on visual composer so only those products will run like that(openeing in a new tab)
Waiting for your answer. Hope it is possible 😀