• Hi, in the setting of the plugin, I’ve allowed the enquiry button to show up for products list. But as I create pages with Elementor, I put in the product list with shortcode. in the Elementor editor there was enquiry button, while in the frontend, there is no such thing.

    Mant thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi,

    I have the same problem with a theme that uses templates for product sheets.

    I created a small piece of code that solved my problem.

    Code to add at the end of the file in /plugins/woo-quote-or-enquiry-contact-form-7/woocommerce-quote-or-enquiry-contact-form-7.php

    function wqoecf_render_enquiry_button_shortcode($atts) {
        global $product;
    
        $product_id = null;
        if ($product) {
            $product_id = $product->get_id();
        }
    
        if (isset($atts['product_id'])) {
            $product_id = $atts['product_id'];
        }
    
        if (!$product_id) return ''; // retournez rien si l'ID du produit n'est pas fourni
    
        $disable_form = get_option_quote_wqoecf_disable_form($product_id);
        $btntext = "";
        $options = wqoecf_quote_enquiry_options();
    
        if (isset($options['button_text'])) {
            $btntext = $options['button_text'];
        }
    
        if ($disable_form != 'yes') {
            $pro_title = get_the_title($product_id);
            return '<a class="wqoecf_enquiry_button" href="javascript:void(0)" data-product-title="' . $pro_title . '">' . $btntext . '</a>';
        }
    
        return '';
    }
    
    add_shortcode('wqoecf_enquiry_button', 'wqoecf_render_enquiry_button_shortcode');

    Tell me if it works for you. ??

Viewing 1 replies (of 1 total)
  • The topic ‘Enquiry button not showing in the product list via shortcode’ is closed to new replies.