angelosica
Forum Replies Created
-
Brilliant idea – I don’t know why I didn’t think of that. Since the client may be changing this frequently, I am going to try to do this with a tag instead of product IDs.
Thank you!
We removed a bunch of actions, which included the add to cart button. Then we added an action that inserts a Request a Quote Button which opens up a Bootstrap modal window with a form.
Essentially we still have the e-commerce function there – we just removed the ability for the user to click the add to cart button. We obviously never set up a payment gateway either. We are using WooCommerce as an inventory management system essentially.
Here are the two snippets:
function psi_remove_hooks() {
remove_action(‘woocommerce_before_main_content’, ‘woocommerce_breadcrumb’, 20);
remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_meta’, 40);
remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_price’,10);
remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_add_to_cart’,30);
remove_action(‘woocommerce_after_single_product_summary’,’woocommerce_output_related_products’,20);
remove_action(‘woocommerce_before_shop_loop’,’woocommerce_output_all_notices’,10);
remove_action(‘woocommerce_before_shop_loop’,’woocommerce_result_count’,20);
remove_action(‘woocommerce_before_shop_loop’,’woocommerce_catalog_ordering’,30);
}
add_action(‘woocommerce_before_main_content’, ‘psi_remove_hooks’, 1);function psi_request_a_quote() {
echo ‘<button type=”button” data-toggle=”modal” data-target=”#request-a-quote” class=”product-btn”>Request a quote</button>’;
}
add_action( ‘woocommerce_single_product_summary’, ‘psi_request_a_quote’, 30 );- This reply was modified 6 years, 3 months ago by angelosica.