<?php

if (!defined('ABSPATH')) {
    exit;
}

if (!function_exists('zc_pri_pricely_hook_live_price')) {

    function zc_pri_pricely_hook_live_price() {
        global $zc_pri;
        $live_price = array(
            'enable' => 'no',
            'position' => 'product_summary_31',
        );

        if (isset($zc_pri['live_price'])) {
            $live_price = $zc_pri['live_price'];
        }


        if ($live_price['enable'] != 'no') {

            if ($live_price['position'] == 'product_summary_4') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 4);
            }
            if ($live_price['position'] == 'product_summary_6') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 6);
            }
            if ($live_price['position'] == 'product_summary_11') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 11);
            }
            if ($live_price['position'] == 'product_summary_21') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 21);
            }
            if ($live_price['position'] == 'product_summary_31') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 31);
            }
            if ($live_price['position'] == 'product_summary_41') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 41);
            }
            if ($live_price['position'] == 'product_summary_51') {
                add_action('woocommerce_single_product_summary', 'WooPricely_Views::live_prices', 51);
            }
        }
    }

}


