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
23 StavePuzzles_Helper::init_config(()) /modules/stavepuzzles/classes/stavepuzzles_helper.php 286
22 StavePuzzles_Helper::get_in_stock_info(object(Shop_Product)) /modules/cms/classes/cms_controller.php(383) : eval()'d code 59
21 eval(()) /modules/cms/classes/cms_controller.php 383
20 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(6) [products => object(Shop_Product), records_per_page => '12', paginate => '1', pagination_base_url => '/puzzles', page_index => 'valentines', empty_text => 'There are no products in this category.']) /modules/cms/classes/cms_controller.php 1020
19 Cms_Controller->render_partial('shop:product_list', array(6) [products => object(Shop_Product), records_per_page => '12', paginate => '1', pagination_base_url => '/puzzles', page_index => 'valentines', empty_text => 'There are no products in this category.'], array(4) [cache => '1', cache_vary_by => array(2), cache_versions => array(1), cache_ttl => '1800']) /modules/cms/classes/cms_controller.php(383) : eval()'d code 118
18 eval(()) /modules/cms/classes/cms_controller.php 383
17 Cms_Controller->evalWithException('?><? if (Phpr::$request->getField('instock')) { $instock_url = $category->page_url(null); $viewing_instock = true; $title_append = ": InStock"; } else { $instock_url = Phpr::$request->getCurrentUrl() . "?instock=1"; $viewing_instock = false; $title_append = ""; } if (!$category): ?> <h2>Category not found</h2> <p>Whoops! That category was not found.</p> <? else: ?> <? $tms = array("Teasers", "Tricks", "TroubleMakers", "Treats", "Tidbits"); if (in_array($category->name, $tms)) { $cat_name = $category->name . "<sup>tm</sup>"; } else { $cat_name =$category->name; } ?> <div class='row category-heading'> <h2><?= $cat_name . $title_append ?></h2> <? if (count($category->images) > 0) { ?> <img class='main' src="<?= $category->images[0]->getThumbnailPath(150, 150) ?>"/> <? } ?> <? if ($category->description) { ?> <?=$category->description?> <? } ?> </div> <? /* "$products->where((exists(select id from shop_product_properties where name='in_stock' and value ='1' and product_id=shop_products.id))" */ $products = $category->list_products(array('sorting'=>$sorting_preferences)); if (Phpr::$request->getField('instock')) { $num_products = $products->where("(exists(select id from shop_product_properties where name='in_stock' and value ='1' and product_id=shop_products.id))")->requestRowCount(); $products->in_stock = true; } else { $num_products = $products->requestRowCount(); $products->in_stock = false; } $this->render_partial("shop:sorters"); ?> <div class='row sp-instock-state'> <div class='list-info'> <span><?= $num_products?> products found</span> <? // see if a category has any in-stock puzzles // still need to go back to page 1 if ($viewing_instock) { ?> <span>Currently viewing InStock puzzles only: <a href='<?=$instock_url?>'>View all puzzles in this category...</a></span> <? } else { ?> <span><a href='<?=$instock_url?>'>See InStock puzzles in this category...</a></span> <? } ?> </div> <div class='please-note'> <img src='/images/product_list/please-note.png' class='heading'> <ul> <li> <img src='/images/icons/piece_gray.png'> Our puzzles are handcrafted one piece at a time and delivery times will vary. </li> <li> <img src='/images/icons/clock_gray.png'> Puzzles not in-stock take 2-4 weeks for crafting and delivery. </li> <li> <img src='/images/icons/box_gray.png'>InStock puzzles can ship the next business day.<a href="/puzzles/?instock=1"> View all InStock puzzles here!</a> </li> </ul> </div> </div> <div class="row sp-list-bg"> <? $this->render_partial('shop:product_list', array( 'products'=>$products, 'records_per_page'=>12, 'paginate'=>true, 'pagination_base_url'=>$category->page_url(null), 'page_index'=>$this->request_param(-1), 'empty_text'=>'There are no products in this category.' ), array( 'cache'=>true,// Enable caching 'cache_vary_by'=>array( 'url', 'sort_order'=>$sorting_option ), // We are going to reuse this partial on different pages, but its content can be different for different pages so we want to create different partial cache versions for different pages 'cache_versions'=>array('catalog'), // The partial should be recached then the catalog updates 'cache_ttl'=>1800 // Recache each 30 minutes )); ?> </div> <? endif ?>', 'CMS partial', 'shop:category', array(0)) /modules/cms/classes/cms_controller.php 1020
16 Cms_Controller->render_partial('shop:category') /modules/cms/classes/cms_controller.php(383) : eval()'d code 6
15 eval(()) /modules/cms/classes/cms_controller.php 383
14 Cms_Controller->evalWithException('?><div class="row"> <div class="content twelve columns"> <div class="row"> <div class="product-list nine columns" id="category-list" style='float:right'> <? $this->render_partial('shop:category') ?> </div> <div class="three columns categories"> <? $this->render_partial('stave:right_column'); ?> </div> </div> </div> </div>', 'CMS partial', 'shop:category_page', array(0)) /modules/cms/classes/cms_controller.php 1020
13 Cms_Controller->render_partial('shop:category_page') /modules/cms/classes/cms_controller.php(383) : eval()'d code 1
12 eval(()) /modules/cms/classes/cms_controller.php 383
11 Cms_Controller->evalWithException('?><? $this->render_partial('shop:category_page') ?> <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', 'Puzzles') /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 => 'valentines']) /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('/puzzles/valentines') /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