Unhandled Error!

Undefined variable: bookableDates

Document /modules/shopproductbooking/classes/booking.class.php
Document type PHP document
Line 150
Exception class Phpr_PhpException

Code Highlight

 
                //get the pricing based on number or days
                $priceForDays = $this->getDatesRates($product, $options, $startDate, $dayCount, $qty);
                $i = 0;
 
                foreach ($dates as $date => $val) {
                    if (in_array($date, $bookableDates)) {
                        $dates[$date]["cost"] = $priceForDays[$i];
                    }
                    $i++;
                }
            }
		}
# Call Stack Code Document Line
21 HireBooking->getDatesWithCost(object(Shop_Product), array(0), null, '21-08-2019', 1) /modules/shopproductbooking/controllers/booking.php 73
20 ProductBookingController->handleGet(()) /modules/shopproductbooking/classes/shopproductbooking_module.php 153
19 ShopProductBooking_Module::display_booking_form(array(1) [sku => 'Karcher BR 45/22 Scrubber Dryer']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 4
18 eval(()) /modules/cms/classes/cms_controller.php 383
17 Cms_Controller->evalWithException('?><div class="reveal-modal" id="booking_modal" data-reveal> <div class="row"> <div class="twelve columns" style="padding:2em";> <?php ShopProductBooking_Module::display_booking_form(['sku' => $product->om('sku')]) ?> </div> </div> </div>', 'CMS partial', 'modal_booking', array(0)) /modules/cms/classes/cms_controller.php 1020
16 Cms_Controller->render_partial('modal_booking') /modules/cms/classes/cms_controller.php(383) : eval()'d code 322
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><?php $posted_options = Shop_ProductHelper::get_default_options($product); ?> <section class="product-<?php echo $product->url_name; ?>"> <div class="row"> <div class="six columns prod-img" style="text-align: center;"> <div class="product-images"> <?php $images = $product->om('images'); ?> <?php if($images->count >= 1): ?> <div class="main"> <img src="<?php echo $images[0]->getThumbnailPath(400, 400); ?>" alt="<?php echo $product->name; ?>" width="400px" height="400px" /> </div> <?php endif; ?> <?php if($images->count >= 2): ?> <div class="thumbs"> <ul> <?php foreach($images as $image): ?> <li> <a href="<?php echo $image->getThumbnailPath(400, 400); ?>" title="<?php echo $product->name; ?>" width="400px" height="400px" > <img src="<?php echo $image->getThumbnailPath(60, 60); ?>" alt="<?php echo $product->name; ?>" width="60px" height="60px"> </a> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> </div> <div class="stickers"> <!--<?php $interval = Phpr_DateTime::gmtNow()->substractDateTime($product->created_at); ?> <?php if($product->om('is_on_sale')): ?> <span class="sticker sale">Save<br /> <?php $sale_price_or_discount = $product->om('sale_price_or_discount'); if(strpos($sale_price_or_discount, '%')) { echo round($sale_price_or_discount); echo "&#37;"; } else { echo format_currency(ltrim($sale_price_or_discount, '-')); } ?> </span> <?php elseif($interval->getDays() < 0) : ?> <span class="sticker new">New</span> <?php endif; ?>--> <?php if($product->x_bookpay <= 1): ?> <span class="sticker diytrade">DIY & Trade</span> <?php elseif($product->x_bookpay > 1): ?> <span class="sticker trade">DIY & Trade</span> <?php endif; ?> </div> <div class="stickers2"> <?php $interval = Phpr_DateTime::gmtNow()->substractDateTime($product->created_at); ?> <?php if($product->om('is_on_sale')): ?> <span class="sticker sale">Save<br /> <?php $sale_price_or_discount = $product->om('sale_price_or_discount'); if(strpos($sale_price_or_discount, '%')) { echo round($sale_price_or_discount); echo "&#37;"; } else { echo format_currency(ltrim($sale_price_or_discount, '-')); } ?> <?php endif; ?> </span> </div> </div> <div class="six columns"> <!-- product CTA start --> <div class="product-description"> <?php echo open_form(array('class' => 'custom')); ?> <div class="meta"> <h1><?php echo $product->name; ?></h1> <div class="bread">Category: <a href="<?= $product->category_list[0]->page_url('/category') ?>" style="color: #414141; border-bottom: 1px solid #414141; display: inline;"><?= h($product->category_list[0]->title) ?></a> </div> </div> <!--<div class="price"> <div class="row"> <?php if($product->om('price') <= 0): ?> <div class="twelve mobile-four columns"> <span class="currency">Tool Hire Team: 0800 808 9127</span> <?php elseif($product->price() == 999999): ?> <div class="twelve mobile-four columns" style="text-align: right;"> <span class="prodhireperiod">WEEKLY</span><span class="prodpricebreak"><?php echo format_currency($product->om('price', $posted_options)); ?></span><br/> <?php else: ?> <div class="twelve mobile-four columns" style="text-align: right;"> <?= $this->render_partial('price_calculator') ?> <?php endif; ?> </div> </div> </div>--> <?php if($product->options->count): ?> <div class="options"> <?php foreach($product->options as $option): ?> <?php $posted_options = post('product_options', array()); $posted_value = isset($posted_options[$option->option_key]) ? $posted_options[$option->option_key] : null; ?> <div class="option"> <label><?php echo h($option->name); ?></label> <select style="height: 28px;" name="product_options[<?php echo $option->option_key; ?>]" onchange="$(this).getForm().sendRequest('on_action', { update: { 'product': 'shop:product2' }, onSuccess: function() { init_custom_forms(); init_product_image_viewer(); } })"> <?php foreach($option->list_values() as $value): ?> <option style="height: 28px; font-size: 1.1em;" <?= option_state($posted_value, $value) ?> value="<?php echo h($value); ?>"><?php echo h($value); ?></option> <?php endforeach; ?> </select> </div> <?php endforeach; ?> </div> <?php endif; ?> <?php echo ($product->om('unique_data', $posted_options)); ?> <div class="addtocart" style="background-color: #f0f0f0; margin-top: 20px;"> <?= $this->render_partial('price_calculator3') ?> <? if( $product->x_bookpay != 1): ?> <?php else: ?> <div class="six mobile-two push-six columns extrainfobox2" style="margin-bottom: 0;"> <a href="#" title="Book Hire" data-reveal-id="booking_modal" data-closeOnBackgroundClick="false" class="button expand bookbutton"><i class="fa fa-lg fa-calendar"></i>&nbsp; Book Hire</a> </div> <? endif; ?> <!--<? if( $product->x_bookpay != 1): ?> <div class="twelve mobile-four columns extrainfobox2" style="margin-bottom: 0;"> <? else: ?> <div class="six mobile-two pull-six columns extrainfobox2" style="margin-bottom: 0;"> <? endif; ?> <a href="#" title="Quick Quote" data-reveal-id="hs_quick_quote_modal" data-closeOnBackgroundClick="false" class="button expand quotebutton"><i class="fa fa-lg fa-envelope-o"></i>&nbsp; Quick Quote</a> </div>--> <? if( $product->x_bookpay != 1): ?> <div class="twelve mobile-four columns extrainfobox2" style="margin-bottom: 0;"> <? else: ?> <div class="six mobile-two pull-six columns extrainfobox2" style="margin-bottom: 0;"> <? endif; ?> <? if( $product->x_bookpay <= 1): ?> <a href="#" title="Quick Quote" data-reveal-id="hs_quick_quote_modal" data-closeOnBackgroundClick="false" class="button expand quotebutton"><i class="fa fa-lg fa-envelope-o"></i>&nbsp; Quick Quote</a> <? elseif( $product->x_bookpay == 2): ?> <a href="#" title="Quick Quote" data-reveal-id="nws_quick_quote_modal" data-closeOnBackgroundClick="false" class="button expand quotebutton"><i class="fa fa-lg fa-envelope-o"></i>&nbsp; Quick Quote</a> <? elseif( $product->x_bookpay == 3): ?> <a href="#" title="Quick Quote" data-reveal-id="cs_quick_quote_modal" data-closeOnBackgroundClick="false" class="button expand quotebutton"><i class="fa fa-lg fa-envelope-o"></i>&nbsp; Quick Quote</a> <? elseif( $product->x_bookpay == 9): ?> <? endif; ?> </div> <? if( $product->x_bookpay <= 1): ?> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-hand-pointer-o fa-lg"></i>&nbsp; Click &amp; Collect: FREE </div> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-truck fa-lg"></i>&nbsp; Delivery: £7.50 <span style="font-size:0.8em;">each way</span> </div> <? elseif( $product->x_bookpay == 2): ?> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-thumbs-o-up fa-lg"></i>&nbsp; DIY & Trade </div> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-truck fa-lg"></i>&nbsp; Nationwide Delivery </div> <? elseif( $product->x_bookpay == 3): ?> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-thumbs-o-up fa-lg"></i>&nbsp; DIY & Trade </div> <div class="six mobile-two columns extrainfobox2" style="font-size:0.85em; text-align: center; padding: 0 0 5px 0 !important;"> <i class="fa fa-truck fa-lg"></i>&nbsp; Delivery: <? if( $product->x_delivery >= 1): ?><?= format_currency($product->x_delivery) ?><span style="font-size:0.8em;"> each way</span><? else: ?>Nationwide<? endif; ?> </div> <? endif; ?> <div class="row"> </div> <!-- <?php if($product->om('price') <= 0): ?> <div class="row"> <div class="twelve mobile-four columns"> <?php $this->render_partial('shop:call_for_price'); ?> </div> </div> <?php endif; ?> --> </div> <?php if($product->extra_options->count): ?> <div class="extras panel secondary"> <?php foreach($product->extra_options as $option): ?> <? if($option->x_display_on_product_page): ?> <div class="extra"> <label for="extra_option_<?php echo $option->id; ?>" style="cursor:default"> <input name="product_extra_options[<?Php echo $option->option_key; ?>]" type="checkbox" id="extra_option_<?php echo $option->id; ?>" value="1" checked> <?php echo h($option->description); ?> <?php if($option->price > 0): ?> <span class="extra_price">(+ <?php echo format_currency($option->get_price($product)); ?>)</span> <?php else: ?> <span class="extra_price">(FREE)</span> <?php endif; ?> </label> </div> <? endif ?> <?php endforeach; ?> </div> <?php endif; ?> <div class="twelve mobile-four columns" style="text-align: center; padding: 30px 0;"> <span class="product_contact" style="color: #429dd1; cursor: default;"> <i class="fa fa-phone fa-lg"></i>&nbsp; Hire Team: <? if( $product->x_bookpay <= 1): ?><?php $this->render_partial('hs_tel'); ?><? elseif( $product->x_bookpay == 2): ?><?php $this->render_partial('nws_tel'); ?><? elseif( $product->x_bookpay == 3): ?><?php $this->render_partial('cs_tel'); ?><? endif; ?> </span> <p style="margin-bottom: 30px;">Call FREE: Mobiles &amp; Landlines</p> <? if( $product->x_bookpay <= 1): ?> <? if ($product->om('price') > 0): ?> <div class="six mobile-two columns"> <p><i class="fa fa-thumbs-o-up fa-lg"></i>&nbsp; Price Match Promise</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-file-o fa-lg"></i>&nbsp; Instructions Included</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-tag fa-lg"></i>&nbsp; Discounted Web Price</p> </div> <? endif; ?> <? if ($product->om('price') <= 0): ?> <div class="six mobile-two columns"> <? elseif ($product->track_inventory): ?> <p><i class="fa fa-exclamation-triangle fa-lg"></i>&nbsp; Limited Availability</p> <? else: ?> <p><i class="fa fa-map-marker fa-lg"></i>&nbsp; Available Nationwide</p> </div> <? endif; ?> <? endif; ?> <? if( $product->x_bookpay == 3): ?> <div class="six mobile-two columns"> <p><i class="fa fa-calendar fa-lg"></i>&nbsp; Flexible Hire Periods</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-truck fa-lg"></i>&nbsp; Next Day Delivery</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-users fa-lg"></i>&nbsp; Full Machine Training</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-wrench fa-lg"></i>&nbsp; Maintenance Included</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-thumbs-o-up fa-lg"></i>&nbsp; Quality, Modern Fleet</p> </div> <div class="six mobile-two columns"> <p><i class="fa fa-exclamation-triangle fa-lg"></i>&nbsp; Breakdown Cover</p> </div> <? endif; ?> </div> </div> <!-- product CTA end --> </div> </div> <div class="row"> <div class="twelve columns"> <div class="meta" style="padding:15px 0 0 0;"> <div id="accordion" style="border-top: 1px solid #dddddd; padding:15px 0 0 0;"> <a class="accordion-toggle button expand show-for-small"><span style="padding: 0 0 0 15px;">Product Description</span><span style="float: right; padding:0 15px 0 0;"><i class="fa fa-lg fa-caret-square-o-down"></i></span></a> <div class="description accordion-content default" style="border: 1px solid #dddddd; padding:15px;"> <?php echo $product->description; ?> <p><?php echo $product->short_description; ?></p> </div> <a class="accordion-toggle button expand show-for-small"><span style="padding: 0 0 0 15px;">Delivery / Click &amp; Collect</span><span style="float: right; padding:0 15px 0 0;"><i class="fa fa-lg fa-caret-square-o-down"></i></span></a> <div class="delivery accordion-content" style="border: 1px solid #dddddd; padding:15px;"> <span style="padding: 15px 10px 0"><b>Collect from Store &nbsp;|&nbsp; Delivered to Door</b></span> <p style="padding: 15px 10px 0">We have many collection points across the UK so you can be sure of a friendly and local service in your area. Click &amp; Collect or get it delivered to your home or worksite for just £7.50 each-way!</p> <p style="padding: 15px 10px 0"><b>Please Note:</b> Always book and pay online or over the telephone before visiting your local collection point to ensure that the equipment is in-stock and ready for collection. Discounted web prices only apply to bookings made via the website or over the telephone.</p> <a href="/click-and-collect/" class="button" style="width: 100%; background-color: #429dd1; font-weight: 300; color: #fff; padding: 10px 5px;">Call: 0800 808 9127 &nbsp;|&nbsp; Click &amp; Collect</a> </div> </div> </div> </div> <div class="twelve mobile-four columns"> <?php $this->render_partial('callfreebutton'); ?> </div> </div> <?php echo close_form(); ?> <?= $this->render_partial('modal_hs_quickquote') ?> <?= $this->render_partial('modal_nws_quickquote') ?> <?= $this->render_partial('modal_cs_quickquote') ?> <?= $this->render_partial('modal_booking') ?> </section> ', 'CMS partial', 'shop:product2', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php 1020
13 Cms_Controller->render_partial('shop:product2', array(1) [product => object(Shop_Product)]) /modules/cms/classes/cms_controller.php(383) : eval()'d code 16
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><section class="content"> <? if( $product->x_bookpay == 200): ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product3', array( 'product' => $product )); ?> </section> <? else: ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product2', array( 'product' => $product )); ?> </section> <?php endif; ?> <!-- <section class="reviews block" id="reviews"> <div class="row"> <div class="nine columns"> <div class="title-block text-left"> <h5 class="display">Product Reviews</h5> </div> </div> <div class="three columns"> <a style="margin-top: 25px;" href="#" class="hide-for-small button small secondary full-width" data-reveal-id="write-review" data-closeOnBackgroundClick="false"><i class="foundicon-edit"></i> &nbsp; Write a review</a> </div> </div> <div class="row"> <div class="twelve columns"> <?php if($product->list_all_reviews()->count): ?> <ul id="review-list" class="block-grid two-up"> <?php $i = 0; ?> <?php foreach($product->list_all_reviews() as $review): ?> <?php $i++; ?> <li> <div class="text bubble"> <h6><?php echo $review->title; ?></h6> <p><?php echo nl2br(h($review->review_text)) ?></p> <div class="rating stars-<?php echo $review->rating; ?>"> </div> </div> <div class="avatar"> <div class="gravatar"> <img src="http://www.gravatar.com/avatar/<?php echo md5($review->review_author_email); ?>.jpg?s=48&d=retro&r=g" alt="" width="48" height="48" > </div> <span class="user"><?php echo $review->author; ?></span> <span class="time"><?php echo $review->created_at->format('%x'); ?></span> </div> </li> <?php if($i == 2) { break; } ?> <?php endforeach; ?> </ul> <?php else: ?> <div class="alert-box secondary"> There are currently no reviews for this item, <a href="#" data-reveal-id="write-review" data-closeOnBackgroundClick="false">why not be the first</a>? <a href="" class="close">&times;</a> </div> <?php endif; ?> </div> </div> </section> --> <?php if($product->list_related_products()->find_all()->count): ?> <section class="related-products bottom block"> <div class="row"> <div class="twelve columns"> <div class="title-block"> <h5 class="display">Related Products</h5> </div> </div> </div> <div class="row"> <?php $this->render_partial('shop:product_list', array( 'products' => $product->list_related_products()->find_all(), 'class' => 'three mobile-two' )); ?> </div> </section> <?php endif; ?> <!--<div id="write-review" class="reveal-modal medium"> <div class="row"> <div class="twelve columns"> <div class="title-block no-top"> <h3 class="display">Write a review for "<?php echo $product->name; ?>"</h3> </div> </div> </div> <div class="row"> <div class="twelve columns"> <?php echo open_form(array('class' => 'custom')); ?> <div class="row"> <div class="six columns"> <label for="rating">Rating</label> <select name="rating" id="rating"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </div> </div> <?php if(!$this->customer): ?> <div class="row"> <div class="six columns"> <label for="review_author_name">Your name</label> <input id="review_author_name" name="review_author_name" type="text" /> </div> <div class="six columns"> <label for="review_author_email">Email</label> <input id="review_author_email" type="text" name="review_author_email" /> </div> </div> <?php endif; ?> <div class="row"> <div class="twelve columns"> <label for="review_title">Title</label> <input id="review_title" name="review_title" type="text" /> </div> </div> <div class="row"> <div class="twelve columns"> <label for="review_text">Review</label> <textarea rows="5" id="review_text" name="review_text" /></textarea> </div> </div> <div class="row"> <div class="twelve columns"> <button type="submit" class="button" onclick="return $(this).getForm().sendRequest('shop:on_addProductReview', { extraFields: { no_flash: true, }, onSuccess: function() { $('#write-review').trigger('reveal:close'); document.location.reload(true); } })"><i class="foundicon-checkmark"></i> &nbsp; Submit review</button> </div> </div> <?php echo close_form(); ?> </div> </div> <a class="close-reveal-modal">&#215;</a> </div>--> <!--<div id="product-added" class="reveal-modal medium"> <div class="row"> <div class="twelve columns"> <h5>Your product has been added to the cart</h5> </div> </div> <div class="row"> <div class="hide-for-small four columns"> <img src="<?php echo $product->image_url(0, 320, 240); ?>" alt="" /> </div> <div class="eight columns"> <h5><?php echo $product->name; ?></h5> <div class="rating stars-<?php echo $product->rating_approved; ?>"> <a href="<?php echo $product->page_url('/product'); ?>/#reviews"><?php echo !empty($product->rating_review_num) ? "{$product->rating_review_num} review(s)" : "0 review(s)"; ?></a> </div> <p><?php echo $product->short_description; ?></p> </div> </div> <div class="row"> <div class="six columns"> <a href="#" class="button small secondary" onclick="$('#product-added').trigger('reveal:close'); return false;"><i class="foundicon-left-arrow"></i> Continue shopping</a> </div> <div class="six columns"> <a href="<?php echo root_url('/cart'); ?>" class="button small right">View my cart <i class="foundicon-right-arrow"></i></a> </div> </div> <a class="close-reveal-modal">&#215;</a> </div>--> </section> <!-- <div id="quote" class="reveal-modal"> <div class="row"> <div class="twelve columns"> <?php $this->render_partial('jotform:quickquote'); ?> </div> </div> <a class="close-reveal-modal">&#215;</a> </div>-->', 'CMS page', 'Karcher 450mm Pedestrian Scrubber Dryer') /modules/cms/classes/cms_controller.php 608
10 Cms_Controller->eval_page_content(()) /modules/cms/classes/cms_controller.php 198
9 Cms_Controller->open(object(Cms_Page), array(1) [0 => 'karcher-450mm-pedestrian-scrubber-dryer-hire']) /controllers/application.php 72
8 Application->On404(())
7 call_user_func_array(array(2) [0 => object(Application), 1 => 'On404'], array(0)) /phproad/modules/phpr/classes/phpr_controller.php 170
6 Phpr_Controller->executeAction('On404', array(0)) /phproad/modules/phpr/classes/phpr_controller.php 84
5 Phpr_Controller->_run('On404', array(0)) /phproad/modules/phpr/classes/phpr_response.php 64
4 Phpr_Response->open404(()) /phproad/modules/phpr/classes/phpr_response.php 37
3 Phpr_Response->open('/product/karcher-450mm-pedestrian-scrubber-dryer-hire') /phproad/system/phproad.php 31
2 include('/var/www/vhosts/carpetcleaner-hire.co.uk/httpdocs/phproad/system/phproad.php') /boot.php 114
1 require_once('/var/www/vhosts/carpetcleaner-hire.co.uk/httpdocs/boot.php') /index.php 3