コード例 #1
0
 /**
  * @param Varien_Object $_row
  * @return string
  */
 public function render(Varien_Object $_row)
 {
     $this->setOrder($_row);
     $_shipmentCollectionAll = Mage::getResourceModel('sales/order_shipment_collection')->addFieldToFilter('order_id', array('eq' => $_row->getEntityId()));
     $_shipmentCollection = Mage::getResourceModel('payperrentals/sendreturn_collection')->addFieldToFilter('order_id', array('in' => array($_row->getEntityId(), $_row->getIncrementId())));
     $_totalQtyShipped = 0;
     $_shippedDate = '';
     $_shippedUnixtimeDate = 0;
     foreach ($_shipmentCollection as $_shipmentItem) {
         if ($_shipmentItem->getSendDate() != '0000-00-00 00:00:00' && $_shipmentItem->getSendDate() != '1970-01-01 00:00:00') {
             $_totalQtyShipped += $_shipmentItem->getQty();
         }
     }
     $_totalQtyShippedAll = 0;
     foreach ($_shipmentCollectionAll as $_shipmentItem) {
         $_totalQtyShippedAll += $_shipmentItem->getTotalQty();
         if ($_shippedUnixtimeDate < strtotime($_shipmentItem->getCreatedAt())) {
             $_shippedDate = $_shipmentItem->getCreatedAt();
             $_shippedUnixtimeDate = strtotime($_shipmentItem->getCreatedAt());
         }
     }
     Mage::unregister('total_qty_shipped');
     Mage::register('total_qty_shipped', $_totalQtyShipped);
     /*$_totalQtyShipped = $this->_getValue($_row);*/
     $_realOrder = Mage::getModel('sales/order')->load($_row->getId());
     $_totalQtyOrdered = (int) $_realOrder->getTotalQtyOrdered();
     $_shipButtonHtml = $this->_getShipButtonHtml();
     if (!$_totalQtyShippedAll) {
         return Mage::helper('payperrentals')->__('Not Shipped') . '<br/>' . $_shipButtonHtml;
     } elseif ($_totalQtyShippedAll < $_totalQtyOrdered) {
         return Mage::helper('payperrentals')->__('Partially Shipped') . '<br/>' . $_shipButtonHtml;
     } else {
         return ITwebexperts_Payperrentals_Helper_Date::formatDbDate($_shippedDate, true, true);
     }
 }
コード例 #2
0
ファイル: Datetime.php プロジェクト: hueyl77/fourwindsgear
 public function render(Varien_Object $row)
 {
     $data = $row->getData($this->getColumn()->getIndex());
     if ($data != '') {
         $data = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($data, false, false);
     } else {
         /** @var $sOrder Mage_Sales_Model_Order */
         $sOrder = Mage::getModel('sales/order')->load($row->getId());
         $items = $sOrder->getItemsCollection();
         /** @var $item Mage_Sales_Model_Order_Item */
         foreach ($items as $item) {
             /** @var $Product Mage_Catalog_model_Product */
             $Product = Mage::getModel('catalog/product')->load($item->getProductId());
             if ($Product->getTypeId() != ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE && $Product->getTypeId() != ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_CONFIGURABLE) {
                 continue;
             }
             $data1 = $item->getProductOptionByCode('info_buyRequest');
             if ($this->getColumn()->getIndex() == 'start_date') {
                 $data = $data1[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::START_DATE_OPTION];
                 break;
             }
             if ($this->getColumn()->getIndex() == 'end_date') {
                 $data = $data1[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::END_DATE_OPTION];
                 break;
             }
         }
     }
     return $data;
 }
