Scripts

Change Alpha Index Search Type in phpMyDirectory

In phpMyDirectory version 1.5.0, alpha search has change. The alpha search on the index page and browse categories page searches for categories with the letter selected. On the browse locations page, it searches locations with the letter selected.

In the previous version of phpMyDirectory it searches for listings with the letter selected regardless of which page you are on.

To simplify, in phpMyDirectory version 1.5.0 alpha search which shows something like this

http://www.example.com/sitemap.php?letter=A&id=&type=categories

http://www.example.com/sitemap.php?letter=A&id=&type=locations

while for previous version it show

http://www.example.com/search_results.php?alpha=A

If you are using phpMyDirectory version 1.5.0 but would like the old system, you need to edit a few files,

 

1. /template/YOURTEMPLATE/browse_categories.tpl

Find

<?php echo $this->block('search_alpha_categories'); ?>

 

2. /template/YOURTEMPLATE/browse_locations.tpl

Find

<?php echo $this->block('search_alpha_locations'); ?>

 

3. /template/YOURTEMPLATE/index.tpl

Find both code as in 1 & 2

 

Replace it with

<?php echo $this->block('search_alpha_listings'); ?>

How to enable SSL connection in OpenCart

Recently, Cloudflare enable FREE SSL Certificates to all the their users. As a long Cloudflare user, I quickly enable it to my OpenCart site. There are 2 levels of SSL in OpenCart. They are

  1. Minimum SSL – Only enable during checkout.
  2. Full SSL – SSL on entire site.

Below are the guides on how to enable both level.

Step 1 – Required for both Minimum SSL and Full SSL

This step involve enabling SSL in the OpenCart Dashboard

Log into the OpenCart Dashboard and browse to

System → Settings → Click Edit Store → Click Server tab → In “Use SSL” Check “YES” in the radio button → Click “Save” Button

Step 2- Only for Minimum SSL

This step involve enabling SSL in the “config.php” file. There are 2 files need to be edited.

1. /config.php

Find this code

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

2. /admin/config.php

Find this code

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/admin/');
define('HTTPS_CATALOG', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

 

Step 3- Only for Full SSL

This step involve enabling SSL in the “config.php” file. There are 2 files need to be edited.

1. /config.php

Find this code

// HTTP
define('HTTP_SERVER', 'http://www.example.com/');
define('HTTP_IMAGE', 'http://www.example.com/image/');
define('HTTP_ADMIN', 'http://www.example.com/admin/');

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTP
define('HTTP_SERVER', 'https://www.example.com/');
define('HTTP_IMAGE', 'https://www.example.com/image/');
define('HTTP_ADMIN', 'https://www.example.com/admin/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

2. /admin/config.php

Find this code

// HTTP
define('HTTP_SERVER', 'http://www.example.com/admin/');
define('HTTP_CATALOG', 'http://www.example.com/');
define('HTTP_IMAGE', 'http://www.example.com/image/');

// HTTPS
define('HTTPS_SERVER', 'http://www.example.com/admin/');
define('HTTPS_CATALOG', 'http://www.example.com/');
define('HTTPS_IMAGE', 'http://www.example.com/image/');

Change it to

// HTTP
define('HTTP_SERVER', 'https://www.example.com/admin/');
define('HTTP_CATALOG', 'https://www.example.com/');
define('HTTP_IMAGE', 'https://www.example.com/image/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/admin/');
define('HTTPS_CATALOG', 'https://www.example.com/');
define('HTTPS_IMAGE', 'https://www.example.com/image/');

 

Step 4- Only if you use Cloudflare Flexible SSL

For your domain, select CloudFlare settings domain, browse down until you see “SSL” option. From there select Flexible SSL.

You site should be running on SSL from now on.