@ctor I ran into a similar issue where my variable products had no button i was able to fix by adding the following code into my content-product.php override template. I added around line 51. You may need to tinker with the php some to get it how you want but this is the gist of it.
Edit – it isn’t a ‘Add to cart’ button, only a link to product but better than no button ??
<?php
global $product;
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// $product->is_type( $type ) checks the product type, string/array $type ( 'simple', 'grouped', 'variable', 'external' ), returns boolean
if ( $product->is_type( 'variable' ) && is_plugin_active( 'woo-min-max-quantity-limit/woo-min-max-quantity.php' ) ) {
// Output the custom button linked to the product
echo '<div style="margin-bottom:10px;">
<a class="button custom-button" href="' . esc_attr( $product->get_permalink() ) . '">' . __('View product') . '</a>
</div>';
} ?>
-
This reply was modified 6 years, 5 months ago by
ionz149.