コード例 #3
0
ファイル: ReturnState.php プロジェクト: hueyl77/fourwindsgear
 /**
  * @param Varien_Object $_row
  * @return string
  */
 public function render(Varien_Object $_row)
 {
     $this->setOrder($_row);
     $_returnCollection = Mage::getResourceModel('payperrentals/sendreturn_collection')->addFieldToFilter('order_id', array('in' => array($_row->getEntityId(), $_row->getIncrementId())));
     $_totalQtyReturned = 0;
     $_returnedDate = '';
     $_returnedUnixtimeDate = 0;
     $this->_hasShipmentInDb = false;
     if (count($_returnCollection)) {
         $this->_hasShipmentInDb = true;
     }
     foreach ($_returnCollection as $_returnItem) {
         if ($_returnItem->getReturnDate() != '0000-00-00 00:00:00' && $_returnItem->getReturnDate() != '1970-01-01 00:00:00') {
             $_totalQtyReturned += $_returnItem->getQty();
             if ($_returnedUnixtimeDate < strtotime($_returnItem->getReturnDate())) {
                 $_returnedDate = $_returnItem->getReturnDate();
                 $_returnedUnixtimeDate = strtotime($_returnItem->getReturnDate());
             }
         }
     }
     $callingBlock = $this->getColumn()->getGrid()->getId();
     if ($callingBlock == "sales_returnlate_grid") {
         /* START code below is for when return is used WITHOUT the ship render on late returns page */
         $_shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')->addFieldToFilter('order_id', array('eq' => $_row->getEntityId()));
         $_totalQtyShipped = 0;
         $_shippedDate = '';
         $_shippedUnixtimeDate = 0;
         foreach ($_shipmentCollection as $_shipmentItem) {
             $_totalQtyShipped += $_shipmentItem->getTotalQty();
             if ($_shippedUnixtimeDate < strtotime($_shipmentItem->getCreatedAt())) {
                 $_shippedDate = $_shipmentItem->getCreatedAt();
                 $_shippedUnixtimeDate = strtotime($_shipmentItem->getCreatedAt());
             }
         }
         Mage::unregister('total_qty_shipped');
         Mage::register('total_qty_shipped', $_totalQtyShipped);
     }
     /* END code below is for when return is used WITHOUT the ship render on late returns page */
     $_totalQtyShipped = Mage::registry('total_qty_shipped') ? Mage::registry('total_qty_shipped') : 0;
     $this->_totalQtyShipped = $_totalQtyShipped;
     $this->_totalQtyReturned = $_totalQtyReturned;
     $_buttonHtml = $this->_getReturnButtonHtml();
     if (!$_totalQtyReturned) {
         return Mage::helper('payperrentals')->__('Not Returned') . '<br/>' . $_buttonHtml;
     } elseif ($_totalQtyReturned < $_totalQtyShipped) {
         return Mage::helper('payperrentals')->__('Partially Returned') . '<br/>' . $_buttonHtml;
     } else {
         return ITwebexperts_Payperrentals_Helper_Date::formatDbDate($_returnedDate, true, true);
     }
 }
コード例 #4
0
ファイル: Returndate.php プロジェクト: hueyl77/fourwindsgear
 public function render(Varien_Object $row)
 {
     $column = $this->getColumn()->getIndex();
     $data = $row->getData($column);
     if ($data == '0000-00-00 00:00:00' || $data == '1970-01-01 00:00:00' || $data == null) {
         if ($column == 'send_date') {
             $data = "Not Sent";
         } else {
             $data = "Not Returned";
         }
     } else {
         $data = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($data, false, true);
     }
     return $data;
 }
