Hey @deltadude and @willoftheweb
Please add the following code in your theme or child theme’s functions.php file:
add_filter('wp_head', 'pe_is_divi_single_product_page_layout_enabled', 20);
function pe_is_divi_single_product_page_layout_enabled()
{
// Check if PEP plugin is active
if (is_plugin_active('product-enquiry-for-woocommerce/product-enquiry-for-woocommerce.php')) {
// Check if single product page and Divi Layout has been set
if (is_product() && defined('ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE') && 'et_body_layout' == ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE) {
if (!class_exists('PE_Public_Enquiry_Button')) {
include_once(WDM_PE_PLUGIN_PATH . 'public/class-pe-public-enquiry-button.php');
}
$enq_btn = PE_Public_Enquiry_Button::instance();
remove_action( 'woocommerce_single_product_summary', array($enq_btn, 'render_enquiry_button'), 30);
remove_action( 'woocommerce_after_single_product_summary', array($enq_btn, 'render_enquiry_button'), 10);
// Add PEP button after the add to cart form
add_action('woocommerce_after_add_to_cart_form', 'pe_add_enq_btn_66737');
}
}
}
function pe_add_enq_btn_66737()
{
if(!class_exists('PE_Public_Enquiry_Button')) {
include_once(WDM_PE_PLUGIN_PATH . 'public/class-pe-public-enquiry-button.php');
}
$enq_btn = PE_Public_Enquiry_Button::instance();
$enq_btn->render_enquiry_button();
}
The above code will remove the PEFree enquiry button from the top-left corner and will add the enquiry button after the add to cart form.
Please test this at your end and let us know if the issue is resolved for you ??