change pagination style in opencart

how to change design of pagination in opencart

Change or Add new class in pagination.php file stored in /home/ubuntu/public_html/shopping/system/library

<?php
/**
 * @package		OpenCart
 * @author		Daniel Kerr
 * @copyright	Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
 * @license		https://opensource.org/licenses/GPL-3.0
 * @link		https://www.opencart.com
*/

/**
* Pagination class
*/
class Pagination {
	public $total = 0;
	public $page = 1;
	public $limit = 20;
	public $num_links = 8;
	public $url = '';
	public $text_first = '|&lt;';
	public $text_last = '&gt;|';
	public $text_next = '&gt;';
	public $text_prev = '&lt;';

	/**
     * 
     *
     * @return	text
     */
	public function render() {
		$total = $this->total;

		if ($this->page < 1) {
			$page = 1;
		} else {
			$page = $this->page;
		}

		if (!(int)$this->limit) {
			$limit = 10;
		} else {
			$limit = $this->limit;
		}

		$num_links = $this->num_links;
		$num_pages = ceil($total / $limit);

		$this->url = str_replace('%7Bpage%7D', '{page}', $this->url);

		$output = '<ul class="pagination">';

		if ($page > 1) {
			$output .= '<li class="page-item"><a class="page-link" href="' . str_replace(array('&amp;page={page}', '?page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
			
			if ($page - 1 === 1) {
				$output .= '<li class="page-item"><a class="page-link" href="' . str_replace(array('&amp;page={page}', '?page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
			} else {
				$output .= '<li class="page-item"><a class="page-link" href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
			}
		}

		if ($num_pages > 1) {
			if ($num_pages <= $num_links) {
				$start = 1;
				$end = $num_pages;
			} else {
				$start = $page - floor($num_links / 2);
				$end = $page + floor($num_links / 2);

				if ($start < 1) {
					$end += abs($start) + 1;
					$start = 1;
				}

				if ($end > $num_pages) {
					$start -= ($end - $num_pages);
					$end = $num_pages;
				}
			}

			for ($i = $start; $i <= $end; $i++) {
				if ($page == $i) {
					$output .= '<li class="page-item active"><a href="#" class="page-link">' . $i . '</a></li>';
				} else {
					if ($i === 1) {
						$output .= '<li class="page-item" ><a class="page-link" href="' . str_replace(array('&amp;page={page}', '?page={page}', '&page={page}'), '', $this->url) . '">' . $i . '</a></li>';
					} else {
						$output .= '<li class="page-item"><a class="page-link" href="' . str_replace('{page}', $i, $this->url) . '">' . $i . '</a></li>';
					}
				}
			}
		}

		if ($page < $num_pages) {
			$output .= '<li class="page-item"><a class="page-link" href="' . str_replace('{page}', $page + 1, $this->url) . '">' . $this->text_next . '</a></li>';
			$output .= '<li class="page-item"><a class="page-link" href="' . str_replace('{page}', $num_pages, $this->url) . '">' . $this->text_last . '</a></li>';
		}

		$output .= '</ul>';

		if ($num_pages > 1) {
			return $output;
		} else {
			return '';
		}
	}
}

Developer Setup: High Availability & Multiconnect

Developer Setup: High Availability & Multiconnect

This document shows you how to set up a High Availability cluster on a developer machine. It also provides guidance on how to enable Multiconnect on top of that as well as the changes required for a highly available Multiconnect cluster. For a production setup, follow the relevant instructions listed in Production Setups.

Before you start any of these set ups, check our list of requirements.

To set up a High Availability cluster follow these steps:

  1. Create a biz Directory for the setup scripts
  2. Get the WhatsApp Business API Client configuration files
  3. Set the WA_API_VERSION environment variable
  4. Start the WhatsApp Business API Client with High Availability
  5. Verify containers are running
  6. Perform a health check
  7. Register the WhatsApp Business API Client
  8. Perform a second health check

To set up a Multiconnect cluster follow these steps:

  1. Set up two shards
  2. Perform a health check
  3. Start a third coreapp to maintain High Availability
  4. Perform a second health check

Developer Setup: Single Instance

Developer Setup: Single Instance

This document shows you how to set up a single instance of the WhatsApp Business API client on a developer machine for testing purposes. For a production setup, follow the relevant instructions listed in Production Setups.

To initially set up a single instance, check our list of requirements, and follow these steps:

  1. Create a biz directory for the setup scripts
  2. Get the WhatsApp Business API Client configuration files
  3. Set the WA_API_VERSION environment variable
  4. Start the WhatsApp Business API Client
  5. Verify containers are running
  6. Perform a health check
  7. Register the WhatsApp Business API Client
  8. Perform a second health check

WhatsApp Business API Installation for Production setup

Production Setups

Demonstrates how to set up a WhatsApp Business API client in a production environment and covers best practices. Please use this documentation as reference and make necessary changes according to your business needs.

The WhatsApp Business API client can be installed as a developer setup for testing using either Docker Compose or Minikube. You can also use Amazon Web Services (AWS) on production systems. You can migrate from a developer setup to a production setup when ready to send messages to customers.

Make sure you have approval for your business’s phone number and have a certificate before attempting installation.

WhatsApp Business API Installation for Developer setup

Developer Setups

Demonstrates how to set up a WhatsApp Business API client on your developer machine with the purpose of getting familiar with the setup process. This should not be used for a production environment. It is highly recommended that you try out one of the developer setup processes below before attempting a production setup.

The WhatsApp Business API client can be installed as a developer setup for testing using either Docker Compose or Minikube. You can also use Amazon Web Services (AWS) on production systems. You can migrate from a developer setup to a production setup when ready to send messages to customers.

Make sure you have approval for your business’s phone number and have a certificate before attempting installation.

iam vs acm certificates

ACM is the preferred tool to provision, manage, and deploy your server certificates. With ACM you can request a certificate or deploy an existing ACM or external certificate to AWS resources. Certificates provided by ACM are free and automatically renew. 

Use IAM as a certificate manager only when you must support HTTPS connections in a Region that is not supported by ACM. IAM securely encrypts your private keys and stores the encrypted version in IAM SSL certificate storage. IAM supports deploying server certificates in all Regions, but you must obtain your certificate from an external provider for use with AWS.

You cannot upload an ACM certificate to IAM. Additionally, you cannot manage your certificates from the IAM Console.

Server Migration Checklist

Server migration checklists

Validation Checklist

  • Set the hosts file to locally load services
  • Check to see if all required services are functioning
  • Check your site for 404 errors, 500 errors, PHP warnings, etc.
  • Update all server software to the latest version
  • Tune LAMP performance (Apache, MySQL, PHP)
  • Test the cron
  • Check email deliverability and email records (DKIM, SPF, etc.)
  • Verify mail is synced (i.e. that all messages are there and all contacts have been migrated)
  • Check backups are still working

Security Checklist

  • Audit firewall configuration
  • Identify and implement non-standard security requirements
  • Restrict access where appropriate
  • Implement programs to educate staff
  • Ensure setup is compliant with all protocols

Configuration Checklist

  • Analyse configurations of both old and new hosting environments
  • Configure web server modules (i.e. suexec, mod_php, mod_perl, mod_ssl, etc.)
  • Identify shared libraries and other code/program dependencies
  • Set up SSL certificates
  • Create fresh (or import existing) configuration files
  • Import databases
  • Fine-tune server performance
  • Check and reconfigure applications that connect from remote sources

User Account Checklist

  • Migrate user accounts and passwords
  • Consider forcing password reset on next login
  • Purge old/inactive accounts

File System Checklist

  • Ensure all files copied over
  • Check that permissions are correct
  • Crawl website to identify 404 not found errors

Final Check Checklist

  • Were all of the issues addressed during migration?
  • Was the migration painless? If not, what went wrong?
  • Are you happy with your new server?
  • What else (if anything) needs doing?