コード例 #5
0
ファイル: Inventory.php プロジェクト: hueyl77/fourwindsgear
 public function getDateDetails($orderArr)
 {
     $orderIdsAr = explode(';', $orderArr[1]);
     $orderCollections = Mage::getModel('payperrentals/reservationorders')->getCollection()->addProductIdFilter($orderArr[2]);
     Mage::dispatchEvent('ppr_before_filter_order', array('collection' => $orderCollections));
     $orderCollections->addOrderIdsFilter($orderIdsAr);
     //$orderCollections->groupByOrder();
     $hasDropoff = false;
     $hasTurnover = false;
     $orderList = '';
     foreach ($orderCollections as $orderItem) {
         $order = Mage::getModel('sales/order')->load($orderItem->getOrderId());
         if ($order->getSendDatetime()) {
             $hasDropoff = true;
         }
         if ($order->getReturnDatetime()) {
             $hasDropoff = true;
         }
         if ($orderItem->getStartTurnoverBefore()) {
             $hasTurnover = true;
         }
         if ($orderItem->getEndTurnoverAfter()) {
             $hasTurnover = true;
         }
     }
     foreach ($orderCollections as $orderItem) {
         $orderList .= '<tr>';
         $order = Mage::getModel('sales/order')->load($orderItem->getOrderId());
         $shippingId = $order->getShippingAddressId();
         if (empty($shippingId)) {
             $shippingId = $order->getBillingAddressId();
         }
         $address = Mage::getModel('sales/order_address')->load($shippingId);
         $customerName = $address->getFirstname() . ' ' . $address->getLastname();
         $isManualReservation = false;
         if ($orderItem->getOrderId() == 0) {
             $isManualReservation = true;
         }
         /* if is manual reservation, show order comments instead of first/last name since there is none */
         if ($isManualReservation == true) {
             $orderList .= '<td>';
             $orderList .= $this->__('None');
             $orderList .= '</td>';
             $orderList .= '<td>';
             $orderList .= $orderItem->getComments();
             $orderList .= '</td>';
         } else {
             $orderList .= '<td>';
             $orderList .= $order->getIncrementId();
             $orderList .= '</td>';
             $orderList .= '<td>';
             $orderList .= $customerName;
             $orderList .= '</td>';
         }
         $orderList .= '<td>';
         $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getStartDate());
         $orderList .= '</td>';
         $orderList .= '<td>';
         $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getEndDate());
         $orderList .= '</td>';
         if ($hasDropoff) {
             $orderList .= '<td>';
             if ($orderItem->getDropoff()) {
                 $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getDropoff());
             } else {
                 $orderList .= '&nbsp;';
             }
             $orderList .= '</td>';
         }
         if ($hasDropoff) {
             $orderList .= '<td>';
             if ($orderItem->getPickup()) {
                 $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getPickup());
             } else {
                 $orderList .= '&nbsp;';
             }
             $orderList .= '</td>';
         }
         if ($hasTurnover) {
             $orderList .= '<td>';
             if ($orderItem->getStartTurnoverBefore()) {
                 $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getStartTurnoverBefore());
             } else {
                 $orderList .= '&nbsp;';
             }
             $orderList .= '</td>';
         }
         if ($hasTurnover) {
             $orderList .= '<td>';
             if ($orderItem->getEndTurnoverAfter()) {
                 $orderList .= ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderItem->getEndTurnoverAfter());
             } else {
                 $orderList .= '&nbsp;';
             }
             $orderList .= '</td>';
         }
         $orderList .= '<td>';
         $orderList .= $orderItem->getQty();
         $orderList .= '</td>';
         if ($isManualReservation == true) {
             $orderList .= '<td>';
             $orderList .= $this->__('None');
             $orderList .= '</td>';
         } else {
             $orderList .= '<td>';
             if (Mage::helper('itwebcommon')->isVendorAdmin()) {
                 $orderList .= '<a href="' . Mage::getUrl('vendors/sales_order/view', array('order_id' => $order->getEntityId())) . '">' . Mage::helper('payperrentals')->__('View') . '</a>';
             } else {
                 $orderList .= '<a href="' . Mage::getUrl('adminhtml/sales_order/view', array('order_id' => $order->getEntityId())) . '">' . Mage::helper('payperrentals')->__('View') . '</a>';
             }
             $orderList .= '</td>';
         }
         $orderList .= '</tr>';
     }
     $orderList = '<table cellpadding="10" cellspacing="10" border="0" style="min-width:400px;">
                     <tr>
                         <td style="font-weight: bold">' . $this->__('Order') . '</td>
                         <td style="font-weight: bold">' . $this->__('Customer Name') . '</td>
                         <td style="font-weight: bold">' . $this->__('Start') . '</td>
                         <td style="font-weight: bold">' . $this->__('End') . '</td>' . ($hasDropoff ? '<td style="font-weight: bold">' . $this->__('Dropoff') . '</td>
                                         <td style="font-weight: bold">' . $this->__('Pickup') . '</td>' : '') . ($hasTurnover ? '<td style="font-weight: bold">' . $this->__('Start W/Turnover') . '</td>
                                          <td style="font-weight: bold">' . $this->__('End W/Turnover') . '</td>' : '') . '<td style="font-weight: bold">' . $this->__('Qty') . '</td>
                         <td style="font-weight: bold">' . $this->__('View Order') . '</td>
                    </tr>' . $orderList;
     $orderList .= '</table>';
     $details['html'] = $orderList;
     $details['date'] = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($orderArr[0]);
     return $details;
 }
