This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: I am unable to add products to my cart because the product page redirects to the shop page

Solution: The .htaccess file was empty. Adding the content from the permalinks page and changing the settings in the Settings -> General resolved the issue. The Site ID was set to https://www.sweetimber.com/wordpress/?page_id=11/testhome. Please set this to the main site directory such as https://www.sweetimber.com/wordpress/

This topic contains 8 replies, has 2 voices.

Last updated by bertaR 1 year, 4 months ago.

Assigned support staff: Lauren.

Author Posts
May 15, 2018 at 8:57 am #2132334

bertaR

Background:
I've been building my woo-commerce store with WPML and during some testing I found out, that the "add to cart" buttons on the pages of the individual products don't actually add the product to the cart. That was weird, while the "add to cart" buttons on the product (category) overview in the shop did work. Simultaneously I found out an issue in the cart itself. The "update cart" button dind't work either.

I've spent countless hours trying to solve this using various plugin and other solutions including reomving the "add to cart" buttons and replacing them with others, using some AJAX Cart plugin to make the cart update automatically, etc.
I tried to switch all the plugins off and narrowed it down to the point, that I could identify WPML as the cause. I search for the cause for several more hours until I've decided to check the forums here. Finally I found some answers: it's in the permalinks structure.
I've build the whole web with the standard settings (not very cleverly, appearently, but no one told me to change it at the beginning). So I've change them to the "postname" version, which is supposed to be the right one for an e-shop.
After I did that, I also installed some plugin to deal with the 301 redirects, but that's probably not necessary, since the website is not yet published,.
But the thing now is, that everything keeps redirecting to the shop page. The only thing I can do is switch the languages and so land on my spanish, english and german shop main page. That's it. I couldn't therefore even check, if the permalink switch solved the previously mentioned issues.
I've tried switch the permalinks back to original, which makes the website work again, but the cart issues are still there.

Can anyone tell, what do I need to do? I've spent insane amounts of time with it, while I should already work on other parts of the business as well 😀

Thank a lot in advance!

May 16, 2018 at 8:51 am #2152406

bertaR

Just discovered some things.

Looks like after the permalink structure switch there occured some issue with the language directories as you can see in the screenshot.

Solving this could solve the redirecting issue probably? Still not sure what to do, though..

May 16, 2018 at 12:43 pm #2157086

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

The issue with the redirect may very well be caused by the redirect plugin you are using. Can you please tell me which one you have installed? If you disable the redirect plugin, are you able to view the product pages?

Also, I see you have a view different add to cart plugins. If you switch the permalinks back to your initial structure and activate just WooCommerce and WPML, does the standard add to cart plugin work correctly?

Lastly, you can try running the cleanup steps to see if this changes anything. Please be sure to make a full backup of your site and database.

Then, go to WPML -> Support -> Troubleshooting.

Look for 'Clean up' and click the following:
- Synchronize posts taxonomies
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Fix Terms count
- Fix post assignment for translations

Please let me know if any of these steps change anything.

May 16, 2018 at 4:22 pm #2161182

bertaR

Hello and thank you for the answer!

I have almost all the plugins turned off. Also the redirect plugin I shut off when it didn't do anything obviously useful. Those I tried were "Simple 301 Redirects" and "Redirection" (both are inactive at the moment).
For the cart issue I tried "Woocmmerce AJAX Cart" plugin which did the automatic update, but that didn't affect the inability of the cart to change the amount of added items.

My currently active plugins are the following:

WooCommerce
WooCommerce Germanized
WooCommerce Multilingual
WooCommerce Services
WooCommerce Weight based shipping
WP All import
WPML all import
WPML CMS nav
WPML media
WPML Multilingual CMS
WPML sticky links
WPML string translation
WPML trnslation management

The troubleshooting also didn't change anything unfortunately.

Could the problem lay in the htaccess file?MMaybe the permalink structure change could rewrite it correctly and now it's redirecting every page to the home page? I tried to change the writability rights, but somehow I could do that. The rights for the files are curently 660, respectively 664. Could that be the issue?

May 16, 2018 at 5:35 pm #2161953

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I recommend checking the .htaccess file to see if redirects were added there. Some plugins do that. Also, you could rename the current .htaccess file and then download a fresh one from the WordPress download. Try that and let me know if the redirect is still happening.

May 18, 2018 at 7:26 am #2187271

bertaR

I have currently some accessibility troubles with my hosting server - I can't edit, rename or change any files.

But I've checked the htaccess file through the wordpress dashbord and it seems fine, at least based on what I was able to find about it.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

Maybe is there still some other problem? I'm really getting desperate here..

May 18, 2018 at 1:06 pm #2189205

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link

May 21, 2018 at 7:04 pm #2203876

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for sending access. I looked at your .htaccess file via FTP and the file was empty (see attached screenshot). I added the content from the permalinks page.

Also, in the Settings -> General you have the Site ID set to hidden link. Please set this to the main site directory such as hidden link and let me know if this resolves the issue.

May 25, 2018 at 7:18 am #2227224

bertaR

Thanks a lot. Now it works!