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)
-   -   Redirect customer to cart question (https://forum.x-cart.com/showthread.php?t=18276)

Light Speed 11-29-2005 05:47 PM

Quote:

Originally Posted by Jon
No prob of course :D

If you append &addedtocart=1 to the redirect in cart.php you can use this code in your product.tpl

{if $smarty.get.addedtocart eq "1"}
Show Message
{/if}


Thanks! :D

Light Speed 11-29-2005 07:37 PM

It works! :)

Here is the code:
in cart.php
Code:

Change this in the redirect section:

                if(!empty($HTTP_REFERER)) {
                        func_header_location($HTTP_REFERER);


to this:
                if(!empty($HTTP_REFERER)) {
        func_header_location($HTTP_REFERER.'$page&addedtocart=1');


In customer/product.tpl
I added this code from Jon after the add to cart button code:
Code:

{if $smarty.get.addedtocart eq "1"}
Product has been added to cart
{/if}


I just use text but it could have been a language var like
Code:

{if $smarty.get.addedtocart eq "1"}
{$lng.txt_product_added_announ}
{/if}

and added that var in the language area of the cart admin.


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

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