コード例 #6
0
ファイル: Price.php プロジェクト: hueyl77/fourwindsgear
 private static function _printAvailableDate($product)
 {
     $availableDate = null;
     if ($product->getTypeId() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE) {
         $range = ITwebexperts_Payperrentals_Helper_Data::getFirstAvailableDateRange($product);
     } else {
         $bundleDefaultSelections = ITwebexperts_Payperrentals_Helper_Data::getDefaultSelectionsForBundle($product);
         $minimumDate = null;
         foreach ($bundleDefaultSelections as $productId) {
             $newRange = ITwebexperts_Payperrentals_Helper_Data::getFirstAvailableDateRange($productId);
             if (is_null($minimumDate) || strtotime($minimumDate) < $newRange['start_date']) {
                 $minimumDate = $newRange['start_date'];
                 $range = $newRange;
             }
         }
     }
     if (isset($range)) {
         if ($range['start_date'] != '0') {
             $nextAvail = Mage::helper('payperrentals')->__('Next Available Date: ') . ITwebexperts_Payperrentals_Helper_Date::formatDbDate($range['start_date']);
         } else {
             $nextAvail = '';
         }
         $availableDate = $nextAvail;
     }
     return $availableDate;
 }
コード例 #7
0
ファイル: Emails.php プロジェクト: hueyl77/fourwindsgear
 /**
  *
  */
 private static function getReservationsItemsToBeReturnedOrSendForAdminEmail()
 {
     list($listOutgoing, $clientListOutgoing, $nrOutgoing) = self::getListOutgoing();
     list($listIncoming, $clientListIncoming, $nrIncoming) = self::getListIncomingForAdmin();
     $todayDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate(date('Y-m-d'), true, true);
     $emailItems = array('nrOutgoing' => $nrOutgoing, 'nrIncoming' => $nrIncoming, 'clientListOutgoing' => $clientListOutgoing, 'listOutgoing' => $listOutgoing, 'clientListIncoming' => $clientListIncoming, 'listIncoming' => $listIncoming, 'todayDate' => $todayDate);
     if ($nrOutgoing > 0 || $nrIncoming > 0) {
         ITwebexperts_Payperrentals_Helper_Emails::sendEmail('reminder_admin', $emailItems);
     }
 }
