gecko123
Expert
Friendly Neighbour
Member Likes (0)
How do i disable ajax on market press?? I would like to disable
http://domain.com/wp-content/plugins/marketpress/marketpress-includes/js/ajax-cart.js?ver=2.5.9
Also how do i marketpress scripts in footer? I tried to learn a bit about wp enqueue script, is there any other option?

Responses (15)
Inactive (joined February 2012) Likes (0)
Hey Sachin,
Let me hook you up with the developer. He should be able to sort this out for you.
Hang on.
Member (joined January 2012) Likes (0)
Any news on this?
Support Hamster (joined March 2012) Likes (0)
Have you seen this?
http://codex.wordpress.org/Function_Reference/wp_deregister_script
Support Hamster (joined March 2012) Likes (0)
I think I found it...
You can try adding to your theme's functions.php file this line:
wp_dequeue_script( 'mp-ajax-js' );Member (joined January 2012) Likes (0)
I'll get back to on this.
Member (joined January 2012) Likes (0)
It Work It works!! Thank you ..
Inactive (joined February 2012) Likes (0)
Hey guys,
Sorry for the delay from our side and thanks for the awesome support @aristath . Devs were on a 48 hour stretch to release a lot of updates (as you can see, we have lots of updates coming out now).
If what @aristath suggested doesn't fix it, just let me know. Thanks!
Member (joined January 2012) Likes (0)
@Arun Basil Lal It solves one part of the equation, of moving it to footer.
@aristath Sorry, i was all excited for no reason. Somehow it doesn't seem to work. Yslow picks it up in the head.
Support Hamster (joined March 2012) Likes (0)
@sachingopalakrishnan well, you can always hack it out of MarketPress....
Both the solutions I'm offering below don't have a negative impact, they're plain simple and dirty.
Solution 1: Just comment out line 620 of marketpress.php file
wp_enqueue_script( 'mp-ajax-js', $this->plugin_url . 'js/ajax-cart.js', array('jquery'), $this->version );Solution 2: Simple and quite dirty.... open up the file js/ajax-cart.js and delete it's contents.
It can't get any simpler than that... :)
I can't stress enough how "dirty" both of them are... and I know it's almost ill-advising you, but it works.
Developer (joined January 2012) Likes (0)
@sachingopalakrishnan, I'm looking into both issues. Hope to have a reply back later today. Thanks.
Developer (joined January 2012) Likes (0)
@sachingopalakrishnan, so looking at this. Yeah, obviously there is no way to handle this via the admin. And deregistering then reregistering scripts will work but not the ideal solution. I'm of the opinion this should be a UI option under Store Settings > Presentation tab.
@aristath, thanks as always for being on the list and helping other members out. You seem to be very prolific in most things MarketPress. I saw your previous posts about MarketPress on the front-end. Have not had a chance to digest all of the thread but excellent work there.
Developer (joined January 2012) Likes (0)
@sachingopalakrishnan, Try adding the following to your theme functions.php file.
https://gist.github.com/3013475
Let me know. Note, I've note fully tested this on all MP pages. I've checked the main Products page, single product and the shopping cart. Have not tested the checkout process. But my assumption is it should load the same on all pages.
Member (joined January 2012) Likes (0)
I will get back to you on this.
I was looking not just for MP but also other js scripts.
Developer (joined January 2012) Likes (0)
@sachingopalakrishnan, as they say, "It depends...". There is not some universal way to force all JS to the footer. Using my code as a model you would need to deregister the queued script then reregister it setting the footer flag.
Member (joined January 2012) Likes (0)
Ok there are some problems i have faced. Some scripts have to be put into the header. No go there.
No significant difference with/without AJAX. I realised quite noobily that most people do enable javascript in this day and age, and the load time difference is minimal for most people to notice.
So much for effort. Thanks anyway, it was like an aha moment.
Become a member