Unhandled Error!

Undefined variable: config

Document /modules/stavepuzzles/classes/stavepuzzles_helper.php
Document type PHP document
Line 321
Exception class Phpr_PhpException

Code Highlight

	public static function init_config() {
		if (!self::$config) {
			$config = new StaveCustomizations_Configuration();
			self::$config = $config->load();
		}
 
		return $config;
	}
 
}
 
 
 
# Call Stack Code Document Line
17 StavePuzzles_Helper::init_config(()) /modules/stavepuzzles/classes/stavepuzzles_helper.php 286
16 StavePuzzles_Helper::get_in_stock_info(object(Shop_Product)) /modules/cms/classes/cms_controller.php(383) : eval()'d code 59
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><?= open_form() ?> <? if (Phpr::$request->getField('instock')) { $suffix = "?instock=1"; $products = $products->where("(exists(select id from shop_product_properties where name='in_stock' and value ='1' and product_id=shop_products.id))"); } else { $suffix = ""; } $pagination = null; if (isset($paginate) && $paginate) { $page_index = isset($page_index) ? $page_index-1 : 0; $records_per_page = isset($records_per_page) ? $records_per_page : 3; $pagination_base_url = isset($pagination_base_url) ? $pagination_base_url : null; $pagination = $products->paginate($page_index, $records_per_page); } $product_collection = $products->collection(); $ct = 0; ?> <div class="clearfix puzzle-list" id="puzzle_list"> <? foreach ($product_collection as $product) { $is_on_sale = $product->om('is_on_sale'); $page_url = $product->page_url('/product'); $image = $product->images->first(); $image = $image ? $image->thumb(250, "auto") : 'http://placehold.it/365x365'; $big = $image; $diff_info = StavePuzzles_Helper::get_difficulty_info($product); $diff_img_path = $diff_info['image']; $diff_text = $diff_info['sym'] . ": " . $diff_info['text']; $trad = false; $puzzle_type = ""; if ($product->get_attribute("puzzle_type")) { $puzzle_type = $product->get_attribute("puzzle_type"); if ($puzzle_type == "Traditional") { $trad = true; $price_leader = "prices start at "; } else { $trad = false; $price_leader = "web price: "; } } else { $puzzle_type = ""; $price_leader = "web price: "; } $isi = StavePuzzles_Helper::get_in_stock_info($product); $instock_icon = "/images/product_list/" . $isi->image; $instock_mssg = $isi->message; $large_image = $product->images->first->thumb(1000, 'auto'); ?> <div class="<?= $is_on_sale ? 'sale' : null ?> sp-list"> <div class="item"> <div class='product-list-image'> <a href='<?=$large_image?>' class='fancybox'><div class='product-details-mag-sm'><img src='/images/product_details/mag_square.png'></div></a> <a href="<?= $page_url ?>"> <img src="<?= $image ?>" title="<?= h($product->name) ?>"/> </a> </div> <div class="sp-list-info"> <!-- <a class='sp-list-mag' href='<?=$big?>'> <img class='magnifier' src='/images/product_list/magnifier.png'> </a> --> <h3> <? if ($puzzle_type && $puzzle_type !="Traditional") { ?> <a href='/puzzle-difficulty-key' class='fancybox.iframe diff-modal-link'> <img class='diff-modal' data-ot="Stave Puzzle Type: <em><?=$product->get_attribute('puzzle_type')?></em><div class='<?=$product->get_attribute('puzzle_type')?> hover-diff-text'><?=$diff_text?></div><div class='hover-diff-click'>Click for more details...</div>" data-ot-delay="0" src='<?=$diff_img_path?>'> </a> <? } ?> <a href="<?= $page_url ?>"><?= h($product->name) ?></a> </h3> <div class='sp-list-price'> <ul> <? if (!$trad) { ?> <li class='list-price'> <img data-ot="<?=$instock_mssg?>" data-ot-delay="0" src='<?=$instock_icon?>'>full price: <?=format_currency($product->get_attribute('full_price'))?></li> <? } ?> <li class='web-price'><?=$price_leader?><? if ($is_on_sale): ?><span class="oldprice"><?= format_currency($product->om('price')) ?></span><? endif ?> <?= format_currency($product->om('sale_price')) ?></li> <? if (StaveCustomizations_Helper::in_category($product, "_short_puzzle_message")) : ?> <li class='product-wp'> <a href='/written-personalization-modal' class='fancybox.iframe wp-link'> <img data-ot-delay="0" data-ot="This puzzle can have written personalization! <div class='hover-diff-click'>Click to learn more...</div>" src='/images/product_list/wp.png'> </li> <? endif; ?> </ul> </div> <div class='sp-list-buttons clearfix'> <ul> <li class='basket'><a href="<?= $page_url ?>">Add to Basket</a></li> <? if ($this->customer) : ?> <li class='wishlist' id='w_<?= $product->id ?>'> <? if (Wish_List_Item::in_customer_list($product, $this->customer)): ?> <a class="in-wishlist" href='/wishlist' target='_blank'>(in wishlist)</a> <? else : ?> <?= open_form() ?> <a class="add-to-wishlist p-list" data-product_id='<?= $product->id ?>'> Add to Wishlist </a> </form> <? endif ?> <? endif ?> </li> </ul> </div> </div> <? if ($is_on_sale): ?><span class="salesign">SPECIAL</span><? endif ?> </div> <!-- end "item" --> </div> <? } // end of foreach ?> <? if (!$product_collection->count && isset($empty_text)): ?> <li class="empty"><?= h($empty_text) ?></li> <? endif ?> </div> <? if ($pagination): ?> <? $this->render_partial('pagination', array( 'pagination'=>$pagination, 'suffix'=>$suffix, 'base_url'=>$pagination_base_url, 'visiblePages'=>8, )) ?> <? endif ?> <?= close_form() ?> ', 'CMS partial', 'shop:product_list', array(2) [products => object(Db_DataCollection), paginate => '']) /modules/cms/classes/cms_controller.php 1020
13 Cms_Controller->render_partial('shop:product_list', array(2) [products => object(Db_DataCollection), paginate => '']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 17
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><div class="row"> <div class="content twelve columns"> <div class="row"> <div class="product-list nine columns" style='float:right' id="category-list"> <div class='search-header'> <h4>You searched for "<?=$query?>": We found <?= $pagination->getRowCount() ?> products matching that search.</h4></div> <div class="row sp-list-bg"> <? $this->render_partial('shop:product_list', array( 'products'=>$products, 'paginate'=>false)) ?> <? $this->render_partial( 'pagination', array( 'pagination'=>$pagination, 'base_url'=>root_url('/search'), 'suffix'=>'?query='.urlencode($query).'&amp;records='.urlencode($records)) ) ?> </div> </div><!-- end nine cols --> <div class="three columns categories"> <? $this->render_partial('stave:right_column') ?> </div> </div><!-- end main page row --> </div> </div> <script> var puzzle_container = document.querySelector('#puzzle_list'); function runMasonry(c) { var msnry = new Masonry( c, { columnWidth: 230, itemSelector: '.sp-list' }); } imagesLoaded( puzzle_container, function() { runMasonry(puzzle_container); }); </script>', 'CMS page', 'Displays the search results.') /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(0)) /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('/search') /phproad/system/phproad.php 31
2 include('/var/www/vhosts/stavepuzzles.com/phproad/system/phproad.php') /boot.php 114
1 require_once('/var/www/vhosts/stavepuzzles.com/boot.php') /index.php 3