コード例 #8
0
ファイル: Html.php プロジェクト: hueyl77/fourwindsgear
 public static function showGridColumns($_item)
 {
     $return = '';
     $nonSequential = Mage::helper('payperrentals/config')->isNonSequentialSelect(Mage::app()->getStore()->getId());
     if (ITwebexperts_Payperrentals_Helper_Data::isReservationType($_item->getProductId())) {
         if ($_item->getProductType() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE || $_item->getProductType() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_CONFIGURABLE || $_item->getProductType() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_BUNDLE) {
             $buyRequest = $_item->getBuyRequest();
             $_showTime = (bool) Mage::getResourceModel('catalog/product')->getAttributeRawValue($_item->getProductId(), 'payperrentals_use_times', $_item->getStoreId());
             if ($nonSequential) {
                 $stDate = ITwebexperts_Payperrentals_Helper_Date::localiseNonsequentialBuyRequest($buyRequest->getStartDate(), $_showTime);
             } else {
                 if ($buyRequest->getStartTime()) {
                     $buyStartDate = str_replace('00:00:00', $buyRequest->getStartTime(), $buyRequest->getStartDate());
                     $buyEndDate = str_replace('23:59:59', $buyRequest->getEndTime(), $buyRequest->getEndDate());
                 } else {
                     $buyStartDate = $buyRequest->getStartDate();
                     $buyEndDate = $buyRequest->getEndDate();
                 }
                 $stDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($buyStartDate, !$_showTime);
                 $enDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($buyEndDate, !$_showTime);
             }
             if ($nonSequential) {
                 $return .= '<td class="">' . $stDate . '</td>';
             } else {
                 $return .= '<td class="">' . $stDate . '</td>';
                 $return .= '<td class="">' . $enDate . '</td>';
             }
             $resultObject = new Varien_Object();
             //$resultObject->setReturn($return);
             Mage::dispatchEvent('options_grid', array('item' => $_item, 'result' => $resultObject));
             $return .= $resultObject->getReturn();
         }
     } else {
         if ($nonSequential) {
             $return .= '<td class="">' . '' . '</td>';
         } else {
             $return .= '<td class="">' . '' . '</td>';
             $return .= '<td class="">' . '' . '</td>';
         }
     }
     return $return;
 }
