Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created June 23, 2017 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlplugins/0678c558e328d00b81ba9bec8ccad127 to your computer and use it in GitHub Desktop.
Save xlplugins/0678c558e328d00b81ba9bec8ccad127 to your computer and use it in GitHub Desktop.
This code runs with Finale: WooCommerce Countdown Timer plugin. Unhook the grid display function on native 'woocommerce_after_shop_loop_item' handle and register with new position handle
/**
* Add This whole code in working theme functions.php inside php tag to alter woocommerce native 'shop loop' position
* Finale WooCommerce Sales Trigger
* https://xlplugins.com/finale-woocommerce-sales-countdown-timer-discount-plugin/
*/
add_action('wp', 'theme_slug_wcct_modify_positions', 99);
if (!function_exists('theme_slug_wcct_modify_positions')) {
function theme_slug_wcct_modify_positions() {
if (function_exists('WCCT_Core')) {
$wcct_appearance_instance = WCCT_Core()->appearance;
// removing after shop loop hook
remove_action('woocommerce_after_shop_loop_item', array($wcct_appearance_instance, 'wcct_bar_timer_show_on_grid'), 9);
// hooking after shop loop function
add_action('woocommerce_proper_shop_loop_position', array($wcct_appearance_instance, 'wcct_bar_timer_show_on_grid'), 20);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment