michelve / software-license-manager

🔐Wordpress Software License Management. Supports WooCommerce, and WP eStore.
https://epikly.com
GNU General Public License v3.0
77 stars 27 forks source link

Issue with add to cart button #99

Open ricardo777 opened 10 months ago

ricardo777 commented 10 months ago

Hello, I have some trouble with missing the add to cart button, for at least when using Divi builder. The following options resolve the issue.

Via Snippet:

/**
 * Display the 'Add to Cart' button for 'slm_license' product type.
 * This hooks into the custom product type's add to cart action and 
 * uses the default WooCommerce simple product's add to cart functionality.
 */
add_action("woocommerce_slm_license_add_to_cart", function() {
    do_action('woocommerce_simple_add_to_cart');
});

Or adding the following action to the code for example register_template.php

function add_to_cart_button() {
    wc_get_template( 'single-product/add-to-cart/simple.php' );
}
add_action( 'woocommerce_slm_license_add_to_cart', 'add_to_cart_button' );

I am new into Woocommerce so possible this is not the right way, but could not getting anything else working.