コード例 #9
0
 /**
  * Get price for the selected quantity and dates
  */
 public function getPriceAction()
 {
     if (!$this->getRequest()->getParam('product_id') || !$this->getRequest()->getParam('start_date')) {
         $jsonReturn = array('amount' => -1, 'onclick' => '', 'needsConfigure' => true, 'formatAmount' => -1);
         $this->getResponse()->setBody(Zend_Json::encode($jsonReturn));
         return;
     }
     $productId = $this->getRequest()->getParam('product_id');
     $product = Mage::getModel('catalog/product')->load($productId);
     $qty = urldecode($this->getRequest()->getParam('qty'));
     list($startDate, $endDate) = ITwebexperts_Payperrentals_Helper_Date::saveDatesForGlobalUse($this->getRequest()->getPost());
     if ($this->getRequest()->getParam('is_fixed_date')) {
         //get all fixed dates id with names and hours in a html with rectangle classes.. and disable rent button... have price as an attribute
         //add onclick event and a hidden field which updates...also enable button and start end date to get the real price
         $startDate = date('Y-m-d', strtotime($startDate));
         $endDate = date('Y-m-d', strtotime($endDate));
         $fixedDatesArray = ITwebexperts_Payperrentals_Helper_Data::getFixedRentalDates($product);
         $fixedDatesDropdown = '';
         if (count($fixedDatesArray)) {
             $fixedDatesDropdown .= '<ul class="fixed_array">';
         }
         $hasAvailability = false;
         foreach ($fixedDatesArray as $fixedDate) {
             if (date('Y-m-d', strtotime($fixedDate['start_date'])) == date('Y-m-d', strtotime($startDate))) {
                 if (Mage::helper('payperrentals/inventory')->isAvailable($productId, $fixedDate['start_date'], $fixedDate['end_date'], $qty)) {
                     //if (date('Y-m-d', strtotime($fixedDate['start_date'])) == date('Y-m-d', strtotime($fixedDate['end_date']))) {
                     //   $fixedDatesDropdown .= '<li idname="' . $fixedDate['id'] . '">' . date('H:i', strtotime($fixedDate['start_date'])) /*. '   ' . $fixedDate['name']*/ . '</li>';
                     //} else {
                     $fixedDatesDropdown .= '<li idname="' . $fixedDate['id'] . '">' . Mage::helper('payperrentals')->__('Start: ') . ITwebexperts_Payperrentals_Helper_Date::formatDbDate($fixedDate['start_date'], false, false) . ' &nbsp;&nbsp;&nbsp;  ' . Mage::helper('payperrentals')->__('End: ') . ITwebexperts_Payperrentals_Helper_Date::formatDbDate($fixedDate['end_date'], false, false) . '</li>';
                     //}
                     $hasAvailability = true;
                 }
             }
         }
         if (count($fixedDatesArray)) {
             $fixedDatesDropdown .= '</ul>';
         }
         if (!$hasAvailability) {
             $fixedDatesDropdown = Mage::helper('payperrentals')->__('Sorry, there is no availability left for this option');
         }
         $jsonReturn = array('amount' => 0, 'onclick' => '', 'fixedDates' => $fixedDatesDropdown, 'needsConfigure' => false, 'formatAmount' => -1);
         $this->getResponse()->setBody(Zend_Json::encode($jsonReturn));
         return;
     }
     $attributes = $this->getRequest()->getParam('super_attribute') ? $this->getRequest()->getParam('super_attribute') : null;
     $bundleOptions = $this->getRequest()->getParam('bundle_option') ? $this->getRequest()->getParam('bundle_option') : null;
     $bundleOptionsQty1 = $this->getRequest()->getParam('bundle_option_qty1') ? $this->getRequest()->getParam('bundle_option_qty1') : null;
     $bundleOptionsQty = $this->getRequest()->getParam('bundle_option_qty') ? $this->getRequest()->getParam('bundle_option_qty') : null;
     $onClick = '';
     $priceAmount = ITwebexperts_Payperrentals_Helper_Price::getPriceForAnyProductType($product, $attributes, $bundleOptions, $bundleOptionsQty1, $bundleOptionsQty, $startDate, $endDate, $qty, $onClick);
     if (Mage::helper('payperrentals/config')->useListButtons() || ITwebexperts_Payperrentals_Helper_Data::isUsingGlobalDates($product)) {
         ITwebexperts_Payperrentals_Helper_Date::saveDatesForGlobalUse($this->getRequest()->getPost());
     }
     $jsonReturn = array('amount' => $priceAmount, 'onclick' => $onClick, 'needsConfigure' => false, 'formatAmount' => $priceAmount != -1 ? Mage::helper('core')->currency($priceAmount) : -1);
     $this->getResponse()->setBody(Zend_Json::encode($jsonReturn));
 }
