X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add to Cart button - ajax refresh to Checkout button (https://forum.x-cart.com/showthread.php?t=58655)

ScrapOrchard 03-28-2011 12:37 PM

Add to Cart button - ajax refresh to Checkout button
 
Okay, so I have kind of figured out how to get the Checkout button to appear after the ajax refresh when a customer clicks on Add to Cart. What I don't like is how the Add to Cart button appears for a couple seconds after the "Added" message disappears. Is there anyway to make the transition to be smoother?

Add to Cart button --> Added --> Checkout button instead of Add to Cart button --> Added --> Add to Cart button --> Checkout button?

Example product:
http://scraporchard.com/market2/product.php?productid=17534



Also, all of our products are digital and in theory should only ever be able to be added to the cart once. I have noticed tho, if I add a new product to the store and don't immediately assign a download to it, the cart will allow multiple clicks on "Add to Cart" even after I have added a download. However, if I add a new product and immediately attach a download to it, the cart will not allow multiple clicks on the "Add to Cart" button (which is actually what I would prefer). Is this just one of those buggy things or?

I would like to change the error message from Error to "Item Already in Cart" or "Already Added", but the message is too long and I cannot figure out how to change the width of the Add to Cart button to accommodate the longer message... any ideas?

ScrapOrchard 03-29-2011 01:04 PM

Re: Add to Cart button - ajax refresh to Checkout button
 
Can anyone point me in the direction of where there might be information on the buttons and how they work, how to change/style them?

ScrapOrchard 04-06-2011 12:33 PM

Re: Add to Cart button - ajax refresh to Checkout button
 
Anyone? I am assuming there is some sort of delay in the ajax code which probably needs to be tweaked? If this is the case, does anyone know if the delay includes the time during which the Add to Cart button turns into Added or the time after?

ScrapOrchard 04-08-2011 08:47 AM

Re: Add to Cart button - ajax refresh to Checkout button
 
I looked thru all quite a few of the *.js and ajax php/tpl files and I cannot really pin-point a delay or "timer" anywhere... does anyone know where the code for the ajax Add to Cart button on the product details page is located or where I can find what is controlling the length of time between when the button is clicked, the message "Added" appears, and ajax product_details.tpl refresh occurs.... anyone?

ScrapOrchard 04-27-2011 09:13 PM

Re: Add to Cart button - ajax refresh to Checkout button
 
So anyone have any idea where the delay for the ajax refresh on the product pages/add to cart button is controlled?

cflsystems 04-28-2011 03:08 AM

Re: Add to Cart button - ajax refresh to Checkout button
 
That would be /skin1/customer/ajax.add2cart.js for 4.3.x, try the "timeout" setting

ScrapOrchard 04-28-2011 10:13 AM

Re: Add to Cart button - ajax refresh to Checkout button
 
Thanks, Steve, Again, you rock!

bobschwab 07-21-2011 01:03 PM

Re: Add to Cart button - ajax refresh to Checkout button
 
I am new to X-Cart and learning my way around, would you be willing to share your adjustments to the "Add To Cart" button that switches to a "Go To Checkout" button? I really like what you have done on your website with that button. Thanks!

ScrapOrchard 09-07-2011 02:34 AM

Re: Add to Cart button - ajax refresh to Checkout button
 
Quote:

Originally Posted by bobschwab
I am new to X-Cart and learning my way around, would you be willing to share your adjustments to the "Add To Cart" button that switches to a "Go To Checkout" button? I really like what you have done on your website with that button. Thanks!


Sorry for the delay in my response! I actually made a second /skin1/customer/main/product_details.tpl (I believe that is the correct template name) and called it product_details_re.tpl.

In the product_details_re.tpl file, I changed the Add to Cart button to a Checkout button (that I grabbed from the cart.tpl).

Then in the include directory, look for func.ajax.php, open it and do a search for product_details.tpl and change that to whatever you named your second/duplicate product_details template.

There are a couple things, though, for instance, we have AlteredCart's Download Expander installed, and it displays some download information for the product.. on our product_details_re.tpl, the download information was not displaying after the refresh... so we had to contact support and get assistance with that. I don't know exactly the terminology or process, but if you have a mod 'running' in the product_details.tpl, you have to call those files/scripts within the func.ajax.php file.

I am positive, there is probably a much more eloquent, less 'clunky' way to do it.. but, I haven't quite found/figured out what it is!

totaltec 09-21-2011 02:05 PM

Re: Add to Cart button - ajax refresh to Checkout button
 
Quote:

Originally Posted by ScrapOrchard
I don't know exactly the terminology or process, but if you have a mod 'running' in the product_details.tpl, you have to call those files/scripts within the func.ajax.php file.

Aaah, one can often find treasures in the smallest place on this forum! This little comment saved me hours, thanks!


All times are GMT -8. The time now is 03:31 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.