Jump to content

Add to cart button disappears on product page with combinations only sometimes !?


srm200

Recommended Posts

 
Hello,
 
I have the most strange problem i have ever encountered and never heard of someone else to have the same isue.
 
When i go on a product page that has attributes the "Add to cart" button disappears and the "This combination does not exist for this product. Please choose another." message is appearing. This is happening despite the fact that all the combinations have quantities set to 100.
 
Very important :
1. this problem does not always appear! Sometimes the "Add to cart" button is showing up but sometimes it doesn't, this is absolutely random. (if it its not showing from the first time try to refresh or go on other pages and back again to see the bug)
 
2. It does not appear on all browsers. It is appearing most of the times in Safari.
 
 
When the problem is appearing the console shows the following errors:
ReferenceError: Can't find variable: writeBookmarkLink
18-acetona-parfumata-cu-burete.html:12ReferenceError: Can't find variable: $
18-acetona-parfumata-cu-burete.html:18ReferenceError: Can't find variable: $
18-acetona-parfumata-cu-burete.html:21ReferenceError: Can't find variable: $
18-acetona-parfumata-cu-burete.html:23ReferenceError: Can't find variable: addCombination
18-acetona-parfumata-cu-burete.html:25ReferenceError: Can't find variable: FB
18-acetona-parfumata-cu-burete.html:32ReferenceError: Can't find variable: $
crossselling.js:44ReferenceError: Can't find variable: $
18-acetona-parfumata-cu-burete.html:35ReferenceError: Can't find variable: $
all.js:56Invalid App Id: Must be a number or numeric string representing the application id.
all.js:56FB.getLoginStatus() called before calling FB.init().
/page-not-foundFailed to load resource: the server responded with a status of 404 (Not Found)
/page-not-foundFailed to load resource: the server responded with a status of 404 (Not Found)
api.yotpo.com/users/social_signin:1SyntaxError: Unexpected token '<'

 

When the problem is NOT appearing the console shows the following errors:

ReferenceError: Can't find variable: FB
all.js:56Invalid App Id: Must be a number or numeric string representing the application id.
all.js:56FB.getLoginStatus() called before calling FB.init().
/page-not-foundFailed to load resource: the server responded with a status of 404 (Not Found)
/page-not-foundFailed to load resource: the server responded with a status of 404 (Not Found)
api.yotpo.com/users/social_signin:1SyntaxError: Unexpected token '<'
 
Here is the link to one of those products:
 
If anyone knows how to solve this issue or have encountered this problem please help.
Link to comment
Share on other sites

Hi!. 

Most of the errors you have are relative to a facebook module.

In the settings of the module, set the app id number. You can get one by creating an app in facebook.

Or try to disable the module.

 

Related to the attributes error, if you use stock in your shop, certain combinations can disable the add to cart button if the stock y zero or negative. 

 

The example product does not have attributes, i can't reproduce the error. Can you provide another product link to see the error ?

Link to comment
Share on other sites

Hello,

 

You can't see the error because i am creating new products for each combination.

 

Here is a link to a product that i will not modify:

 

http://cosmeticall.ro/gene-false/255-lipici-gene-false.html

 

All the quantities for the attributes are set to positive, i have even set the products to be order if quantity is 0 but the same issue happens.

 

Thank you very much for your help.

Link to comment
Share on other sites

Solved !

 

The problem was in the .htaccess file. I don't know exactly what happens but the bad one looks like this:

<Files *.ini>
Order deny,allow
Deny from All
</Files>
SetEnv PHPRC /home/cosmeti2/
#contentpack - not remove this comment 
RewriteRule ^(.*)blog/category/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/blockblog-category.php?category_id=$2 [QSA,L] 
RewriteRule ^(.*)blog/post/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/blockblog-post.php?post_id=$2 [QSA,L] 
RewriteRule ^(.*)blog/categories/?$ /modules/contentpack/blockblog-categories.php [QSA,L] 
RewriteRule ^(.*)blog/?$ /modules/contentpack/blockblog-all-posts.php [QSA,L] 
RewriteRule ^(.*)testimonials/?$ /modules/contentpack/blockshopreviews-form.php [QSA,L] 
RewriteRule ^(.*)faq/?$ /modules/contentpack/faq.php [QSA,L] 
RewriteRule ^(.*)guestbook/?$ /modules/contentpack/blockguestbook-form.php [QSA,L] 
RewriteRule ^(.*)news/?$ /modules/contentpack/items.php [QSA,L] 
RewriteRule ^(.*)news/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/item.php?item_id=$2 [QSA,L] 
#contentpack

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>

# Disable Multiviews
Options -Multiviews

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

and the good one looks like this:

<Files *.ini>
Order deny,allow
Deny from All
</Files>
SetEnv PHPRC /home/cosmeti2/
#contentpack - not remove this comment 
RewriteRule ^(.*)blog/category/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/blockblog-category.php?category_id=$2 [QSA,L] 
RewriteRule ^(.*)blog/post/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/blockblog-post.php?post_id=$2 [QSA,L] 
RewriteRule ^(.*)blog/categories/?$ /modules/contentpack/blockblog-categories.php [QSA,L] 
RewriteRule ^(.*)blog/?$ /modules/contentpack/blockblog-all-posts.php [QSA,L] 
RewriteRule ^(.*)testimonials/?$ /modules/contentpack/blockshopreviews-form.php [QSA,L] 
RewriteRule ^(.*)faq/?$ /modules/contentpack/faq.php [QSA,L] 
RewriteRule ^(.*)guestbook/?$ /modules/contentpack/blockguestbook-form.php [QSA,L] 
RewriteRule ^(.*)news/?$ /modules/contentpack/items.php [QSA,L] 
RewriteRule ^(.*)news/([0-9a-zA-Z-_]+)/?$ /modules/contentpack/item.php?item_id=$2 [QSA,L] 
#contentpack

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>

# Disable Multiviews
Options -Multiviews

RewriteEngine on
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^cosmeticall.ro$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

FileETag INode MTime Size
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html
	AddOutputFilterByType DEFLATE text/css
	AddOutputFilterByType DEFLATE text/javascript
	AddOutputFilterByType DEFLATE application/javascript
	AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

I manage to solve this by looking at the old backup files from the time when there was no problem.

 

Thank you anyway for trying to help.

Link to comment
Share on other sites

  • 3 years later...

Finally after many days of investigation with no luck I have found the problem. Share a like if it help you.  :)

This succed only with the products that have the combinations active. If succed for all products you have then is "Catalog Mode" activate. In this case turn it off.

If instead it succed only for some product if you see are all products with combinations that you have created. Just set the "Date of availability" of the product and check the right quantity inside each combination created.  :)

 

That's all!  :)

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...