X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Continue Shopping (https://forum.x-cart.com/showthread.php?t=873)

burtsTechie 01-12-2007 01:54 PM

Re: Continue Shopping
 
I'm FUBARing my site every time I try to get this config.php file to accept this code. I've had comments from test users that returning to the cart/home page is frustrating, and frustrating = no sales.

I've done some searching and discovered that $HTTP_GET_VARS has been deprecated for $_GET...so I've replaced that in the following code:

Code:

<?php

x_session_register("last_cat");
x_session_register("last_productid");

if($_GET["cat"] != "")
{
  $last_cat = $cat];
}

if($_GET["productid"] != "")
{   
  $last_productid = $productid;
}

$smarty->assign("last_productid", $last_productid);
$smarty->assign("last_cat", $last_cat);

?>


And it still gives me the blank page of death. :(

Is there some kind of compiling going on or am I placing this in the wrong section of config.php? Help, please!

ps - replying to myself is sad. really sad.

vaughan 01-24-2007 06:21 AM

Re: Continue Shopping
 
using xgards code I was getting the same result when I added the code to config.php

Working on a new 4.1.5 site and found that if put the code into init.php instead all was well (at least so far).

burtsTechie 01-31-2007 07:14 AM

Re: Continue Shopping
 
thanks vaughan! I finally had a chance to implement your suggestion and it seems to be working on 4.15. I appreciate the help!

Sisom 02-03-2007 02:28 PM

Re: Continue Shopping
 
Quote:

Originally Posted by mikalou
The ⌠continue shopping■ button will only appear when a product was just added to the cart. So for instance, if you click on the ⌠View Cart■ link in the minicart from the home page, then the ⌠continue shopping■ button won▓t appear.


I don't understand why you wouldn't want to have the "continue shopping" button appearing in that case - as the customer would want to see it (at least, I would). I don't see why they wouldn't want to be able to continue shopping just because they got to the cart page from the home page, using the 'View cart' link in minicart.

While we're on the subject of the 'continue shopping' button, has anybody else found Amazon's shopping cart to be a nightmare? Say I add one item to the cart and then click on the 'Checkout' button - the next page gives you no option other than to continue with the Checkout process, you can't add any other items to the cart without having to use the back button, there isn't even a link to the Amazon home page or any other Amazon pages on their Checkout page! (At least, this is what's been happening to me).

kmg126 02-04-2007 10:51 AM

Re: Continue Shopping
 
Quote:

Originally Posted by GM
TRY THIS...

1:) Create a new button file in /buttons called

continue_shopping.tpl that contains the following code:

Code:

{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shop}

2:) In Admin go to "languages" edit languages and create a new

entry called "lbl_continue_shop" (without the quotes)

Now in cart.tpl or where ever you want the button to appear just add this

code:


DONE!

I've tried to do several of the "Continue Shopping" fixes in this thread and none are really working for me. The one that works best is the one above. Creates a great Continue Shopping button, I've placed it exactly where I want it on the Checkout page, but when clicked, I'm redirected exactly back to the same Checkout page.
Can anyone tell me where the problem lies in the code? I'd like it to redirect back to the category or the home page would be fine too.
Thanks,
Karen

Sisom 02-04-2007 12:44 PM

Re: Continue Shopping
 
All I can offer is the code that I have in my cart.tpl, bear in mind I have 4.1, but I don't think it should make any difference.

<td>
{include file="buttons/button.tpl" button_title=$lng.lbl_continue_shopping href="javascript: history.go(-1);" style="button" js_to_href="Y"}</td>

kmg126 02-04-2007 06:44 PM

Re: Continue Shopping
 
Thanks, that worked great!
Karen

grayloon 03-01-2007 11:07 AM

Re: Continue Shopping
 
I'm using the code below, but I'm having one little problem - the cart page always takes me back to the category and never to the product detail page. I replaced $HTTP_GET_VARS with $_GET and put that part in the init.php instead of config.php. Any ideas?

Quote:

Originally Posted by xgarb
Going from inthepink's code I did this...

create a tpl. file in buttons called continue_shopping.tpl

add the following code to it...

Code:

{* source: http://forum.x-cart.com/viewtopic.php?t=1124 *}
{if $goto eq "product" and $last_productid neq ""}
{assign var="href" value="`$WebDir`product.php?productid=`$last_productid`"}
{elseif $last_cat neq ""}
{assign var="href" value="`$WebDir`home.php?cat=`$last_cat`"}
{else}
{assign var="href" value="`$http_location`"}
{/if}

{include file="buttons/button.tpl"
button_title="Continue Shopping" style="button" href="$href"}


add to config.php....

Code:

x_session_register("last_cat");
x_session_register("last_productid");

if($HTTP_GET_VARS['cat'] != "")
{
  $last_cat = $cat;
}

if($HTTP_GET_VARS['productid'] != "")
{   
  $last_productid = $productid;
}

$smarty->assign("last_productid", $last_productid);
$smarty->assign("last_cat", $last_cat);


You can then use....

Code:

{include file="buttons/continue_shopping.tpl"}

whereever you like to give you a continue shopping button. I've got it next to the checkout button and also below 'Your shopping cart is empty'

sweet!


supercanon 03-14-2007 12:21 PM

Re: Continue Shopping
 
Quote:

Originally Posted by vaughan
using xgards code I was getting the same result when I added the code to config.php

Working on a new 4.1.5 site and found that if put the code into init.php instead all was well (at least so far).




Hello, I tried adding the code to boh config.php and init.php and I got a blank page.

finally, I added the code to /include/sessions.php and it worked !

I am using version 4.1.6

This is a great modification, thank you


All times are GMT -8. The time now is 10:50 PM.

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