Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save EricBusch/b65a5cc68430d03a3e9b4a0d0c204e3a to your computer and use it in GitHub Desktop.
Save EricBusch/b65a5cc68430d03a3e9b4a0d0c204e3a to your computer and use it in GitHub Desktop.
This code removes a Datafeedr Comparison Set from appearing below the product's details on the WooCommerce product page and adds it immediately below the product's title on single product pages.
<?php
/**
* Remove Comparison Sets from WooCommerce Product pages.
*
* @see remove_action(), dfrcs_wc_compset_priority()
*/
add_action( 'wp_head', 'mycode_remove_compset_from_woocommerce_product_pages' );
function mycode_remove_compset_from_woocommerce_product_pages() {
remove_action( 'woocommerce_after_single_product_summary', 'dfrcs_wc_single_product_page_compset', 0 );
}
/**
* Insert Comparison Set immediately below the product title on WooCommerce Product pages.
*/
add_action( 'woocommerce_single_product_summary', 'dfrcs_wc_single_product_page_compset', 6 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment