public function ajaxProcessGetPrices()
 {
     $return = $prices = array();
     $store = new AphStore(Context::getContext()->shop->id);
     $this->id_current_product = (int) Tools::getValue('id_current_product');
     $custom_prices_of_shop = AphCustomPrice::getBetweenDates((int) Context::getContext()->shop->id, (int) Context::getContext()->currency->id, $store->id_country, 0, Tools::getValue('start'), Tools::getValue('end'), 0, $this->id_current_product);
     if (!empty($custom_prices_of_shop) && is_array($custom_prices_of_shop)) {
         foreach ($custom_prices_of_shop as $custom_price) {
             $product = new Product($custom_price['id_product'], false, (int) Context::getContext()->language->id);
             $custom_price['product_name'] = $product->name;
             $custom_price['id_product'] = $product->id;
             if ($custom_price['id_offer'] > 0) {
                 $offer = new AphOffer($custom_price['id_offer'], (int) Context::getContext()->language->id, (int) Context::getContext()->shop->id);
             }
             if ($custom_price['time_start'] != '00:00:00' && $custom_price['time_end'] != '00:00:00') {
                 for ($day = strtotime(substr($custom_price['from'], 0, 10)); $day <= strtotime(substr($custom_price['to'], 0, 10)); $day = strtotime('+1 day', $day)) {
                     if (empty($custom_price['day_' . date('w', $day)])) {
                         continue;
                     }
                     $new_price = $custom_price['price_wt'] < 0 ? $custom_price['reduction_type'] == 'percentage' ? '-' . round($custom_price['reduction']) . '%' : '-' . Tools::displayPrice($custom_price['reduction'], (int) $custom_price['id_currency']) : Tools::displayPrice($custom_price['price_wt'], (int) $custom_price['id_currency']) . ' ';
                     $week_days = '';
                     foreach ($this->week_days as $d => $week_day) {
                         if (!empty($custom_price['day_' . $d])) {
                             $week_days .= !empty($week_days) ? ', ' : '';
                             $week_days .= $week_day;
                         }
                     }
                     $week_days = utf8_encode($week_days);
                     $title = '' . (!empty($this->id_current_product) ? '' : $custom_price['product_name'] . '<br/>') . $new_price . '<br/>' . $week_days;
                     $prices[] = array('id' => $custom_price['id_custom_price'], 'title' => $title, 'offer' => !empty($offer) ? $offer->name : '', 'reduction' => $new_price, 'product' => !empty($product) ? $product->name : '', 'allDay' => false, 'start' => date('Y-m-d', $day) . ' ' . $custom_price['time_start'], 'end' => date('Y-m-d', $day) . ' ' . $custom_price['time_end'], 'object_id' => $custom_price['id_custom_price'], 'object_typology' => $custom_price['id_offer'] > 0 ? 'offer' : 'custom_price', 'editable' => $custom_price['id_offer'] > 0 ? false : true, 'className' => !empty($custom_price['leave_bprice']) ? 'price_discount' : 'price_edited', 'backgroundColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'borderColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'textColor' => 'white');
                 }
             } elseif (in_array(1, array($custom_price['day_0'], $custom_price['day_1'], $custom_price['day_2'], $custom_price['day_3'], $custom_price['day_4'], $custom_price['day_5'], $custom_price['day_6']))) {
                 for ($day = strtotime(substr($custom_price['from'], 0, 10)); $day <= strtotime(substr($custom_price['to'], 0, 10)); $day = strtotime('+1 day', $day)) {
                     if (empty($custom_price['day_' . date('w', $day)])) {
                         continue;
                     }
                     $new_price = $custom_price['price_wt'] < 0 ? $custom_price['reduction_type'] == 'percentage' ? '-' . round($custom_price['reduction']) . '%' : '-' . Tools::displayPrice($custom_price['reduction'], (int) $custom_price['id_currency']) : Tools::displayPrice($custom_price['price_wt'], (int) $custom_price['id_currency']) . ' ';
                     $week_days = '';
                     foreach ($this->week_days as $d => $week_day) {
                         if (!empty($custom_price['day_' . $d])) {
                             $week_days .= !empty($week_days) ? ', ' : '';
                             $week_days .= $week_day;
                         }
                     }
                     $week_days = utf8_encode($week_days);
                     $title = '' . (!empty($this->id_current_product) ? '' : $custom_price['product_name'] . '<br/>') . $new_price . '<br/>' . $week_days;
                     $prices[] = array('id' => $custom_price['id_custom_price'], 'title' => $title, 'offer' => !empty($offer) ? $offer->name : '', 'reduction' => $new_price, 'product' => !empty($product) ? $product->name : '', 'allDay' => true, 'start' => date('Y-m-d', $day), 'end' => date('Y-m-d', $day), 'object_id' => $custom_price['id_custom_price'], 'object_typology' => $custom_price['id_offer'] > 0 ? 'offer' : 'custom_price', 'editable' => $custom_price['id_offer'] > 0 ? false : true, 'className' => !empty($custom_price['leave_bprice']) ? 'price_discount' : 'price_edited', 'backgroundColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'borderColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'textColor' => 'white');
                 }
             } elseif (empty($custom_price['removable'])) {
                 if (!empty($this->id_current_product)) {
                     $new_price = $custom_price['price_wt'] < 0 ? $custom_price['reduction_type'] == 'percentage' ? '-' . round($custom_price['reduction']) . '%' : '-' . Tools::displayPrice($custom_price['reduction'], (int) $custom_price['id_currency']) : Tools::displayPrice($custom_price['price_wt'], (int) $custom_price['id_currency']) . ' ';
                     $title = '' . $new_price . '';
                     $prices[] = array('id' => $custom_price['id_custom_price'], 'title' => $title, 'allDay' => substr($custom_price['from'], 11) == '00:00:00' && substr($custom_price['to'], 11) == '00:00:00' ? true : false, 'start' => str_replace(' ', 'T', $custom_price['from']), 'end' => str_replace(' ', 'T', $custom_price['to']), 'object_id' => $custom_price['id_custom_price'], 'object_typology' => 'auto_price', 'editable' => false, 'className' => !empty($custom_price['leave_bprice']) ? 'price_discount' : 'price_edited', 'backgroundColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'borderColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'textColor' => 'white');
                 }
             } else {
                 $new_price = $custom_price['price_wt'] < 0 ? $custom_price['reduction_type'] == 'percentage' ? '-' . round($custom_price['reduction']) . '%' : '-' . Tools::displayPrice($custom_price['reduction'], (int) $custom_price['id_currency']) : Tools::displayPrice($custom_price['price_wt'], (int) $custom_price['id_currency']) . ' ';
                 $title = '' . $new_price . '';
                 $prices[] = array('id' => $custom_price['id_custom_price'], 'title' => $title, 'offer' => !empty($offer) ? $offer->name : '', 'reduction' => $new_price, 'product' => !empty($product) ? $product->name : '', 'allDay' => substr($custom_price['from'], 11) == '00:00:00' && substr($custom_price['to'], 11) == '00:00:00' ? true : false, 'start' => str_replace(' ', 'T', $custom_price['from']), 'end' => str_replace(' ', 'T', $custom_price['to']), 'object_id' => $custom_price['id_custom_price'], 'object_typology' => $custom_price['id_offer'] > 0 ? 'offer' : 'custom_price', 'editable' => $custom_price['id_offer'] > 0 ? false : true, 'className' => !empty($custom_price['leave_bprice']) ? 'price_discount' : 'price_edited', 'backgroundColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'borderColor' => $custom_price['id_offer'] > 0 ? '#00aff0' : '#e0027a', 'textColor' => 'white');
             }
         }
     }
     $return['prices'] = $prices;
     $return['id_current_product'] = $this->id_current_product;
     die(Tools::jsonEncode($return));
 }