Problems, need help? Have a tip or advice? Post it here.
15 posts Page 1 of 2
Greetings!

I am doing the CouchCart. Everything is working fine except for the cart-modal.

I am facing the same problem as defined in: http://www.couchcms.com/forum/viewtopic.php?f=4&t=8626
Where the value of
Code: Select all
var cart_link = "<cms:link "<cms:pp_config 'tpl_ajax_cart' />" />";

comes up empty.

What can be done for this?
Image
where innovation meets technology
Hi,

The solution was given in the post you mentioned -

Please make sure the template-name provide on the following setting in 'addons/cart/config,php' is correct
Code: Select all
$pp['tpl_ajax_cart'] = 'cart-modal.php';

Have you double-checked that?
@KK Sir,

I have done that. I am attaching a screenshot here!

2.png
2.png (175.93 KiB) Viewed 3153 times


Also, i have put the following code in my product.php (index.php, in the example explained) at the bottom of the page:

1.png
1.png (181.09 KiB) Viewed 3153 times
Image
where innovation meets technology
You should use double-quotes for nested Couch tags, Aashish, as shown below -
Code: Select all
var cart_link = '<cms:link "<cms:pp_config 'tpl_ajax_cart' />" />';

In the code above the nested cms:pp_config is surrounded by double-quotes. Your code is using single-quotes which will not result in cms:config to execute.

Please see http://www.couchcms.com/docs/concepts/s ... eters.html if you are not clear on the use of single v/s double quotes.

Hope this helps.
Sir I did it the way you told and have also gone through the documentation now i have a clear idea of how and when to use the single and double quotes.

But it still ain't working. Thought the string missing is now being outputted.

Also, the first time that it didnt work, was coz the ajax-loading image was missing from the images folder, i copied the image to the path required along with the changes you told me and I got the output of the string.

Is it that unless the site goes live the AJAX wont execute? Coz, now almost everything is working.
Image
where innovation meets technology
Is it that unless the site goes live the AJAX wont execute?

The AJAX part works fine even on localhosts.

If now the link is being outputted correctly, perhaps it is come JS error that is messing up the AJAX call? Do you see any errors being reported in the browser's dev console?

Can you access the cart_modal template by directly keying its link (the one we got above) into the browser's address bar?

Anyway, if everything else is working ok, I'd suggest you move the site online. We'll debug the issue more easily when the site is accessible.
Sir I have pm'ed you the details!!! Please can you check and let me know
Image
where innovation meets technology
I had a look and, as suspected, your product.php is throwing a JS error (unrelated to CouchCart).
You are defining a JS function at line 19
Code: Select all
<script>
    $(function() {
        var pull       = $('#pull');
        ..
        ..

- where you are using '$' which is not defined at that point since you are including jQuery at the bottom of the page.
- where you are using '$' which is not defined at that point since you are including jQuery at the bottom of the page.


Sir even if i include the js above the ajax call still isn't working.

Whereas if the js is at the end, still the menu (of the site) is working... also i can not have two scripts of different types, they will give error by conflicting...

what can be done. on my local machine i have tried shifting the script above the line u mentioned but still cart-modal.php doesn't go to work... and is still accessible by url...

what can be done???
Image
where innovation meets technology
That my friend, in all fairness, is totally a front-end issue.
I am sorry but I don't think I'm not the right person to help you with JavaScript as my knowledge about is rather rudimentary, I'm afraid.
15 posts Page 1 of 2