Created
July 24, 2017 07:03
-
-
Save xlplugins/92a99593325c087c3034dc8362643a3b to your computer and use it in GitHub Desktop.
Change WooCommerce single product page positions for Oxygen theme for XL WooCommerce Sales Trigger Plugin
This file contains hidden or 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
<?php | |
/** | |
* Add This whole code in working theme functions.php inside php tag to alter woocommerce native positions | |
* Theme: Oxygen https://themeforest.net/item/oxygen-woocommerce-wordpress-theme/7851484 | |
* XL WooCommerce Sales Trigger Class Instance | |
*/ | |
add_action('wp', 'oxygen_wcst_modify_positions', 90); | |
if (!function_exists('oxygen_wcst_modify_positions')) { | |
function oxygen_wcst_modify_positions() { | |
if (class_exists('WCST_Core')) { | |
$wcst_core = WCST_Core::get_instance(); | |
// removing wcst action hooks on theme | |
remove_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_review'), 11); | |
remove_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_price'), 17.2); | |
remove_action('woocommerce_after_single_product_summary', array($wcst_core, 'wcst_position_below_related_products'), 21.2); | |
add_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_review'), 1); | |
add_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_price'), 27); | |
add_action('woocommerce_after_single_product', array($wcst_core, 'wcst_position_below_related_products'), 22); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment