I’m sorry to ask this on the "Core Code" section of the forum, but I almost spent 3 full days on a bug to which I cannot find any solution.
It concerns this page:
http://www.altipoint.ch/demo_product
When I’m connected to the MODx manager, the cart works perfectly.
When clicking the "Au panier" button, I get this picture:
http://www.altipoint.ch/preview/copies_ecran_treasurechest/exemple_de_produit.png
When not connnected, the cart does not work at all when clicking the "Au panier" button.
Firebug reports a very strange error:
missing } in XML expression
[Break on this error] <style>TD, BODY { font-size: 11px; font-family:verdana; }</style>\n
The error is detected in treasurechest.js (see code below), but from what I can see it is due to an jQuery Ajax request that fails, most probably the product count after one product was added to the cart.
Are there restrictions in the MODx API when the user is not connected to the manager?
As far as I can see, all PHP files have the correct permissions.
Assuming that a file is in some subfolder, do all folders above it need to have the same permissions (e.g. EXEC)?
The site is running on MODx 0.9.6.2.
Is this a version-specific problem?
On "localhost" the problem does not occur.
Thanks for your help.
The error is dectected at this line of treasurechest.js
function cartCount(){$.ajax({async:false,url:cart_doc,data:{action:'count'},cache:false,success:function(a){cart_count=eval("("+a+")");if(cart_count.length){cart_string='<input type="button" id="cart_view_button" class="thickbox tc_view button large_text marine w85 h40" style="text-align:left" onclick="return false;" /><img alt="Affichage du panier détaillé" src="assets/snippets/treasure_chest/images/cart_icon.gif" style="float:left;position:relative;left:-27px;top:10px;" /><input id="cart_empty_button" type="button" style="text-align:left" /><img alt="Vider le panier" src="assets/snippets/treasure_chest/images/cart_icon.gif" style="float:left;position:relative;left:-27px;top:10px;" />';if(cart_el){$(cart_el).show().html(cart_string);}if(cart_view){if(document.getElementById("cart_view_button")){document.getElementById("cart_view_button").value=cart_view;document.getElementById("cart_view_button").title="cart_view";}}