Created
June 23, 2017 15:41
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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