No add to cart in category, but works from both sub-category and productpage

Started by markjansen_nl, November 27, 2021, 20:21:07 PM

Previous topic - Next topic

markjansen_nl

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:

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)


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]

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

markjansen_nl

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?

Jörgen

Maybe your template interferes with routing. try with vmbeez3 template and turn sef.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

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!
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

markjansen_nl

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.

markjansen_nl

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.




So any thoughts on why this script would not be loaded in one particular category?

Thank you for any assistance.

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

markjansen_nl

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.

markjansen_nl

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


GJC Web Design

I wouldn't compare the cart pages .. I would compare the product pages that aren't adding to the product pages that are
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation