Unhandled Error!

Undefined index: HTTP_REFERER

Document /modules/shopproductbooking/controllers/booking.php
Document type PHP document
Line 163
Exception class Phpr_PhpException

Code Highlight

        $bookingDomain = Phpr::$config->get("BOOKING_FORM_DOMAIN",
            "booking." . str_replace("www.", "", $_SERVER['HTTP_HOST'])
        );
        if($dev = Phpr::$request->getField('dev_domain')) {
            $bookingDomain = str_replace("booking", "booking-$dev", $bookingDomain);
        }
        elseif(preg_match('/(?<=dev_domain=)[a-z]+/', $_SERVER['HTTP_REFERER'], $matches)) {
            $bookingDomain = str_replace("booking", "booking-{$matches[0]}", $bookingDomain);
        }
        return $bookingDomain;
    }
 
	public function getRemoteBookingForm() {
# Call Stack Code Document Line
29 ProductBookingController::getBookingDomain(()) /modules/shopproductbooking/controllers/booking.php 88
28 ProductBookingController::getRemoteProductDetails(array(1) [0 => '040080']) /modules/shopproductbooking/controllers/booking.php 44
27 ProductBookingController::getProductDetails(array(1) [0 => '040080']) /modules/shopproductbooking/classes/shopproductbooking_module.php 58
26 ShopProductBooking_Module->after_product_fetch(object(Shop_Product))
25 call_user_func_array(array(2) [0 => object(ShopProductBooking_Module), 1 => 'after_product_fetch'], array(1) [0 => object(Shop_Product)]) /phproad/system/class_functions.php 18
24 callFunction(array(2) [0 => object(ShopProductBooking_Module), 1 => 'after_product_fetch'], array(1) [0 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_events.php 79
23 Phpr_Events->fire_event(array(1) [name => 'shop:onAfterProductRecordFetch'], object(Shop_Product))
22 call_user_func_array(array(2) [0 => object(Phpr_Events), 1 => 'fire_event'], array(2) [0 => array(1), 1 => object(Shop_Product)]) /phproad/system/class_functions.php 18
21 callFunction(array(2) [0 => object(Phpr_Events), 1 => 'fire_event'], array(2) [0 => array(1), 1 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_events.php 153
20 Phpr_Events->fireEvent('shop:onAfterProductRecordFetch', object(Shop_Product))
19 call_user_func_array(array(2) [0 => object(Phpr_Events), 1 => 'fireEvent'], array(2) [0 => 'shop:onAfterProductRecordFetch', 1 => object(Shop_Product)]) /phproad/modules/phpr/classes/phpr_extensible.php 159
18 Phpr_Extensible->__call('fireEvent', array(2) [0 => 'shop:onAfterProductRecordFetch', 1 => object(Shop_Product)]) /modules/shop/models/shop_product.php 1861
17 Backend_Events->fireEvent('shop:onAfterProductRecordFetch', object(Shop_Product)) /modules/shop/models/shop_product.php 1861
16 Shop_Product->after_fetch(()) /phproad/modules/db/classes/db_activerecord.php 444
15 Db_ActiveRecord->_find_fill(array(3) [0 => array(138), 1 => array(138), 2 => array(138)], null) /phproad/modules/db/classes/db_activerecord.php 540
14 Db_ActiveRecord->find_all_internal(null, array(0), null) /phproad/modules/db/classes/db_activerecord.php 559
13 Db_ActiveRecord->find_all(()) /modules/cms/classes/cms_controller.php(383) : eval()'d code 35
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><div class="row"> <div class="twelve columns"> <div class="cat-breadcrumbs pt4" itemscope itemtype="https://schema.org/BreadcrumbList"> <span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="/" itemprop="item"><span itemprop="name">Home</span></a><meta itemprop="position" content="1" /></span> <?php $pos = 2; if ($primaryBreadcrumbs = ShopPrimaryCategory::getPrimaryBreadcrumbs($product)) : ?> <? $i=1; foreach ($primaryBreadcrumbs as $breadcrumb): ?> <span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> &gt; <a href="<?= rtrim($breadcrumb->page_url('/category'), '/') ?>/" data-gtm="Breadcrumb (P)" itemprop="item"><span itemprop="name"><?= $breadcrumb->name ?></span></a><meta itemprop="position" content="<?php echo $pos; ?>" /> <?php if ($i < count($primaryBreadcrumbs)): ?> <span class="breadcrumb-hover"> <span> <?php if ($breadcrumb->list_children('front_end_sort_order')->count): ?> <div class="breadcrumb-category"> <?php foreach ($breadcrumb->list_children('front_end_sort_order') as $subcategory): ?> <? if(!empty($subcategory->x_catfalse)): ?> <a href="<?= $subcategory->x_catfalse ?>" title="<?= h($subcategory->name) ?>" data-gtm="Breadcrumb Pop (P)"><?= h($subcategory->name) ?></a> <? else: ?> <a href="<?= $subcategory->page_url('category') ?>/" title="<?= h($subcategory->name) ?>" data-gtm="Breadcrumb Pop (P)"><?= h($subcategory->name) ?></a> <? endif ?> <?php endforeach; ?> </div> <?php endif; ?> </span> </span> <?php else: ?> <?php if ($breadcrumb->eval_num_of_products()): ?> <span class="breadcrumb-hover"> <span> <div class="breadcrumb-category"> <p style="margin-bottom: 9px;"><strong>Top Products</strong></p> <?php $products = $breadcrumb->list_products(array('sorting'=>array('price desc')))->limit(3)->find_all(); ?> <?php foreach ($products as $breadcrumbProduct): ?> <a href="<?php echo $breadcrumbProduct->page_url('product'); ?>/" data-gtm="Breadcrumb Pop (P)"><?php echo $breadcrumbProduct->name; ?></a> <?php endforeach; ?> <a href="<?= $breadcrumb->page_url('category') ?>/">View All</a> </div> </span> </span> <?php endif; ?> <?php endif; ?> </span> <? $i++; $pos++; endforeach ?> <?php endif; ?> <span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">&nbsp;>&nbsp;<span itemprop="name"><?php echo $product->name; ?></span><meta itemprop="position" content="<?php echo $pos; ?>" /></span> </div> </div> </div> <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 ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </section> <? elseif( $product->x_bookpay == 201): ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product4', array( 'product' => $product ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </section> <? elseif( $product->x_bookpay == 202): ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product5_2021', array( 'product' => $product ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </section> <? elseif( $product->x_bookpay == 123): ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product_training', array( 'product' => $product ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </section> <? else: ?> <section id="product" class="product top block" style="margin:15px;"> <?php $this->render_partial('shop:product2', array( 'product' => $product ), array( 'cache'=>true, 'cache_vary_by'=>array('url'), 'cache_versions'=>array('catalog'), 'cache_ttl'=>86400 )); ?> </section> <?php endif; ?> </section> </div> </section> <?= $this->render_partial('white_diesel_modal') ?> <?= $this->render_partial('insurance_modal') ?> <?= $this->render_partial('deposit_modal') ?> <?= $this->render_partial('id_modal') ?> <?= $this->render_partial('paypal_modal') ?> <script> window.booking.form.on('booking:basket-add', function(e, items) { dataLayer.push({ 'event' : 'add_to_cart', 'ecommerce' : { 'items': items } }); }); //dataLayer = []; dataLayer.push({ 'event' : 'view_item', 'ecommerce' : { 'items': [{ 'item_id': '<?php echo $product->sku; ?>', 'item_name': '<?php echo $product->name ?>', 'price': '<?php if($product->om('is_on_sale')): ?><?php echo $product->om('sale_price'); ?><?php else: ?><?php echo $product->om('price') ?><?php endif; ?>' }] } }); </script>', 'CMS page', 'Best Carpet Cleaner') /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 => 'carpet-cleaner-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/carpet-cleaner-hire') /phproad/system/phproad.php 31
2 include('/var/www/vhosts/nationaltoolhireshops.co.uk/httpdocs/phproad/system/phproad.php') /boot.php 114
1 require_once('/var/www/vhosts/nationaltoolhireshops.co.uk/httpdocs/boot.php') /index.php 23