Want more timely Centmin Mod News Updates?
Become a Member

Prestashop Prestashop

Discussion in 'Ecommerce / Shopping cart usage' started by Matt, May 30, 2014.

  1. Matt

    Matt Well-Known Member

    929
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    1:32 AM
    1.5.15
    MariaDB 10.2
    I'm currently running a Prestashop store for my main site. Was a conversion from Opencart which I did a month or so back.


    This is what I had to do to get their friendly URLS and images working (inside the main server block for the domain):
    Code:
            rewrite ^/shop/api/?(.*)$ /shop/webservice/dispatcher.php?url=$1 last;
            rewrite ^/shop/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$1$2$3.jpg last;
            rewrite ^/shop/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$1$2$3$4.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
            rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
            rewrite ^/shop/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /shop/img/c/$1$2$3.jpg last;
            rewrite ^/shop/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /shop/img/c/$1$2.jpg last;
            rewrite ^/shop/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /shop/js/jquery/plugins/fancybox/images/$1.$2 last;
            if (!-e $request_filename) {
                    rewrite ^/shop/.*$ /shop/index.php last;
            }
    
            location /shop/ {
                    try_files $uri $uri/ /shop/index.php$is_args$args;
            }
     
  2. Zykov

    Zykov Member

    31
    7
    8
    May 28, 2014
    Ratings:
    +7
    Local Time:
    10:32 AM
    Nginx 1.7.1
    MariaDB 10
    May I have a little offtopic :shame:
    Please, tell me, why you've switched from OpenCart to PrestaShop? I'm just choosing the e-commerce engine for my client.
     
    Last edited: May 31, 2014
  3. Matt

    Matt Well-Known Member

    929
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    1:32 AM
    1.5.15
    MariaDB 10.2
    I went with these for the migration: http://www.shopping-cart-migration.com/

    Cost me $120 for it, but that was because I have over 1,000 customers and orders to migrate over.
     
  4. Zykov

    Zykov Member

    31
    7
    8
    May 28, 2014
    Ratings:
    +7
    Local Time:
    10:32 AM
    Nginx 1.7.1
    MariaDB 10
    Wow, this automated service looks really cool. But why you prefer PrestaShop? Did OpenCart failed to take your load?
     
  5. Matt

    Matt Well-Known Member

    929
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    1:32 AM
    1.5.15
    MariaDB 10.2
    OpenCart ran fine, but I found it quite limited. Prestashop IMO is much more robust, with a lot better feature base. The control panel itself in 1.6 is 1,000times better than OpenCart.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,384
    12,198
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,763
    Local Time:
    11:32 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. Matt

    Matt Well-Known Member

    929
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    1:32 AM
    1.5.15
    MariaDB 10.2
    1.6 is a big step up in terms of UI for Prestashop. I looked at 1.5 previously, but wasn't that impressed with it. When 1.6 came out, as soon as I could test the conversion scripts, and made sure it could do the extra things I was looking for, I migrated over to it.
     
  8. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    2:32 AM
    1.9.2
    10.0.20
    Hi ALL

    I encounter a problem on an application developped prestashop 1.6

    When I try to connect via the application, I get: "16: 34: 19: 82 HTTP connection request result :: HTTP / 1.1 405 Not Allowed <\ r> <\ n> Server: nginx centminmod <\ r> <\ n> Date: Wed, 15 Jul 2015 2:34:20 p.m. GMT <\ r> <\ n> Content-Type: text / html; charset = utf-8 <\ r> <\ n> Content- length: 166 <\ r> <\ n> Connection: keep-alive <\ r> <\ n> <\ r> <\ n> "

    Apparently, the application call a .php file in the directory modules

    When I utlise URL to test POST ie https://xx.php?email=xxxxx&password=xxxxx it does not execute the file, it asks to download: - /

    I have enabled the management of https in the application.

    I contacted the developer and he asked me to check the configuration nginx

    Some ideas to contact me?

    Thank you all
     
  9. FAPM

    FAPM Member

    58
    4
    8
    Jul 16, 2015
    Ratings:
    +6
    Local Time:
    2:32 AM
    1.9.2
    10.0.20
    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    server {
      listen  80;
      server_name xx.xx.fr;
      #rewrite ^ https://$host$request_uri? permanent;
        return 302 https://$server_name$request_uri;
      }
    
    server {
    
      listen 443 ssl spdy;
    
         server_name xx.xx.fr;
       ssl_dhparam /usr/local/nginx/conf/ssl/xx/dhparam.pem;
         ssl_certificate /usr/local/nginx/conf/ssl/xx/x.crt;
         ssl_certificate_key /usr/local/nginx/conf/ssl/xx/x.key;
    
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_session_cache  shared:SSL:10m;
      ssl_session_timeout  10m;
      ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers  on;
    
       add_header Alternate-Protocol  443:npn-spdy/3;
      add_header Strict-Transport-Security "max-age=31536000";
     
       # enable ocsp stapling
      resolver 8.8.8.8;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/xx.fr/ssl-trusted.crt;
    
       index index.html index.htm index.php;
    
      rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last;
      rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
    
      rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
      rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last;
      rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
    
    
      rewrite ^/order$ /index.php?controller=order last;
      if (!-e $request_filename){
      rewrite ^(.*)$ /index.php last;
      }
    
      # Redirect needed to "hide" index.php
    
    
    # ngx_pagespeed & ngx_pagespeed handler
    include /usr/local/nginx/conf/pagespeed.conf;
    include /usr/local/nginx/conf/pagespeedhandler.conf;
    include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/xx.fr/log/access.log combined buffer=32k;
      error_log /home/nginx/domains/xx.fr/log/error.log;
    
      root /home/nginx/domains/xx.fr/public;
    
      location / {
    
      try_files $uri $uri/ /index.php?q=$uri&$args;
      error_page 405 = $uri;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Enable for vBulletin usage WITHOUT vbSEO installed
      #try_files     $uri $uri/ /index.php;
    
      }
    
        location /c {
      rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2$3.jpg last;
      rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2.jpg last;
      }
    
      location /p {
      rewrite ^/p/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2$3.jpg last;
      rewrite ^/p/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/p/$1$2.jpg last;
      }
    
      location /images_ie {
      rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
      }
    
      # Don't log robots.txt or favicon.ico files
      location ~* ^/(favicon.ico|robots.txt)$ {
      access_log off;
      log_not_found off;
      }
      # Custom 404 page
      error_page 404 /index.php?controller=404;
    
      location ~* ^.+.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv|xml) {
      access_log off;
      expires 30d;
      }
    
    # Deny access to .htaccess
      location ~ /\.ht {
      deny all;
      }
    
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
    }
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,077
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    3:32 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Does opencart need a related edit for friendly urls Matt?