- 🇫🇷France paulbeaney
I can confirm that contextual filters seems to be the problem. I have a partially-working way round it for the my use-case - displaying an add-to-cart block for a Commerce Product related to the content being viewed.
Two steps are required:
- In the block Ajax configuration, set it to use GET rather than POST.
- In the contextual filter configuration of the view, for the section When the filter value is not available, select Query parameter as the type, and enter nid for Query parameter.
With these 2 changes, the block shows - albeit with the spinning ajax icon still visible below the block - but only on the first page load after drush cr. Subsequent page loads (which are of course cached by Drupal) result in only the block title and product price showing - the add-to-cart button does not appear, and again the spinning ajax icon remains visible.
This button problem might be specific to Commerce as I can see a
<drupal-render-placeholder callback="commerce_product.lazy_builders:addToCartForm">
tag in the returned JSON.