Hi all. I ran into this strange problem and I'm running out of options to check. Hopefully you have any suggestions.
The issue can be quite easily summarized:
- There is one category of products in which clicking the order button does not work, it raises a jquery error (see below) and results in a empty shopping cart. See https://www.jubalvarsseveld.nl/webshop/soepshop
Clicking the order button on a product detail page of a product in this specific category works perfectly fine. See e.g. https://www.jubalvarsseveld.nl/webshop/soepshop/erwtensoep-1-liter-25-detail.html
- In other sub-categories, clicking the order button directly works perfectly fine. See e.g. https://www.jubalvarsseveld.nl/webshop/donateur-worden.html or https://www.jubalvarsseveld.nl/webshop/eenmalige-schenking-doen.html
The error raised after clicking the order button is (according to the browser inspect feature) as follows:
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
jquery-migrate.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2 JQMIGRATE: Migrate is installed, version 1.4.1
soepshop.html:1316
Uncaught TypeError: jQuery(...).vm2front is not a function
at HTMLDocument.<anonymous> (soepshop.html:1316)
at u (jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2)
at Object.fireWith [as resolveWith] (jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2)
at Function.ready (jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2)
at HTMLDocument._ (jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2)
(anonymous) @ soepshop.html:1316
u @ jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2
fireWith @ jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2
ready @ jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2
_ @ jquery.min.js?0d074817dd3fafe8e8ee480b5bb425eb:2
DevTools failed to load source map: Could not load content for https://www.jubalvarsseveld.nl/media/gantry5/assets/js/main.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
The strange thing is that this does not happen with clicking the order button in the other categories.
The only diffrence I can think of is that the first category has no parent categories, whereas the URLs mentioned in the last bullet refer to a sub-category of a (empty) parent category (see screenshot)
(https://www.jubalvarsseveld.nl/images/vm_screenshot.png)
I already tried disabling the jQuery features of Virtuemart itself, but that doesn't help. Given the difference in categorys and subcategory's it almost feels like I should move the products into a (virtual) subcategory, but that yet again also feels rather ackward move to make (like avoiding a bug instead of adressing it).
Any thoughts here? Thanks.
We use:
- VirtueMart 3.8.8 10472
- Joomla! 3.10.3
- PHP Version 7.3.32
- Web Server Apache
- Gantry Administration by RocketTheme Version: 5.5.5 / Released: November 22, 2021
[/list]
Quotevm2front is not a function
this normally occurs when all the required VM js files are not loaded ...
go thru the inspector network tab for the 2 situations and check all js is loading and in the correct order
Quote from: GJC Web Design on November 27, 2021, 21:43:52 PM
Quotevm2front is not a function
this normally occurs when all the required VM js files are not loaded ...
go thru the inspector network tab for the 2 situations and check all js is loading and in the correct order
I only see status code 200 (so ok) in that screen. So which JS should be missing to cause this error?
Maybe your template interferes with routing. try with vmbeez3 template and turn sef.
Jörgen
QuoteI only see status code 200 (so ok) in that screen. So which JS should be missing to cause this error?
what has 200 got to do with it .. if it isn't called it isn't there -- as one works and the other doesn't there must be some difference somewhere.... logic
have u done this!!!! ->>>>> go thru the inspector network tab for the 2 situations and check all js is loading and in the correct order
compare!
Quote from: Jörgen on November 28, 2021, 17:38:34 PM
Maybe your template interferes with routing. try with vmbeez3 template and turn sef.
Jörgen
Thank you for the suggestion. There is no vmbeez3 template however. All templates are set to default (which is Gantry5 Hydrogen).
And why would the template interfere with just one category? All other product categories works just fine.
Quote from: GJC Web Design on November 28, 2021, 21:51:35 PM
QuoteI only see status code 200 (so ok) in that screen. So which JS should be missing to cause this error?
what has 200 got to do with it .. if it isn't called it isn't there -- as one works and the other doesn't there must be some difference somewhere.... logic
have u done this!!!! ->>>>> go thru the inspector network tab for the 2 situations and check all js is loading and in the correct order
compare!
The only difference seems to be update_cart.js to be missing in the empty cart situation. See screenshots.
(https://www.jubalvarsseveld.nl/images/network_cart_empty.png)
(https://www.jubalvarsseveld.nl/images/network_cart_full.png)
So any thoughts on why this script would not be loaded in one particular category?
Thank you for any assistance.
Quoteupdate_cart.js to be missing
so there is your answer ... now u need to trace how that file is called by
your template and why it is not calling it when on a root category
Fyi, I reinstalled vmbeez template from the package on the website, applied it to the category but with no effect (besides of course a totally different layout). So I wonder whether it's really a template issue.
Right now I'm doing a CTRL/F on where this JS-file is called.
And even forcing https://www.jubalvarsseveld.nl/modules/mod_virtuemart_cart/assets/js/update_cart.js to be loaded on every page does not work
Reinstalling VM does not solve the issue
Reinstalling templat manage Gantry neither
Any suggestions are welcome
I wouldn't compare the cart pages .. I would compare the product pages that aren't adding to the product pages that are