I am facing a problem. I am using visual composer shortcode in my WP template and its working well, but now I have added an onClick button to pass some parameter.
When I pass the number its works but when I pass the string it's not working.
function my_functions($atts, $content = null){
$title = 'Test & Title';
$id = '123456'
$envy_html_template ='
<button id="btnAdd"
class="add-to-cart sc-add-to-cart"
onclick="addToCart('.$title.','.$id.' )"
>Test
</button>';
wp_reset_query();
return $envy_html_template;
}
add_shortcode('my_template', 'my_functions');