Search our site
Forum Search
Google Site Search
|
kkelso
Starting Member
USA
14 Posts Pre-sales questions only (More Details...)
|
Posted - 08/29/2020 : 18:40:01
Our quick buy button behaves strangely on our non-vsadmin-modified Premium Responsive Monochrome template we purchased. I can sign on with a client account, find a product in the products list, view the product details, add it to the cart, and proceed to checkout with no issues. However, if I remove that item from the cart before completing purchase, return to the same category page, and try to add any other product to my cart (still signed in with the same client account login) by using the Quick Buy button, it may work the first time, but usually not and definitely no other times after that. When it doesn't work it returns the error "Cart contents:undefined item(s)" in the cart pop up window and displays 'undefined products(s) in cart' in the left side column shopping cart. If I then add a product to the cart by browsing the product list again using the menu buttons at the top and/or left side column, finding the same product and adding it to the cart (not with quick buy button), it's not an issue and works as expected. However if I try to add it with the Quick Buy Button, it doesn't work. I have double checked that the ectcart.js and ectcart.css links are in the head section of every page, are the first entries before any other css or js links, and are after the Base Href tag with the site root. I also have not modified the quickbuy options in the includes.php file and have also implemented SEO friendly URL's. The site is https://tekna <dot> us Thanks in advance guys.
|
Vince
Administrator
42874 Posts |
Posted - 08/29/2020 : 22:07:04
Hi Kkelso I think the problem is that the cart is swapping between the www. and non-www. forms of the URL. If you add items to the cart on one form of the URL they will not be visible on the other. You have the base href on www but it seems you have a redirect to force the site on to non-www and this is causing the problem I think. Decide on one form (and better www. IMO.) Then make sure the redirect, base HREF and the ECT admin store URLs all use this. Even better, as you have the HTTPS certificate make all of these HTTPS too. Vince Click Here for Shopping Cart SoftwareClick Here to sign up for our newsletterClick Here for the latest updater
|
kkelso
Starting Member
USA
14 Posts Pre-sales questions only (More Details...)
|
Posted - 08/30/2020 : 13:43:04
Hi Vince, Thanks very much for your reply. That seems to have sorted it. The issue was in a confusion of rewrite rules I had in .htaccess. With reference to Phil's and Marshall's convo here: [url]https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=112885[/url]
I 'simplified' the rewrite directives in the .htaccess to this:
<ifModule mod_headers.c> # Enable HSTS (HTTP Strict Transport Security), tells the browser to ALWAYS USE HTTPS Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS # Enable HTTP Keep-Alive to allow the same TCP connection to send and receive multiple HTTP requests, thus reducing the latency for subsequent requests Header set Connection keep-alive </ifModule> <IfModule mod_rewrite.c> RewriteEngine On # REDIRECT www and https RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B] RewriteRule ^products/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B] RewriteRule ^manufacturer/?$ /categories.php?man=all [QSA,nc,L,B] RewriteRule ^manufacturer/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B] RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,nc,L,B] RewriteBase / </IfModule>
Thanks again, Karl

|
insight
ECT Moderator
USA
4479 Posts |
Posted - 08/30/2020 : 15:42:11
You ought to tidy up those "REDIRECT www and https" rules though, they are not so great. Right now a visitor to site.com gets 301 redirected to http://www.site.com and then again to https://www.site.com, so half a dozen trips to/from the server before you get any content. And a visitor to http://www.site.com gets a 302 redirect instead of a 301 to https://www.site.com. Neither is optimal for search engines or humans. Either combine them or at the very least rewrite the first one to https:// so it doesn't need to be redirected again and specify the type of redirect on the second. The IfModule containers and keep-alive stuff are probably superfluous and I wonder if the RewriteBase declaration actually does anything down there at the end. Might try ditching those to see if they are needed. Peter  Professional ecommerce web hosting services Shared hosting Windows & Linux | Dedicated servers | Domains | SSL Ecommerce Templates specialists since 2003 https://servelink.com
|
kkelso
Starting Member
USA
14 Posts Pre-sales questions only (More Details...)
|
Posted - 08/31/2020 : 10:56:22
Hi Peter, Thanks very much for your insight. I believe I have 'tidied it up' a bit more following your recommendations and now looks like this:
<IfModule mod_rewrite.c> RewriteEngine On # REDIRECT www and https RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,NC,L] RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L] # SEO optimization RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,nc,L,B] RewriteRule ^products/([^/.]*)/?$ /products.php?cat=$1 [QSA,nc,L,B] RewriteRule ^manufacturer/?$ /categories.php?man=all [QSA,nc,L,B] RewriteRule ^manufacturer/([^/.]*)/?$ /products.php?man=$1 [QSA,nc,L,B] RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,nc,L,B] </IfModule>
Thanks again, Karl
|
insight
ECT Moderator
USA
4479 Posts |
Posted - 09/01/2020 : 21:05:22
That looks a bit better. I'd keep the HSTS part, that is useful, and concatenate the https/www rules to save some weight and clean up a couple other issues so you have something like this: # Enable HSTS (HTTP Strict Transport Security), tells the browser to ALWAYS USE HTTPS Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS # REDIRECT www and https RewriteEngine on RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule (.*) https://www.tekna.us/$1 [R=301,L] # SEO optimization RewriteRule ^category/([^/.]*)/?$ /categories.php?cat=$1 [QSA,NC,L,B] RewriteRule ^products/([^/.]*)/?$ /products.php?cat=$1 [QSA,NC,L,B] RewriteRule ^manufacturer/?$ /categories.php?man=all [QSA,NC,L,B] RewriteRule ^manufacturer/([^/.]*)/?$ /products.php?man=$1 [QSA,NCL,B] RewriteRule ^([^/.]+)$ proddetail.php?prod=$1 [QSA,NC,L,B]
Peter  Professional ecommerce web hosting services Shared hosting Windows & Linux | Dedicated servers | Domains | SSL Ecommerce Templates specialists since 2003 https://servelink.com

|
|
|
Shopping Cart Software Forum for Ecommerce Templates |
© 2002-2022 ecommercetemplates.com |
 |
|
|