bootscore: [BUG] WooCommerce subscription switch
Describe the bug
Bootscore is not able to switch subscriptions and returns
{
"fragments": {
"div.widget_shopping_cart_content": "<div class=\"widget_shopping_cart_content\">\r\n\r\n <p class=\"woocommerce-mini-cart__empty-message woocommerce-info m-3\">No products in the basket.</p>\r\n\r\n\r\n</div>",
"span.cart-content": " <span class=\"cart-content\">\r\n </span>\r\n\r\n ",
"notices_html": "<ul class=\"woocommerce-error\" role=\"alert\">\n\t\t\t<li>\n\t\t\tSorry, this product cannot be purchased.\t\t</li>\n\t</ul>\n"
}
}
the product cannot be purchased, because Limit subscription is set to Limit to one of any status.
If using bootscore theme on switching /?wc-ajax=ace_add_to_cart is called with payload
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="attribute_type"
Premium
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="quantity"
1
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="add-to-cart"
81
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="product_id"
81
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="variation_id"
86
-----------------------------6351900761022413022355843451
Content-Disposition: form-data; name="add-to-cart"
81
-----------------------------6351900761022413022355843451--
but on using twenty twenty three /product/subscriptions/?switch-subscription=169&item=43&_wcsnonce=c884ef4b43 (where product/subscriptions is the product page) is called with payload
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="attribute_type"
Premium
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="quantity"
1
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="is-descendent-of-single-product-block"
false
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="add-to-cart"
81
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="product_id"
81
-----------------------------92260278125604018363965668702
Content-Disposition: form-data; name="variation_id"
86
-----------------------------92260278125604018363965668702--
Related to #521, but i thought it would be better to open a new issue.
If you need more information, i am happy to assist. Regarding a test page, i have to request if i can pass it to you. If you do not need one, the better.
Steps to reproduce
Go to the product page of the subscription. Select another subscription. Click switch.
Screenshots and Additional Info
No response
Website link
No response
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 21 (11 by maintainers)
The difference is that your subscription is limited to one of any status
Me https://dev.bootscore.me/product/subscription-variable/
You https://dev.bootscore.me/product/subscriptions/
Of course, because AJAX cart is enabled. Subscription plugin with this settings does not work together with AJAX cart. You have to disable it.
This gives you the answer. You should disable AJAX cart as usual and then delete/check each snippet in
js/theme.jsandwoocommerce/js/woocommerce.js. Once you find the culprit snippet, we can take a closer look.If AJAX cart is disabled, theme has the same functionality as the default themes. However, let’s wait for the example, then we can check.