Jump to content

Slow add to cart function


Recommended Posts

Since the add to cart function takes 15 seconds, I would like to show a message when add to cart is clicked.The message would say "Please wait while your product is being adding to cart. Product shipping information is being gathered from usps.com, ups.com, and fedex.com." Does anyone know how I could add a message that would show when the add to cart button is clicked?

Link to comment
Share on other sites

15 seconds is definitely not default behaviour...

check this: add to cart notification bar you can use this guide

 

the only one thing you have to change, in guide i suggested to use code in

success: function(jsonData,textStatus,jqXHR)
        {

but you have to use it right after 

add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){

then notification will appear right after you press on "add to cart" button

  • Like 2
Link to comment
Share on other sites

I made the changes.

I cleared the cache in the back office of Prestashop.

I cleared the cache on my browser.

Yet when I add an item to the cart, the confirmation does not display.

Am I missing a step?

 

Here's my code changes:

 

/public_html/themes/PRS030057/header.tpl

                                <script type="text/javascript">

                                                var baseDir = '{$content_dir|addslashes}';

                                                var baseUri = '{$base_uri|addslashes}';

                                                var static_token = '{$static_token|addslashes}';

                                                var token = '{$token|addslashes}';

                                                var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};

                                                var priceDisplayMethod = {$priceDisplay};

                                                var roundMode = {$roundMode};

                                                var addtocartconfirmation = '{l s='Product successfully added to cart'}';

                                </script>

 

/public_html/modules/blockcart/ajax-cart.js

 

                // add a product in the cart via ajax

                add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){

                                $("body").append("<div class='addtocartconfirmation'><span>"+addtocartconfirmation+"</span></div>");             

                                $(".addtocartconfirmation").fadeOut(8000);

                               

                                if (addedFromProductPage && !checkCustomizations())

                                {

                                                alert(fieldRequired);

                                                return ;

                                }

                                emptyCustomizations();

 

 

/public_html/themes/PRS030057/css/global.css

 

 

.addtocartconfirmation {

    background: #D34F2B;

    display:block;

    position:fixed;

    bottom:0px;

    left:0px;

    text-align:center;

    padding:10px 0px;

    width:100%;

    z-index:99999;

    

}

 

.addtocartconfirmation span {

    color:#fff;

    text-shadow:1px 1px 0px #000;

    font-size:18px;

    font-weight:bold;

}

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...

nevermind. it was because i had too many shipping options configured. disabled few of them now it is fast again.

 

can i verify your website? if so- please share url -  i will inspect it.

having same problem, i would like to inform customer while the add to cart take time to add !! or any solution to make the add to cart work quick/load quick.. thanks

Link to comment
Share on other sites

  • 1 month later...

15 seconds is definitely not default behaviour...

check this: add to cart notification bar you can use this guide

 

the only one thing you have to change, in guide i suggested to use code in

success: function(jsonData,textStatus,jqXHR)
        {

but you have to use it right after 

add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){

then notification will appear right after you press on "add to cart" button

 

 

Add to cart product take 10-15 seconds.

which is bad. Any have idea about that issue.?

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...