Add to Cart/Update Cart Button do not work when Permalink are set to Post Name
-
I’m experiencing an issue with the Add to Cart button on Single product pages as well as the update cart button. These only work when the permalink settings are set to “Plain”. When I set Permalink to “Post Name” these buttons no longer function. On the product list page, the Add to Cart buttons work fine in any permalink configuration.
I have already tested disabling all plugins aside from Woocommerce. I have also tested with the WordPress 2021 theme and Storefront Theme and the issue persists.
-
Hello,
As a first step, could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.
### WordPress Environment ### WordPress address (URL): https://palatefree.com/shop Site address (URL): https://palatefree.com/shop WC Version: 5.9.0 REST API Version: ? 5.9.0 WC Blocks Version: ? 6.1.0 Action Scheduler Version: ? 3.3.0 WC Admin Version: ? 2.8.0 Log Directory Writable: ? WP Version: 5.8.2 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: nginx/1.20.1 PHP Version: 7.3.32 PHP Post Max Size: 8 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.29.0 NSS/3.44 SUHOSIN Installed: – MySQL Version: 5.5.68-MariaDB Max Upload Size: 8 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 5.9.0 WC Database Prefix: pfshop Total Database Size: 7.69MB Database Data Size: 6.16MB Database Index Size: 1.53MB pfshopwoocommerce_sessions: Data: 0.03MB + Index: 0.02MB + Engine InnoDB pfshopwoocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwoocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopwoocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pfshopwoocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopwoocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwoocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pfshopwoocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwoocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pfshopwoocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwoocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pfshopwoocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopwoocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwoocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopactionscheduler_actions: Data: 0.02MB + Index: 0.13MB + Engine InnoDB pfshopactionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopactionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopactionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopcommentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopcomments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB pfshoplinks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopoptions: Data: 5.02MB + Index: 0.08MB + Engine InnoDB pfshoppostmeta: Data: 0.19MB + Index: 0.11MB + Engine InnoDB pfshopposts: Data: 0.11MB + Index: 0.06MB + Engine InnoDB pfshoptermmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopterms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopterm_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopterm_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopusermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopusers: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pfshopwc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB pfshopwc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopwc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pfshopwc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB pfshopwc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB pfshopwc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB pfshopwc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB pfshopwc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB pfshopwc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB pfshopwc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### attachment: 58 customize_changeset: 10 nav_menu_item: 6 page: 10 post: 2 product: 25 product_variation: 4 revision: 5 shop_order: 4 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (7) ### Classic Editor: by WordPress Contributors – 1.6.2 Classic Widgets: by WordPress Contributors – 0.2 Disable Comments: by WPDeveloper – 2.2.4 Jetpack: by Automattic – 10.3 Restricted Site Access: by Jake Goldman 10up Oomph – 7.2.0 WooCommerce Shipping & Tax: by WooCommerce – 1.25.19 WooCommerce: by Automattic – 5.9.0 ### Inactive Plugins (0) ### ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #6 - / Cart: #7 - /?page_id=7 Checkout: #8 - /?page_id=8 My account: #9 - /?page_id=9 Terms and conditions: #3 - /?page_id=3 ### Theme ### Name: Palate Free Storefront Version: 1.0.0 Author URL: https://edaptive.media Child Theme: ? Parent Theme Name: Storefront Parent Theme Version: 3.9.1 Parent Theme Author URL: https://woocommerce.com/ WooCommerce Support: ? ### Templates ### Overrides: palate-free-shop/woocommerce/emails/customer-processing-order.php ### Action Scheduler ### Pending: 44 Oldest: -0001-11-30 00:00:00 +0000 Newest: 2021-11-10 07:04:31 +0000 ### Status report information ### Generated at: 2021-11-11 20:13:07 +00:00
Hi @edaptive
I can’t access the shop page, but the first thing that caught my eyes is that your WooCommerce pages don’t seem to be set up correctly – which may be why the add to cart and cart buttons are not working. Please review the documentation below and make sure that those pages are set correctly.
https://woocommerce.com/document/configuring-woocommerce-settings/#advanced-settings
@maykato I’ve made the site accessible now. I also changed permalink back to “Posts Name” so you can see the behavior yourself. I did look at the documentation and confirmed the pages were set up correctly. It might have looked incorrect from the Status report since permalinks were set to plain, however, there are active pages assigned to each Woocommerce page under Advanced Settings.
Hello @edaptive,
I would recommend following our recommendations for your hosting environment:
- PHP version 7.4 or greater
- MySQL version 5.6 or greater OR MariaDB version 10.1 or greater
* https://woocommerce.com/document/server-requirements/
Before doing any changes you should always ensure that you have a backup of your site and database in case anything goes wrong. Read more at Backing up WordPress content.
Let us know how it goes.
For those who have a similar issue, this is related to server configurations that use nginx rather than apache which do not respect .htaccess rewrite rules. Rewrite rules need to be added to the “additional nginx directives” on the server.
Hi,
Glad that it could be figured out – thanks for sharing the info.
Feel free to open up a new thread for any other questions.
Cheers
- The topic ‘Add to Cart/Update Cart Button do not work when Permalink are set to Post Name’ is closed to new replies.