Community Forums 

Main Content

Add to basket

    Sep 16 2008 14:43:40

    #1

    Tracey

    Join date : 2008-09-18      Posts : 16

    Hi,
    I posted this in another topic but this was slightly off the main subject, so have started a new topic.
    I would like my customers to be able to add items to their



    Sep 16 2008 15:03:03

    #2

    Neil

    Join date :      Posts : 0

    Edited: The forum cut off your post. Can you try again. Unfortunately it does that with this new format sometimes.



    Sep 16 2008 16:12:27

    #3

    Tracey

    Join date : 2008-09-18      Posts : 16

    The code I've used to allow customers to add items to their basket without going to the cart is below. However when pressed, although it does add the item to the cart and stays on my site, the 'add to basket' button disappears. Obviously I don't want this to happen. Any ideas?
    Thanks.
    Code:
    <input type="hidden" name="product1" value="1011M Knee Wrap Medium">
    Medium:&nbsp; <input type="hidden" name="price1" value="41.70">
    <input type="text" name="qty1" size="3">
    &nbsp;
    <input type="hidden" name="product2" value="1011L Knee Wrap Large">
    Large:&nbsp; <input type="hidden" name="price2" value="41.70">
    <input type="text" name="qty2" size="3">
    <input name="nocart" type="submit" value="Add to Basket">
    &nbsp;&nbsp;
    <input name="submit2" type="submit" value="Buy Now">



    Sep 16 2008 16:17:24

    #4

    GT

    Join date : 2008-09-18      Posts : 3212

    Tracey said: The code I've used to allow customers to add items to their basket without going to the cart is below. However when pressed, although it does add the item to the cart and stays on my site, the 'add to basket' button disappears. Obviously I don't want this to happen. Any ideas?
    Thanks.
    Code:
    <input type="hidden" name="product1" value="1011M Knee Wrap Medium">
    Medium:  <input type="hidden" name="price1" value="41.70">
    <input type="text" name="qty1" size="3">
     
    <input type="hidden" name="product2" value="1011L Knee Wrap Large">
    Large:  <input type="hidden" name="price2" value="41.70">
    <input type="text" name="qty2" size="3">
    <input name="nocart" type="submit" value="Add to Basket">
      
    <input name="submit2" type="submit" value="Buy Now">


    I've not tried doing it that way Tracey, I know this way works:

    <p>The pop up is controlled by the button.</p>
    <form action="http://ww9.aitsafe.com/cf/add.cfm"; method="post">
    <input type="hidden" name="userid" value="B5124789">
    <input type="hidden" name="nocart">
    <input type="hidden" name="return" value="www.tne.co.uk/2006/mals/send-to-cart.html">;

    <input type="text" name="qty">&nbsp;Peach 1/2 Gal $4.95
    <input type="hidden" name="product" value="Peach Cider 1/2 Gal">
    <input type="hidden" name="price" value="4.95">
    <input type="submit" name="Submit" value="Add to order" onclick="alert('Order has been added to your cart\n\nThis page will refresh');" />
    </form>

    <p>To use a link/button rather than a form, you could use:</p>

    <p><a href="http://ww9.aitsafe.com/cf/add.cfm?userid=B5124789&amp;product=Peach+Cider+1/2+Gal&amp;qty=1&amp;nocart=1&amp;price=4.95&amp;return=www.tne.co.uk/2006/mals/send-to-cart.html&amp;qty=1"; onclick="alert('Order has been added to your cart\n\nThis page will refresh');">Add to order</a></p>

    <p><a href="http://ww9.aitsafe.com/cf/review.cfm?userid=B5124789">View your cart/checkout</a></p>

    hih.

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Sep 16 2008 16:42:02

    #5

    Tracey

    Join date : 2008-09-18      Posts : 16

    Hi,
    Thanks for your suggestion. Just tried your code and it did the same thing - disappeared. I then uploaded my page to my site and both ways worked! The problem seems to have been because I was testing locally I think??