<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

$boxHeading = BOX_HEADING_FREE_SHIPPING;
$corner_left = 'rounded';
$corner_right = 'rounded';
$boxContent_attributes = ' align="center"';
$box_base_name = 'free_shipping'; // for easy unique box template setup (added BTSv1.2)

$box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)
$boxContent = '';

if ( MODULE_SHIPPING_FREEAMOUNT_STATUS == 'True' ) {

  $boxContent = '<div class="free_kont">';
  // dodatkowe dla programu lojalnosciowego
  if (defined(MODULE_KLUB_INC_SHIPPING)) {
    if (suma_zamowien() > MODULE_KLUB_KWOTA && MODULE_KLUB_INC_SHIPPING == 'true') {
      if ($cart->count_contents() == 0) {
        $boxContent .= '<div align="center" class="boxText"><b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b></div>';
      }
    } else {
      $boxContent .= '<div align="center" class="boxText">'.MODULE_SHIPPING_FREEAMOUNT_TEXT_1.' '. $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT). ' '. (MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX !='0' ? MODULE_SHIPPING_FREEAMOUNT_TEXT_2 : '' ) .'</div>';
    }
  } else {
    $boxContent .= '<div align="center" class="boxText">'.MODULE_SHIPPING_FREEAMOUNT_TEXT_1.' '. $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT). ' '.(MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX !='0' ? MODULE_SHIPPING_FREEAMOUNT_TEXT_2 : '' ) .'</div>';
  }

  $boxContent .= '<div align="center" class="boxText">';
  if ($cart->count_contents() > 0) {
    if ( $cart->show_weight() < MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX ) {
      // dodatkowe dla programu lojalnosciowego
      if (defined(MODULE_KLUB_INC_SHIPPING)) {
        if (suma_zamowien() > MODULE_KLUB_KWOTA && MODULE_KLUB_INC_SHIPPING == 'true') {
          $boxContent .= '<b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
        } else {
          if ( $cart->show_total() < MODULE_SHIPPING_FREEAMOUNT_AMOUNT ) {
            $boxContent .= '<br><b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT.' ' . $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT - $cart->show_total()) . '</b>';
          } else {
            $boxContent .= '<b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
          }
        }
      } else {
        if ( $cart->show_total() < MODULE_SHIPPING_FREEAMOUNT_AMOUNT ) {
          $boxContent .= '<br><b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT.' ' . $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT - $cart->show_total()) . '</b>';
        } else {
          $boxContent .= '<b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_3 . '</b>';
        }
      }
    } else {
      if ( MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX !='0' ) {
        $boxContent .= '<br><b>' . MODULE_SHIPPING_FREEAMOUNT_TEXT_4 . '</b>';
      }
    }
  }

  $boxContent .= '</div></div>';

  include (bts_select('boxes', $box_base_name)); // BTS 1.5

  $boxContent_attributes = '';

}


if ( MODULE_SHIPPING_FREECOUNT_STATUS == 'True' ) {

  $boxContent = '<div class="free_kont">';
  $boxContent .= '<div align="center" class="boxText">' . MODULE_SHIPPING_FREECOUNT_TEXT_1. ' ' . MODULE_SHIPPING_FREECOUNT_NUMBER . ' ' . MODULE_SHIPPING_FREECOUNT_QTY .'</div>';

  $boxContent .= '<div align="center" class="boxText">';
  if ($total_count < MODULE_SHIPPING_FREECOUNT_NUMBER) {
    $boxContent .= '<b>' . MODULE_SHIPPING_FREECOUNT_TEXT_3 . '</b></div>';
    $boxContent .= '<div align="center" class="boxText">' . MODULE_SHIPPING_FREECOUNT_TEXT_4 . ' ' . (MODULE_SHIPPING_FREECOUNT_NUMBER - $total_count) . ' ' . MODULE_SHIPPING_FREECOUNT_QTY;
  } else {
    $boxContent .= '<div align="center" class="boxText"><b>' . MODULE_SHIPPING_FREECOUNT_TEXT_2 . '</b>';
  }

  $boxContent .= '</div></div>';

  include (bts_select('boxes', $box_base_name)); // BTS 1.5

  $boxContent_attributes = '';

}
?>