Hi, before cornerstones recent major update that added the modal element, I was using an add-on plugin called Cornerstone Power Pack to change the “Add to Cart” buttons on out of stock products to “Contact Us” modals.
//Add to Cart Function
add_action('woocommerce_single_product_summary','replace_add_to_cart');
function replace_add_to_cart() {
global $product;
if ( ! $product->is_in_stock() ){
remove_action( 'woocommerce_single_product_summary','woocommerce_template_single_add_to_cart');
add_action( 'woocommerce_single_product_summary','consult_bezambar_expert', 30 );
function consult_bezambar_expert() {
global $product;
$product = get_product();
$product_title = get_the_title( $product->ID );
$product_sku= $product->sku;
echo do_shortcode ('[cs_cs_modal modalcontent="[gravityform id="1" name="Connect with a Retail Partner" title="false" description="true" field_values="title_product='.$product_title.'" field_values="sku_product='.$product_sku.'" ajax="true" tabindex="1"]" theme="plain" display_on="button" button_size="default" button_text="Order Now" delay="2"]');
}
}
}
Now, the add-on modal is no longer displaying properly (resizing and scrolling issues). How would I accomplish this with the modal provided by cornerstone given that the customizations are not reflected in the shortcode?