Created
May 13, 2017 07:52
-
-
Save xlplugins/b2083e1e9c570ebb3912a1791eea0198 to your computer and use it in GitHub Desktop.
Change WooCommerce single product positions in H-Code 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
/** | |
* Add This whole code in working theme functions.php to alter woocommerce native positions | |
* | |
* XL WooCommerce Sales Trigger Class Instance | |
*/ | |
if (class_exists('WCST_Core')) { | |
$wcst_plugin_instance = WCST_Core::get_instance(); | |
// removing all positions based action hooks | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_above_title'), 2.2); | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_review'), 11); | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_price'), 17.2); | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_short_desc'), 21.2); | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_add_cart'), 39.2); | |
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_meta'), 41.2); | |
// hooking all positions | |
add_action('hcode_woocommerce_product_single_rating_sku', function() { echo '<div style="clear:both"></div>'; } , 45); | |
add_action('hcode_woocommerce_product_single_rating_sku', array($wcst_plugin_instance, 'wcst_position_below_review'), 50); | |
add_action('hcode_woocommerce_product_single_rating_sku', array($wcst_plugin_instance, 'wcst_position_above_title'), 60); | |
add_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_price'), 21); | |
add_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_short_desc'), 20); | |
add_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_add_cart'), 30); | |
add_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_meta'), 60); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment