/home/tbec71889672/public_html/helpers/newProductHelpers.php
$optionsText .= '<p class="select-option-text">Please select your options to purchase</p>';
if( $product->lead_time ) :
$optionsText .= '<p class="lead-time-text">Lead Time: ' . $product->lead_time . '</span>';
endif;
foreach( $product->options as $option_key => $option ) :
$optionID = $option->id;
$choices = isset( $option->choices ) ?$option->choices : array();
$value = isset( $post_values['op_' . $option->id] ) ? $post_values['op_' . $option->id] : '';
if( input::get( 'c' ) ) :
$value = input::get( 'c' );
endif;
$selectAttributes = ' name="op_' . $option->id . '" ';
if( in_array( strtolower( $option->name ), array( 'colour', 'color', 'colours', 'colours' ) ) ) :
$selectAttributes .= " class=\"product-filter\" onchange=\"check_price( this.value, '" . $product->id . "' )\" ";
else :
$selectAttributes .= " class=\"product-filter\" onchange=\"check_price( this.value, '" . $product->id . "' )\" ";
endif;
$options .= '<p class="attribute-name"><span>' . $option->name . ':</span>';
$options .= "<select {$selectAttributes}>";
foreach( $choices as $choice_key => $choice ) :
$selected = $value == $choice_key ? 'selected="selected"' : '';
$options .= "<option {$selected} value=\"{$choice_key}\">{$choice}</option>";
endforeach;
$options .= '</select></p>';
endforeach;
endif;
// Attributes
if( isset( $product->attributes ) && is_array( $product->attributes ) ) :
foreach( $product->attributes as $attribute ) :
$attributes .= '<p class="attribute-name">' . $attribute->label .'</p>';
$attributes .= '<p>' . self::attributeDisplay( $attribute, isset( $post_values['att_' . $attribute->id] ) ? $post_values['att_' . $attribute->id] : $attribute->value ) . '</p>';
endforeach;
endif;
$quantiy = isset( $post_values['qty'] ) ? $post_values['qty'] : 1;
// R.R.P.
$rrp = '';
if( (float)$product->reduced_from_price !== 0.00 && (float)$product->reduced_from_price > (float)$product->price ) :
$rrp = '<p class="reduced-from-price">was £' . $product->reduced_from_price . '</span>';
endif;
?>
/home/tbec71889672/public_html/helpers/newProductHelpers.php
$optionsText .= '<p class="select-option-text">Please select your options to purchase</p>';
if( $product->lead_time ) :
$optionsText .= '<p class="lead-time-text">Lead Time: ' . $product->lead_time . '</span>';
endif;
foreach( $product->options as $option_key => $option ) :
$optionID = $option->id;
$choices = isset( $option->choices ) ?$option->choices : array();
$value = isset( $post_values['op_' . $option->id] ) ? $post_values['op_' . $option->id] : '';
if( input::get( 'c' ) ) :
$value = input::get( 'c' );
endif;
$selectAttributes = ' name="op_' . $option->id . '" ';
if( in_array( strtolower( $option->name ), array( 'colour', 'color', 'colours', 'colours' ) ) ) :
$selectAttributes .= " class=\"product-filter\" onchange=\"check_price( this.value, '" . $product->id . "' )\" ";
else :
$selectAttributes .= " class=\"product-filter\" onchange=\"check_price( this.value, '" . $product->id . "' )\" ";
endif;
$options .= '<p class="attribute-name"><span>' . $option->name . ':</span>';
$options .= "<select {$selectAttributes}>";
foreach( $choices as $choice_key => $choice ) :
$selected = $value == $choice_key ? 'selected="selected"' : '';
$options .= "<option {$selected} value=\"{$choice_key}\">{$choice}</option>";
endforeach;
$options .= '</select></p>';
endforeach;
endif;
// Attributes
if( isset( $product->attributes ) && is_array( $product->attributes ) ) :
foreach( $product->attributes as $attribute ) :
$attributes .= '<p class="attribute-name">' . $attribute->label .'</p>';
$attributes .= '<p>' . self::attributeDisplay( $attribute, isset( $post_values['att_' . $attribute->id] ) ? $post_values['att_' . $attribute->id] : $attribute->value ) . '</p>';
endforeach;
endif;
$quantiy = isset( $post_values['qty'] ) ? $post_values['qty'] : 1;
// R.R.P.
$rrp = '';
if( (float)$product->reduced_from_price !== 0.00 && (float)$product->reduced_from_price > (float)$product->price ) :
$rrp = '<p class="reduced-from-price">was £' . $product->reduced_from_price . '</span>';
endif;
?>
/home/tbec71889672/public_html/themes/default/views/product/view.php
<div>
<a class="fancybox fancybox.iframe" href="<?php echo $product->custom_options['product_step_guide_url']; ?>"><img src="/themes/default/images/step.png" /></a>
</div>
<?php endif; ?>
</div>
</div>
<div class="right cf">
<?php if( \PMCOM\Modules\Reviews\ReviewsModule::isEnabled() && Session::get('customer_auth') ) : ?>
<div class="reviewer">
<h4>Purchased this product?</h4>
<a href="/product_review/add/<?php echo $product->id; ?>" class="fancybox fancybox.iframe btn btn-primary btn-sm"><i class="fa fa-star-half-o"></i> Submit a Review</a>
</div>
<?php endif; ?>
<div class="purchase-wrapper">
<?php echo Form::form_open( 'add_cart', BASE_URL . 'cart/add/' . $product->id, 'post', '' ); ?>
<?php prodHelpers::simpleAdd( $product, $post_values ); ?>
<?php echo Form::form_close(); ?>
<?php if( !$product->has_stock ) : ?>
<p class="stock out"><i class="fa fa-times-circle"></i> Out Of Stock</p>
<?php endif; ?>
</div>
<ul id="share">
<li class="share-text">share this product</li>
<li class="share-twitter">
<a
onclick="window.open('http://twitter.com/home?status=Currently%20viewing%20<?php echo urlencode( $product->url ); ?>','twitter','height=400, width=600,scrollbars=no')"
href="javascript:;"
title="Share this product on Twitter">
<i class="fa fa-twitter-square"></i>
</a>
</li>
<li class="share-facebook">
<a
onclick="window.open('http://www.facebook.com/sharer.php?u=<?php echo urlencode( $product->url ); ?>&t=<?php echo urlencode( $product->name ); ?>','facebook','height=310, width=760,scrollbars=no'); return false;"
title="Share this product on Facebook"
/home/tbec71889672/public_html/src/PMCOM/Core/View.php
* @return [type] [description]
*/
public function _load($view,$data='')
{
if( isset( $_GET['helpers'] ) ) {
die( include Display::theme_path() . 'views/page/helpers.php' );
}
if(file_exists(Display::theme_path().'views/'.$view.'.php'))
{
if($data) extract($data);
//ob_start();
include Display::theme_path().'header.php';
include Display::theme_path().'views/'.$view.'.php';
include Display::theme_path().'footer.php';
/* $cachefile = ''.date('M-d-Y').'.html';
$fp = fopen($cachefile, 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
// finally send browser output
ob_end_flush(); */
}
elseif(file_exists(BASE_PATH.'views/'.$view.'.php'))
{
if($data) extract($data);
include Display::theme_path().'header.php';
include BASE_PATH.'views/'.$view.'.php';
include Display::theme_path().'footer.php';
}
else
{
echo 'view file not found';
}
}
/home/tbec71889672/public_html/src/PMCOM/Core/View.php
header("HTTP/1.0 404 Not Found");
include Display::theme_path().'header.php';
include Display::theme_path().'views/404/404.php';
include Display::theme_path().'footer.php';
}
/**
* [__callStatic description]
* @param [type] $method [description]
* @param [type] $parameters [description]
* @return [type] [description]
*/
public static function __callStatic( $method, $parameters )
{
if( is_null( static::$instance ) )
{
static::$instance = new View();
}
return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
}
/**
* Load a view using blade
*
* @param string $view
* @param array $data
* @return void
*/
public static function load_blade($view, Array $data = null)
{
if(file_exists(Display::theme_path().'views/'.str_replace('.', '/', $view).'.blade.php'))
{
$views = Display::theme_path() . 'views';
}
elseif(file_exists(BASE_PATH.'views/'.str_replace('.', '/', $view).'.blade.php'))
{
$views = BASE_PATH . 'views';
}
else
/home/tbec71889672/public_html/src/PMCOM/Core/View.php
header("HTTP/1.0 404 Not Found");
include Display::theme_path().'header.php';
include Display::theme_path().'views/404/404.php';
include Display::theme_path().'footer.php';
}
/**
* [__callStatic description]
* @param [type] $method [description]
* @param [type] $parameters [description]
* @return [type] [description]
*/
public static function __callStatic( $method, $parameters )
{
if( is_null( static::$instance ) )
{
static::$instance = new View();
}
return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
}
/**
* Load a view using blade
*
* @param string $view
* @param array $data
* @return void
*/
public static function load_blade($view, Array $data = null)
{
if(file_exists(Display::theme_path().'views/'.str_replace('.', '/', $view).'.blade.php'))
{
$views = Display::theme_path() . 'views';
}
elseif(file_exists(BASE_PATH.'views/'.str_replace('.', '/', $view).'.blade.php'))
{
$views = BASE_PATH . 'views';
}
else
/home/tbec71889672/public_html/src/PMCOM/Front/Product.php
$this->data["meta"]["canonical"] = $this->generate_url($product->id);
$this->data["og_title"] = $this->data["meta"]["title"];
$this->data["og_description"] = $this->data["meta"]["description"];
$this->data["og_image"] = isset($product->images[0]['main']) ? $product->images[0]['main'] : null;
$this->data["is"] = 'product';
$this->data["post_id"] = $product->id;
$this->data['heading'] = $product->name;
$this->data['product'] = $product;
}
//var_dump($product->display_not_in_stock);die();
if( ! $product->has_stock && ! $product->display_not_in_stock )
{
View::show404();
}
else
{
View::load('product/view', $this->data);
}
}
function get_inventory_remind_list($product_id) {
return $this->database->query("SELECT *, (SELECT concat(name, ' - ') AS name FROM product_options WHERE product_options.id = product_inventory_options.product_option_id) as product_option_names FROM product_inventory LEFT JOIN product_inventory_options ON product_inventory_options.product_inventory_id = product_inventory.id WHERE stock < 1 AND unlimited = 0 AND product_id = '" . $product_id . "';");
}
// ------------------------------------------------------------------------
/**
* Get Stock List
*
* Gets the items stock lisy
*
* @param object $product
* @return boolan or string
*/
/home/tbec71889672/public_html/src/PMCOM/Core/Router.php
die( call_user_func_array( array( $frontRouted, lcfirst( self::studly( $method ) ) ), $segments ) );
endif;
} catch( \Orno\Di\Exception\ReflectionException $e ) {}
// Need to analyses the URL to see if a valid page
$controllers = array(
'PMCOM\\Front\\Page',
'PMCOM\\Front\\Product',
'PMCOM\\Front\\Category'
);
if( count( $segments ) !== 0 ) {
$method = array_reverse( $segments )[0];
} elseif( $method === 'index' ) {
$method = $class;
}
foreach( $controllers as $controller ) :
try {
$routed = $this->container->get( $controller );
if( $routed->exists( $method ) ) :
die( $routed->view( $method ) );
endif;
} catch( \Orno\Di\Exception\ReflectionException $e ) {}
endforeach;
endif;
endif;
// Show 404
die( call_user_func_array( array( $this->container->get( 'PMCOM\Core\View' ), '_show404' ), $segments ) );
}
/**
* [_redirect_url description]
* @param [type] $url [description]
* @return [type] [description]
*/
public function _redirect_url($url)
{
$database = Database::getInstance();
$redirect = $database->get('url_redirects', array('old_url' => $url, 'site_id' => SITE));
/home/tbec71889672/public_html/src/PMCOM/Core/Router.php
{
header("HTTP/1.1 301 Moved Permanently");
redirect($redirect->new_url);
}
}
/**
* [__callStatic description]
* @param [type] $method [description]
* @param [type] $parameters [description]
* @return [type] [description]
*/
public static function __callStatic( $method, $parameters )
{
if( is_null( static::$instance ) )
{
static::$instance = new Router();
}
return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
}
}
/home/tbec71889672/public_html/src/PMCOM/Core/Router.php
{
header("HTTP/1.1 301 Moved Permanently");
redirect($redirect->new_url);
}
}
/**
* [__callStatic description]
* @param [type] $method [description]
* @param [type] $parameters [description]
* @return [type] [description]
*/
public static function __callStatic( $method, $parameters )
{
if( is_null( static::$instance ) )
{
static::$instance = new Router();
}
return call_user_func_array( array( static::$instance, '_' . $method ), $parameters );
}
}
/home/tbec71889672/public_html/index.php
|---------------------------------------------------------------
| Check for Installl
|---------------------------------------------------------------
*/
if( ! file_exists( BASE_PATH . 'install/index.bck.php' ) ) :
// if it doesn't exist then the install hasn't taken place
include BASE_PATH . 'install/index.php';
exit;
endif;
/*
|---------------------------------------------------------------
| LOAD THE ROUTES CLASS
|---------------------------------------------------------------
|
| And away we go...
|
*/
PMCOM\Core\Router::get_route( $container );