Change position of Comparison Set to appear under product's name

By default, Comparison Sets will appear underneath a product's name, image and price. This code will pull the Comparison Set up so that it appears immediately below the product's name.

Comparison Set under product name

Here's how to make these changes:

1

Create a custom plugin

If you haven't done so already, create a custom plugin.

2

Add custom code

Add the following code to your custom plugin

<?php
/**
* Put the Comparison Set immediately below a Product's Name.
*
* The following 2 actions and 1 function will move a Comparison Set from displaying underneath the WooCommerce
* product's short description to below the product's name and above it's price.
*
* @see remove_action(), dfrcs_wc_compset_priority()
*/
function mycode_remove_compset_from_default_position() {
remove_action(
'woocommerce_after_single_product_summary',
'dfrcs_wc_single_product_page_compset',
dfrcs_wc_compset_priority()
);
}
add_action( 'woocommerce_single_product_summary', 'dfrcs_wc_single_product_page_compset', 6 );
add_action( 'wp_head', 'mycode_remove_compset_from_default_position' );
3

Save

Save your changes

Now your Comparison Sets should appear immediately below your products' names.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us