SSL Theme Problem

Discussion in 'Opencart Support' started by neilva4, Feb 24, 2014.

Thread Status:
Not open for further replies.
  1. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    I have purchased an SSL certificate for my site. I have enabled it in admin and the config.php files. My site works fine as normal but as soon as i click on a secure part of the site i.e login the theme does not load i just get the text. It is a 3rd party theme but it is doing the same with the default theme also. I am unsure if the 3rd party theme i uploaded as overwritten some files which is making the default theme act up aswell. Hope someone can help as posted this on opencart and no one can help.
     
    Posted: Feb 24, 2014 By: neilva4 Member since: Feb 24, 2014
    #1
  2. sb65

    sb65 UKBF Regular Free Member

    183 40
    Does your theme overwrite any files (e.g via vQmod)? If it does remove the vQmod file associated with your purchased theme and try again with the default theme. If the problem remains then it's nothing to do with the purchased theme.

    Can you give a link to your site? Does your browser give any clues as to the issue? Are you sure the changes you've made in config.php are correct?
     
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #2
  3. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    Looking at the theme package i downloaded it does not look like the theme overwrites any files in VQMOD. Only 1 file is replaced and that is catalog/controller/common/header.php but there are hardly any changes. I have look at my config.php files and someone from opencart also had a look and they appear fine. My site is www v-c-s-shop co.uk
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #3
  4. antropy

    antropy OpenCart Experts Full Member - Verified Business

    3,269 567
    Sounds like the theme has some hardcoded links that include HTTP rather than HTTPS? If you know how to edit the code to change that then great, if not we may be able to help: http://www.antropy.co.uk/quote
     
    Posted: Feb 25, 2014 By: antropy Member since: Aug 2, 2010
    #4
  5. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    I have looked at a couple of the files from the theme and they are either .../image/ etc or href so i cannot see any references to HTTP or HTTPS.
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #5
  6. antropy

    antropy OpenCart Experts Full Member - Verified Business

    3,269 567
    How about when you view the site and go to View Source?
     
    Posted: Feb 25, 2014 By: antropy Member since: Aug 2, 2010
    #6
  7. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    I clicked on the create account page and then viewed source and all i can see are src=' or href=' and at the top where it says base ref it says http:// www mysite co.uk but there are a couple of references pointing to HTTPS
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #7
  8. antropy

    antropy OpenCart Experts Full Member - Verified Business

    3,269 567
    Could be the issue.
     
    Posted: Feb 25, 2014 By: antropy Member since: Aug 2, 2010
    #8
  9. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    how would i change this and do you know what file
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #9
  10. sb65

    sb65 UKBF Regular Free Member

    183 40
    It can't be the theme if the problem persists with the default theme, unless the changes to header.php are causing the issue.

    The base href should begin with https on a secure page. To rule out the theme, remove it from your server. The base href is set by /catalog/controller/common/header.php, which is the changed file.

    If removing the theme doesn't fix the issue this suggests an error in your config.php.

    Do you get similar errors using admin?

    EDIT: (Your pages are extremely slow to load, by the way)
    Having looked at your site, it doesn't look as if you have https enabled? That would explain why the base href is not https.......
     
    Last edited: Feb 25, 2014
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #10
  11. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    There was a few VQMOD files and some other files i had to upload, do i just delete these and replace the original header.php file and see what happens.

    I turned off SSL in my admin page but i can turn it back on if you need to check anything.

    In my admin/config.php file, if i add an S to the HTTP in the config.php file and go to my admin page it is also corrupted so what would cause this problem as well as the site itself.
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #11
  12. sb65

    sb65 UKBF Regular Free Member

    183 40
    You have SSL turned off on your shop front site at the moment. Try turning that on for starters.
     
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #12
  13. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    SSL has now been turned on
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #13
  14. sb65

    sb65 UKBF Regular Free Member

    183 40
    Right, and the base href is still not showing https.
    Is your config.php correct?
    It should look something like this, dependent on which version of OC you are running:

    Code:
    // HTTP
    define('HTTP_SERVER', 'http://www.yoursite.com/');
    define('HTTP_IMAGE', 'http://www.yoursite.com/image/');
    define('HTTP_ADMIN', 'http://www.yoursite.com/admin/');
    
    // HTTPS
    define('HTTPS_SERVER', 'https://www.yoursite.com/');
    define('HTTPS_IMAGE', 'https://www.yoursite.com/image/');
     
    Last edited: Feb 25, 2014
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #14
  15. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    Yes my config.php files look the same as above
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #15
  16. sb65

    sb65 UKBF Regular Free Member

    183 40
    What is the content of the vQmod file that modifies /catalog/controller/common/header.php?
     
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #16
  17. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    The above file was only uploaded and overwritten from my theme, all other files were uploaded to the themes folder and some to the VQMOD folder which did not overwrite any other stock files.
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #17
  18. sb65

    sb65 UKBF Regular Free Member

    183 40
    Ok, well, the bit of code that drives what base href value is returned sits at the top of catalog/controller/common/header.php, and retrieves the value from your config.php file - so it seems like that's where the issue lies.

    Can you post the content of your overwritten catalog/controller/common/header.php.

    You're running OC156?
     
    Posted: Feb 25, 2014 By: sb65 Member since: May 22, 2013
    #18
  19. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    This is the contents of the overwritten header.php and i am running 1.5.6
    I will need to do this in a few parts as it wont let me type more than 10000 characters.

    <?php
    class ControllerCommonHeader extends Controller {
    protected function index() {
    $this->data['title'] = $this->document->getTitle();

    if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
    $server = $this->config->get('config_ssl');
    } else {
    $server = $this->config->get('config_url');
    }

    if (isset($this->session->data['error']) && !empty($this->session->data['error'])) {
    $this->data['error'] = $this->session->data['error'];

    unset($this->session->data['error']);
    } else {
    $this->data['error'] = '';
    }

    $this->data['base'] = $server;
    $this->data['description'] = $this->document->getDescription();
    $this->data['keywords'] = $this->document->getKeywords();
    $this->data['links'] = $this->document->getLinks();
    $this->data['styles'] = $this->document->getStyles();
    $this->data['scripts'] = $this->document->getScripts();
    $this->data['lang'] = $this->language->get('code');
    $this->data['direction'] = $this->language->get('direction');
    $this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8');
    $this->data['name'] = $this->config->get('config_name');

    if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) {
    $this->data['icon'] = $server . 'image/' . $this->config->get('config_icon');
    } else {
    $this->data['icon'] = '';
    }

    if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) {
    $this->data['logo'] = $server . 'image/' . $this->config->get('config_logo');
    } else {
    $this->data['logo'] = '';
    }

    $this->language->load('common/header');

    $this->data['text_home'] = $this->language->get('text_home');
    $this->data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));
    $this->data['text_shopping_cart'] = $this->language->get('text_shopping_cart');
    $this->data['text_search'] = $this->language->get('text_search');
    $this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
    $this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
    $this->data['text_account'] = $this->language->get('text_account');
    $this->data['text_checkout'] = $this->language->get('text_checkout');

    $this->data['home'] = $this->url->link('common/home');
    $this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');
    $this->data['logged'] = $this->customer->isLogged();
    $this->data['account'] = $this->url->link('account/account', '', 'SSL');
    $this->data['shopping_cart'] = $this->url->link('checkout/cart');
    $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');

    // Daniel's robot detector
    $status = true;

    if (isset($this->request->server['HTTP_USER_AGENT'])) {
    $robots = explode("\n", trim($this->config->get('config_robots')));

    foreach ($robots as $robot) {
    if ($robot && strpos($this->request->server['HTTP_USER_AGENT'], trim($robot)) !== false) {
    $status = false;

    break;
    }
    }
    }

    // A dirty hack to try to set a cookie for the multi-store feature
    $this->load->model('setting/store');

    $this->data['stores'] = array();

    if ($this->config->get('config_shared') && $status) {
    $this->data['stores'][] = $server . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId();

    $stores = $this->model_setting_store->getStores();

    foreach ($stores as $store) {
    $this->data['stores'][] = $store['url'] . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId();
    }
    }

    // Search
    if (isset($this->request->get['search'])) {
    $this->data['search'] = $this->request->get['search'];
    } else {
    $this->data['search'] = '';
    }

    // Menu
    $this->load->model('catalog/category');

    $this->load->model('catalog/product');

    $this->data['categories'] = array();

    $categories = $this->model_catalog_category->getCategories(0);

    foreach ($categories as $category) {
    if ($category['top']) {
    $children_data = array();

    $children = $this->model_catalog_category->getCategories($category['category_id']);

    foreach ($children as $child) {
    $data = array(
    'filter_category_id' => $child['category_id'],
    'filter_sub_category' => true
    );
    /*Begin of the extension Header menu add level 3 sub categories extension code to be replaced:
    $product_total = $this->model_catalog_product->getTotalProducts($data);



    $children_data[] = array(
    'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
    'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
    );
    */
    // Level 2
    $children_level2 = $this->model_catalog_category->getCategories($child['category_id']);
    $children_data_level2 = array();
    foreach ($children_level2 as $child_level2) {
    $data_level2 = array(
    'filter_category_id' => $child_level2['category_id'],
    'filter_sub_category' => true
    );



    //level3 starts here
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #19
  20. neilva4

    neilva4 UKBF Newcomer Free Member

    31 0
    $children_level3 = $this->model_catalog_category->getCategories($child_level2['category_id']);
    $children_data_level3 = array();
    foreach ($children_level3 as $child_level3)
    {
    $data_level3 = array(
    'filter_category_id' => $child_level3['category_id'],
    'filter_sub_category' => true
    );
    $product_total_level3 = '';
    if ($this->config->get('config_product_count')) {
    $product_total_level3 = ' (' . $this->model_catalog_product->getTotalProducts($data_level3) . ')';

    }

    $children_data_level3[] = array(
    'name' => $child_level3['name'] . $product_total_level3,
    'href' => $this->url->link('product/category', 'path=' . $child['category_id'] . '_' . $child_level3['category_id']),
    'id' => $category['category_id']. '_' . $child['category_id']. '_' . $child_level3['category_id']
    );
    }
    //level 3 ends here
    $product_total_level2 = '';
    if ($this->config->get('config_product_count')) {
    $product_total_level2 = ' (' . $this->model_catalog_product->getTotalProducts($data_level2) . ')';
    }

    $children_data_level2[] = array(
    'name' => $child_level2['name'] . $product_total_level2,
    'href' => $this->url->link('product/category', 'path=' . $child['category_id'] . '_' . $child_level2['category_id']),
    'id' => $category['category_id']. '_' . $child['category_id']. '_' . $child_level2['category_id'],
    'children_level3' => $children_data_level3,
    );
    }
    $children_data[] = array(
    'name' => $child['name'],
    'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']),
    'id' => $category['category_id']. '_' . $child['category_id'],
    'children_level2' => $children_data_level2,
    );
    //END of the extension Header menu add level 3 sub categories extension
    }



    // Level 1
    $this->data['categories'][] = array(
    'name' => $category['name'],
    'children' => $children_data,
    'column' => $category['column'] ? $category['column'] : 1,
    'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
    );


    }
    }



    if (isset($this->request->get['filter_category_id'])) {


    $filter_category_id = $this->request->get['filter_category_id'];








    } else {

    $filter_category_id = 0;


    }

    $this->data['filter_category_id'] = $filter_category_id;







    foreach ($categories as $category) {





    $children_data = array();



    $children = $this->model_catalog_category->getCategories($category['category_id']);



    foreach ($children as $child) {

    $data = array(

    'filter_category_id' => $child['category_id'],

    'filter_sub_category' => true

    );



    $product_total = $this->model_catalog_product->getTotalProducts($data);



    $children_data[] = array(

    'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),

    'category_id' => $child['category_id']


    );

    }



    // Level 1

    $this->data['categories_search'][] = array(


    'name' => $category['name'],

    'category_id' => $category['category_id'],

    'children' => $children_data,



    );



    }



    $this->children = array(
    'module/language',
    'module/currency',
    'module/cart'
    );

    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/common/header.tpl';
    } else {
    $this->template = 'default/template/common/header.tpl';
    }

    $this->render();
    }
    }
    ?>
     
    Posted: Feb 25, 2014 By: neilva4 Member since: Feb 24, 2014
    #20
Thread Status:
Not open for further replies.