I'm building a WooCommerce webshop with Oxygen builder. Now I've got my product pages and all set up and functional, but I'd like to have a second element (a DIV with the fa-cart-plus icon in it) as an additional "Add to cart" button.
Now I've found the following:
global $woocommerce;
$woocommerce->cart->add_to_cart( $product_id, 1 );
but I have no idea how to call this from an onclick event. It feels a bit like having all the ingredients but not knowing how to turn them into a cake. Is there anyone here who can help?