コード例 #10
0
ファイル: Rendercart.php プロジェクト: hueyl77/fourwindsgear
 public function renderDates($options, $item = null, $product = null, $isCart = false)
 {
     $isSingle = true;
     $nonSequential = 0;
     if ($item && $item->getOrder() && !$isCart) {
         $isSingleBool = ITwebexperts_Payperrentals_Helper_Data::isSingleOrder($item->getOrder());
         $isSingle = $isSingleBool['bool'];
     } else {
         if ($item && $item->getQuote() && !$isCart) {
             $isSingle = false;
         }
     }
     $productId = -1;
     $storeId = 1;
     $qty = 0;
     if (!is_null($item) && !is_null($item->getProductId())) {
         $productId = $item->getProductId();
         $storeId = $item->getStoreId();
         $qty = $item->getQty();
         $product = $item->getProduct();
     } else {
         if (!is_null($product) && is_object($product)) {
             $productId = $product->getId();
         } elseif (isset($options['info_buyRequest']['product'])) {
             $productId = $options['info_buyRequest']['product'];
         }
     }
     $showTime = (bool) Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'payperrentals_use_times', $storeId);
     $customerGroup = ITwebexperts_Payperrentals_Helper_Data::getCustomerGroup();
     $source = $this->_getOptionsArray($product, $options);
     $options = array();
     $isBuyout = isset($source['buyout']) ? $source['buyout'] : 'false';
     if ($isBuyout != "false") {
         $options[] = array('label' => $this->__('Product Type'), 'value' => 'Rental Buyout', 'type' => 'reservation');
     } else {
         if (isset($source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::START_DATE_OPTION]) && $source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::START_DATE_OPTION] != '') {
             $startDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::START_DATE_OPTION], !$showTime, false);
             $endDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::START_DATE_OPTION], !$showTime, false);
             if (!isset($nonSequential) || $nonSequential == 0) {
                 $endDate = ITwebexperts_Payperrentals_Helper_Date::formatDbDate($source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::END_DATE_OPTION], !$showTime, false);
                 if (isset($source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::FIXED_DATE_ID])) {
                     $fixedRentalDatesCollection = Mage::getModel('payperrentals/fixedrentaldates')->getCollection()->addFieldToFilter('id', $source[ITwebexperts_Payperrentals_Model_Product_Type_Reservation::FIXED_DATE_ID])->getFirstItem();
                     $fixedNameId = $fixedRentalDatesCollection->getNameid();
                     $fixedStartDate = $fixedRentalDatesCollection->getStartDate();
                     $fixedEndDate = $fixedRentalDatesCollection->getEndDate();
                     $difference = strtotime($fixedEndDate) - strtotime($fixedStartDate);
                     $startDate = date('Y-m-d', strtotime($startDate)) . ' ' . date('H:i:s', strtotime($fixedStartDate));
                     $endDate = date('Y-m-d H:i:s', strtotime($startDate) + $difference);
                     $fixedRentalNamesCollection = Mage::getModel('payperrentals/fixedrentalnames')->getCollection()->addFieldToFilter('id', $fixedNameId)->getFirstItem();
                     $fixedName = $fixedRentalNamesCollection->getName();
                     $options[] = array('label' => $this->__('Start Date'), 'value' => ITwebexperts_Payperrentals_Helper_Date::formatDbDate($startDate, !$showTime, false), 'type' => 'reservation');
                     $options[] = array('label' => $this->__('End Date'), 'value' => ITwebexperts_Payperrentals_Helper_Date::formatDbDate($endDate, !$showTime, false), 'type' => 'reservation');
                     //$options[] = array('label' => $this->__('Fixed Date'), 'value' => $fixedName, 'type' => 'reservation');
                 } else {
                     $options[] = array('label' => $this->__('Start Date'), 'value' => $startDate, 'type' => 'reservation');
                     $options[] = array('label' => $this->__('End Date'), 'value' => $endDate, 'type' => 'reservation');
                 }
             } else {
                 $options[] = array('label' => $this->__('Dates:'), 'value' => ITwebexperts_Payperrentals_Helper_Date::localiseNonsequentialBuyRequest($startDate, $showTime), 'type' => 'reservation');
             }
             if (!$isCart && $isSingle) {
                 $options = array();
             }
             $damageWaiver = ITwebexperts_Payperrentals_Helper_Price::getDamageWaiver($productId, 1);
             if ($damageWaiver) {
                 $options[] = array('label' => $this->__('Damage Waiver'), 'value' => ITwebexperts_Payperrentals_Helper_Price::getDamageWaiverHtml($item, (bool) $item->getBuyRequest()->getDamageWaiver(), $qty), 'type' => 'reservation');
             }
         } else {
             return array();
         }
     }
     $resultObject = new Varien_Object();
     $resultObject->setResult($options);
     Mage::dispatchEvent('render_cart', array('options' => $source, 'result' => $resultObject, 'product' => $product, 'item' => $item, 'is_cart' => $isCart));
     return $resultObject->getResult();
 }