Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 3

Displaying posts with tag: PrestaShop (reset)

How to setup High Availability PrestaShop on multiple servers with MariaDB Galera Cluster
+0 Vote Up -0Vote Down

November 7, 2014 By Severalnines

PrestaShop is a popular open source e-commerce software powering over 200,000 online stores, according to the company. We’ve seen a bit of interest into high availability PrestaShop setups, so this post will show you how to achieve that on multiple servers. Note that this setup not only caters for failures, but by load balancing traffic across multiple servers, it also allows the system to scale and handle more users.

This post is similar to our previous posts on web application scalability and high availability:

  [Read more...]
[PrestaShop] Carrier selection by postal code
+0 Vote Up -0Vote Down

To select the carrier / delivery method in PrestaShop by the postal code of the delivery address, create a file Address.php in /override/classes with this content:

<?php
class Address extends AddressCore
{
    protected static function getPostcodeByAddress($id_address) {
        $row = Db::getInstance()->getRow('
            SELECT `postcode`
            FROM '._DB_PREFIX_.'address a
            WHERE a.`id_address` = '.(int)($id_address));
        return $row['postcode'];
    }

    public static function getZoneById($id_address)
    {
        $postcode = self::getPostcodeByAddress($id_address);
        if (in_array($postcode, Array(1050))) …
  [Read more...]
[PrestaShop] Converting .htaccess to nginx include files
+0 Vote Up -0Vote Down

If you use PrestaShop and nginx, you may find this script to convert PrestaShop’s .htaccess rules into an nginx rule file useful:

#!/usr/local/bin/perl
print <<EOF;
fastcgi_buffers           16 128k;
fastcgi_busy_buffers_size 128k;
fastcgi_buffer_size       128k;
client_body_buffer_size   128k;
EOF
while (<>) {
    if (/^RewriteRule \^(.*) \[L\]$/) { print "rewrite ^/$1? break;\n"; }
    if (/^RewriteRule \^(.*) \[QSA,L\]$/) { print "rewrite ^/$1 break;\n"; }
    if (/^ErrorDocument (\d+) (.*)$/) { print "error_page $1 = $2;\n"; }
}

Save as convert-htaccess.pl and run with ./convert-htaccess.pl <.htaccess …

  [Read more...]
Showing entries 1 to 3

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.