<?php

defined('_VALID_CALL') or die('Direct Access is not allowed.');

include_once 'customers_discount_functions.php';

hook_customersdiscount_store_main_handler_php_bottom();

function hook_customersdiscount_store_main_handler_php_bottom(): void
{
    if(USER_POSITION == 'store') {
        $customer_group_discount = get_customer_group_discount($_SESSION['cart']->content_total['plain']);
        if ($customer_group_discount != $_SESSION['customer_group_discount']) {
            $_SESSION['customer_group_discount'] = $customer_group_discount;
            sessionCart()->_refresh();
        }
    }
}
