Whoops \ Exception \ ErrorException (E_WARNING)
Invalid argument supplied for foreach() Whoops\Exception\ErrorException thrown with message "Invalid argument supplied for foreach()" Stacktrace: #10 Whoops\Exception\ErrorException in /home/tbec71889672/public_html/helpers/newProductHelpers.php:275 #9 Whoops\Run:handleError in /home/tbec71889672/public_html/helpers/newProductHelpers.php:275 #8 prodHelpers:simpleAdd in /home/tbec71889672/public_html/themes/default/views/product/view.php:101 #7 include in /home/tbec71889672/public_html/src/PMCOM/Core/View.php:51 #6 PMCOM\Core\View:_load in /home/tbec71889672/public_html/src/PMCOM/Core/View.php:193 #5 call_user_func_array in /home/tbec71889672/public_html/src/PMCOM/Core/View.php:193 #4 PMCOM\Core\View:__callStatic in /home/tbec71889672/public_html/src/PMCOM/Front/Product.php:452 #3 PMCOM\Front\Product:view in /home/tbec71889672/public_html/src/PMCOM/Core/Router.php:117 #2 PMCOM\Core\Router:_get_route in /home/tbec71889672/public_html/src/PMCOM/Core/Router.php:158 #1 call_user_func_array in /home/tbec71889672/public_html/src/PMCOM/Core/Router.php:158 #0 PMCOM\Core\Router:__callStatic in /home/tbec71889672/public_html/index.php:99
Stack frames (11)
10
Whoops\Exception\ErrorException
/helpers/newProductHelpers.php275
9
Whoops\Run handleError
/helpers/newProductHelpers.php275
8
prodHelpers simpleAdd
/themes/default/views/product/view.php101
7
include
/src/PMCOM/Core/View.php51
6
PMCOM\Core\View _load
/src/PMCOM/Core/View.php193
5
call_user_func_array
/src/PMCOM/Core/View.php193
4
PMCOM\Core\View __callStatic
/src/PMCOM/Front/Product.php452
3
PMCOM\Front\Product view
/src/PMCOM/Core/Router.php117
2
PMCOM\Core\Router _get_route
/src/PMCOM/Core/Router.php158
1
call_user_func_array
/src/PMCOM/Core/Router.php158
0
PMCOM\Core\Router __callStatic
/index.php99
/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 &pound;' . $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 &pound;' . $product->reduced_from_price . '</span>';
        endif;
        ?>
cpt-obvious This frame is within function 'handleError'
/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"
cpt-obvious This frame is within function 'simpleAdd'
/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';
        }
    }
cpt-obvious This frame is within function 'include'
/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
cpt-obvious This frame is within function '_load'
/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
cpt-obvious This frame is within function 'call_user_func_array'
/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
    */
cpt-obvious This frame is within function '__callStatic'
/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));
cpt-obvious This frame is within function 'view'
/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 );
    }
 
}
cpt-obvious This frame is within function '_get_route'
/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 );
    }
 
}
cpt-obvious This frame is within function 'call_user_func_array'
/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 );
cpt-obvious This frame is within function '__callStatic'

Environment & details:

empty
empty
empty
empty
empty
Key Value
LSPHP_ENABLE_USER_INI on
PATH /usr/local/bin:/usr/bin:/bin
TEMP /tmp
TMP /tmp
TMPDIR /tmp
PWD /
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING br,gzip
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
CONTENT_LENGTH 0
HTTP_HOST www.thebestecigarette.co.uk
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_IF_MODIFIED_SINCE Sat, 14 Sep 2024 01:27:01 GMT
HTTP_X_HTTPS 1
REDIRECT_UNIQUE_ID Z6os-3EBgauQ63k-RY-otwAAByA
REDIRECT_SCRIPT_URL /ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
REDIRECT_SCRIPT_URI https://www.thebestecigarette.co.uk/ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
REDIRECT_USER_ID 4182016
REDIRECT_HTTPS on
REDIRECT_SSL_TLS_SNI www.thebestecigarette.co.uk
REDIRECT_HTTP2 on
REDIRECT_H2PUSH on
REDIRECT_H2_PUSH on
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_STREAM_TAG 3057285-3117-3
REDIRECT_STATUS 200
UNIQUE_ID Z6os-3EBgauQ63k-RY-otwAAByA
SCRIPT_URL /ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
SCRIPT_URI https://www.thebestecigarette.co.uk/ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
USER_ID 4182016
HTTPS on
SSL_TLS_SNI www.thebestecigarette.co.uk
HTTP2 on
H2PUSH on
H2_PUSH on
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID 3
H2_STREAM_TAG 3057285-3117-3
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
SERVER_NAME www.thebestecigarette.co.uk
SERVER_ADDR 92.205.89.213
SERVER_PORT 443
REMOTE_ADDR 18.97.14.91
DOCUMENT_ROOT /home/tbec71889672/public_html
REQUEST_SCHEME https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /home/tbec71889672/public_html
SERVER_ADMIN webmaster@thebestecigarette.co.uk
SCRIPT_FILENAME /home/tbec71889672/public_html/index.php
REMOTE_PORT 45250
REDIRECT_URL /ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
SERVER_PROTOCOL HTTP/2.0
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /ecig-kits/disposable-e-cigarettes/elf-bar-600-disposables/elf-bar-watermelon-disposable-pod-device-20mg/
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1739205883.0822
REQUEST_TIME 1739205883
Key Value
LSPHP_ENABLE_USER_INI on
PATH /usr/local/bin:/usr/bin:/bin
TEMP /tmp
TMP /tmp
TMPDIR /tmp
PWD /
0. PMCOM\Core\PurposeHandler
1. Whoops\Handler\CallbackHandler