Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    18
    Member #
    29026
    Liked
    2 times
    Hi there - I'm building a storefront for my website. The only problem is that I need clients to stay on the "products" page throughout most of their shopping process, but the shopping cart software I'm using seems to need to open the "checkout" page everytime someone clicks "add to basket". This is something of a problem - it really is very important that the customers stay on the product page until they're ready to pay, or they won't be able to receive the services I'm providing them with. One remedy I've thought of is to have the "add to cart" link open in a small javascript window that automatically closes itself after being opened. I've found the code to do this, but I'd also like to add a frame to the window - something that says "item added to cart, window automatically closing", or something to that effect, so that customers don't panic when they see a mysterious window open and then close straight away.

    So really I have two questions - 1., How do add this frame?, 2. is this asking for trouble from pop-up blockers?

    Thanks a lot, hope someone can shed some light on this.

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Does that work if someone ( pretty much anyone ) has popup blocker enabled. Reason I asked is that typicIcally, the most shopping cart systems, especially open source need to open the page to insert the purchases into a temp table. If the page won't open , items can't be inserted.

    I'd opt for a meta refesh on the cart page, and bounce them right back to the page they came from with a message saying something like, items added to cart. Then if they push the checkout button, throw a var with the link so you know not to use the meta refresh .

    That's just me though.

  4. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    18
    Member #
    29026
    Liked
    2 times
    Thanks, Webzarus - I was wary of using a pop-up. I've done something similar to what you were saying and added this to the cart page:
    PHP Code:
    <?php
    if(strpos($_SERVER['HTTP_REFERER'],'/services.html')&&$_GET['product_id']){
    header("Location:".$_SERVER['HTTP_REFERER']);
    exit();
    }
    ?>
    The cart software is open source, by the way - it's called OpenCart. I added that piece of PHP to the common headers.tpl file, but for some reason get this error message:
    Notice: Undefined index: product_id in /hermes/web12a/b1229/moo.floathousebookscom/opencart/upload/catalog/view/theme/default/template/common/header.tpl on line 2
    Any idea what I've done wrong?

    Cheers

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    I'm not a php person ( yet ), been developing in asp for years and there are similarities... On my phone right now and can't see the entire string, but suspect it's something with the referr

  6. #5
    Junior Member
    Join Date
    Aug 2011
    Posts
    18
    Member #
    29026
    Liked
    2 times
    Hmmm... well I'm certainly not a PHP person either, and I've tried a few things now and none of them seem to want to work. Could you explain to me how to carry out your original idea? That might have more chance of getting somewhere - for some reason this cart page doesn't want to listen to PHP commands telling it to redirect.

    Thanks

  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I have used OpenCart before and not had this problem. Which version and which template are you using?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  8. #7
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Ok, since I don't know PHP, but it looks like what you're doing is bouncing the user before the cart has a chance to process the request.

    I was speaking of a "META REFRESH"... nothing to do with any scripting... All browsers support them, and by using the meta refresh, the cart has a chance to accept the item that they submitted.

    this would be a standard meta-refresh after 2 seconds:
    [COLOR=rgb(0, 0, 0)]<meta http-equiv="refresh"content="2;url=http://www.yoursite.com/newpage.htm?" />[/COLOR]
    in ASP ( what I know ) it would be like:
    [COLOR=rgb(0, 0, 0)]<meta http-equiv="refresh"content="2;url=<%=Request.Servervar iables("http_referrer")%>" />[/COLOR]
    Again I would append the string above ( just me ) with a var like: ?cart=yes

    or the easier solution might be ( I've seen it on numerous sites )... a "Continue shopping" button on the cart page....

    simple button:

    HTML Code:
    <button type="button" value="Continue" onclick="javascript:history.back()">Continue Shopping</button>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:30 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com