Jump to content

undefined alert add to cart or select an attribute


Ehsanai

Recommended Posts

  • 2 weeks later...
  • 1 year later...
On 9/4/2022 at 7:56 AM, Ehsanai said:

It was for .htaccess edit and I change it to default and problem solved.

Hello ,
From my site , For inactive products showing this undefined error after selecting attributes
So please shared  What i need to  changes in .htaccess file for solving this issue,
Please help me , 
I'm stuck at this moment.
 

Link to comment
Share on other sites

  • 1 month later...

Solution for those who use only nginx as webserver and multi-language site..My fix was to add few rewrite rules to my nginx vhost (I used default cloudpanel vhost for prestashop 1.7 and installation of Prestashop 8). My addition is in quotes. (solution found here https://github.com/PrestaShop/PrestaShop/pull/12082/files#diff-b115851dfa6156b9d45986fb7d75c601R103)
 

server {
  listen 80;
  listen [::]:80;
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name eshop.xxxxxxxxx.com;
  {{root}}
  large_client_header_buffers 4 32k;

  {{nginx_access_log}}
  {{nginx_error_log}}

  #if ($scheme != "https") {
  #  rewrite ^ https://$host$uri permanent;
  #}

  location ~ /.well-known {
    auth_basic off;
    allow all;
  }

  {{settings}}

  location /adminprodxxxx/ {
    try_files $uri $uri/ /adminprodxxxx/index.php?$args;
  }

Quote

  rewrite ^/sk$ /sk/ redirect;
  rewrite ^/sk/(.*) /$1;
  rewrite ^/cs$ /cs/ redirect;
  rewrite ^/cs/(.*) /$1;

  rewrite ^/(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$1$2.jpg last;
  rewrite ^/(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last;
  rewrite ^/(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;
  rewrite ^/(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;
  rewrite ^/(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;
  rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;
  rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last;
  rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;
  rewrite ^/c/([\w.-]+)/.+\.jpg$ /img/c/$1.jpg last;

  rewrite ^images_ie/?([^/]+)\.(gif|jpe?g|png)$ js/jquery/plugins/fancybox/images/$1.$2 last;
  rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
  rewrite ^(/install(?:-dev)?/sandbox)/.* /$1/test.php last;

  try_files $uri $uri/ /index.php?$args;
  index index.php index.html;

  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_intercept_errors on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files $uri =404;
    fastcgi_read_timeout 3600;
    fastcgi_send_timeout 3600;
    fastcgi_param HTTPS $fastcgi_https;
    fastcgi_pass 127.0.0.1:{{php_fpm_port}};
    fastcgi_param PHP_VALUE "{{php_settings}}";
  }

  location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
    add_header Access-Control-Allow-Origin "*";
    add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
    expires max;
    access_log off;
  }

  if (-f $request_filename) {
    break;
  }
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...