xlplugins
7/21/2017 - 10:36 AM

Change WooCommerce single product page positions for Merchandiser theme for Finale: WooCommerce Sales Countdown Timer & Discount Plugin

Change WooCommerce single product page positions for Merchandiser theme for Finale: WooCommerce Sales Countdown Timer & Discount Plugin

<?php

/**
 * Add This whole code in working theme functions.php inside php tag to alter woocommerce native positions
 * Theme: https://themeforest.net/item/merchandiser-ecommerce-wordpress-theme-for-woocommerce/15791151
 * Finale: WooCommerce Sales Countdown Timer & Discount Plugin
 */
add_action('wp', 'merchandiser_wcct_modify_positions', 90);
if (!function_exists('merchandiser_wcct_modify_positions')) {

    function merchandiser_wcct_modify_positions() {
        if (function_exists('WCCT_Core')) {
            $wcct_core = WCCT_Core()->appearance;

            // removing wcct action hooks on theme
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_above_title'), 2.3);
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_below_title'), 9.3);
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_below_review'), 11.3);
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_below_price'), 17.3);
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_below_short_desc'), 21.3);
            remove_action('woocommerce_single_product_summary', array($wcct_core, 'wcct_position_below_add_cart'), 39.3);

            add_action('woocommerce_single_product_summary_single_title', array($wcct_core, 'wcct_position_above_title'), 4);
            add_action('woocommerce_single_product_summary_single_title', array($wcct_core, 'wcct_position_below_title'), 7);
            add_action('woocommerce_single_product_summary_single_excerpt', array($wcct_core, 'wcct_position_below_review'), 16);
            add_action('woocommerce_single_product_summary_single_excerpt', array($wcct_core, 'wcct_position_below_price'), 17);
            add_action('woocommerce_single_product_summary_single_excerpt', array($wcct_core, 'wcct_position_below_short_desc'), 22);
            add_action('woocommerce_single_product_summary_single_add_to_cart', array($wcct_core, 'wcct_position_below_add_cart'), 32);
        }
    }

}