The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 01-10-2013, 11:38 PM
BunnaCafe's Avatar
BunnaCafe is offline
 
Join Date: Jan 2013
Posts: 2
Default

Problem with AddtoBag widget not loading on ajax/jquery page load


Hi, I am having a problem with the Add to Bag button functionality that will end up determining whether or not I use Ecwid for my client's 1000-product ecommerce site.

This is similar to the problem listed in the thread: http://www.ecwid.com/forums/showthread.php?t=4249

I have a standalone site that functions on jquery/ajax load calls into a featured content div. I am using ecwid to provide cart and checkout functionality only. I need only the "Add to Bag" and "Minicart" widgets to connect my site with the Ecwid site.

Working site is http://theredseapress.net/awpnet. It is operating on a Joomla 2.5 platform with a custom-made product database.

I initiated your ecwid script on load of the index page which activates the Minicart widget on the top header as well.

However, the individual product pages load up through a jquery load call. This presents a problem because the Add to Bag (xAddToBag('productid=18870685')) widget is on the product page and is loaded after the widget script has already been initialized. So when I load the page it gets confused and returns a blank codeless page -- based on the previous thread because it is making a call but not receiving a response.

If you click on any of the books on the home page you can replicate the issue.

I can think of two ways of getting past this:
1) Call a specific function to load just the Add to Bag widget, which would be executed upon jquery load of the product page, or;
2) if there is a basic html link I can create to add the product ID to the cart through an anchor, that would be the easiest solution. (ie. 'ecwid.site.com/addtocart.php?productid=18870685');

I really want to use your cart -- it's well-designed, efficient, and you seem to have pretty darn good support -- but this has to work with my layout or else it's a dead end. I would appreciate any guidance or suggestions.

Cheers,

Sam
  #2  
Old 01-15-2013, 07:02 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Sam Saverance View Post
Hi, I am having a problem with the Add to Bag button functionality that will end up determining whether or not I use Ecwid for my client's 1000-product ecommerce site.

This is similar to the problem listed in the thread: http://www.ecwid.com/forums/showthread.php?t=4249

I have a standalone site that functions on jquery/ajax load calls into a featured content div. I am using ecwid to provide cart and checkout functionality only. I need only the "Add to Bag" and "Minicart" widgets to connect my site with the Ecwid site.

Working site is http://theredseapress.net/awpnet. It is operating on a Joomla 2.5 platform with a custom-made product database.

I initiated your ecwid script on load of the index page which activates the Minicart widget on the top header as well.

However, the individual product pages load up through a jquery load call. This presents a problem because the Add to Bag (xAddToBag('productid=18870685')) widget is on the product page and is loaded after the widget script has already been initialized. So when I load the page it gets confused and returns a blank codeless page -- based on the previous thread because it is making a call but not receiving a response.

If you click on any of the books on the home page you can replicate the issue.

I can think of two ways of getting past this:
1) Call a specific function to load just the Add to Bag widget, which would be executed upon jquery load of the product page, or;
2) if there is a basic html link I can create to add the product ID to the cart through an anchor, that would be the easiest solution. (ie. 'ecwid.site.com/addtocart.php?productid=18870685');

I really want to use your cart -- it's well-designed, efficient, and you seem to have pretty darn good support -- but this has to work with my layout or else it's a dead end. I would appreciate any guidance or suggestions.

Cheers,

Sam
Hi Sam,

Sorry for the delay.

I'd like to inspect your site and examine the theme and AJAX loader you're using. But the site seems to be down: http://theredseapress.net/awpnet . Can you please have a look?
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #3  
Old 01-15-2013, 07:16 PM
BunnaCafe's Avatar
BunnaCafe BunnaCafe is offline
 
Join Date: Jan 2013
Posts: 2
Default

Sorry! Wrong url. This one should work: http://theredseapress.com/awpnet/
  #4  
Old 01-16-2013, 01:48 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Sam Saverance View Post
Sorry! Wrong url. This one should work: http://theredseapress.com/awpnet/
Thanks. I'll look into it.

UPDATE:
Sam,

I've inspected your site.

As you pointed out, Add to bag widget failed to load because it is expected to be displayed when the page loading finishes. In your case, its code executes properly but the final widgets initialization handler is not called. It is indeed caused by the way how the site pages load (AJAX).

You can overcome the issue by re-launching the widget initialization codes every time the AJAX loader on your site completes its work. For the details of such an approach, you will need to study the Ecwid Add to bag widget code (you can inspect it using your browser's developer tools) and perform additional calls to it in your scripts. Unfortunately, we don't have any ready codes/samples for such a modification, sorry.

The simplest solution would be to avoid using of a custom AJAX page loader, at least on the store pages. For example, you can consider placing Ecwid product browser widget on a separate static page on your site. Since Ecwid itself is an AJAX application, it would work very fast for your customers - they will be able to browse your store products without page reloading and to use built-in features of Ecwid product browser (e.g. next/previous buttons, sale prices, bulk discount pricing, social share buttons etc.).


Quote:
2) if there is a basic html link I can create to add the product ID to the cart through an anchor, that would be the easiest solution. (ie. 'ecwid.site.com/addtocart.php?productid=18870685');
Please refer to this post:
http://www.ecwid.com/forums/showthre...4327#post74327
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
add to bag, ajax, jquery, load, widget

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:17 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.