Answer the question
In order to leave comments, you need to log in
How to teach the button to call in more detail the same form as the order button?
Good afternoon! There is such a code in function.php
Help me to make the "Details" button do the same as "Order"
/*Replace the Add to Cart button with more details */
/*Step 1 - Remove the Add to Cart button */
function remove_loop_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
}
add_action('init','remove_loop_button');
/*Step 2 - Adding the Details button */
add_action('woocommerce_after_shop_loop_item','replace_add_to_cart');
function replace_add_to_cart() {
global $product;
$link = $product->get_permalink();
echo do_shortcode(' More ');
}
/* Send request
============================================ ==================*/
function my_price_replace($price, $_product) {
if ($_product->get_price() == 0) return __('
Order
'.do_shortcode('[contact-form-7 id="1446" title="Order"] ').'
');
return $price;
}
add_filter( 'woocommerce_empty_price_html', 'my_price_replace', 1, 2 );
add_filter( 'wpcf7_validate_configuration', '__return_false' );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question