+ Reply to Thread
Results 1 to 7 of 7

Thread: "ADD to Cart" within thumbnail template

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    39
    Squirrelcart version
    not specified!

    "ADD to Cart" within thumbnail template

    Is it possible to add to cart button in the thumbnail template? This would be easy for our customer who knows exactly what they want to click on to add item instead of clicking on the item for full description and then clicking add to cart.

    thanks,
    david

  2. #2
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,829
    Squirrelcart version
    v3.3.7
    Yes, you can do that. Keep in mind that doing that will not work well for items with product options.

    You just need to put the code for the add to cart button in the product_thumbnail.tpl.php template file, somewhere inside the FORM tag...you also need to include a quantity field, or a hidden quantity field with quantity set to 1:

    PHP Code:
    <input type="hidden" name="quantity" value="1" />
    <?=$Add_to_Cart?>

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    39
    Squirrelcart version
    not specified!

    not showing in cart

    this what i've added which I copied it from product detail template.

    <?php if ($Maximum_Quantity == 1) { ?>
    <input type="hidden" name="quantity" value="1" />
    <?php } else { ?>
    <b> </b><input type="hidden" name="quantity" size="3" value="<?=$Quantity_Value?>" autocomplete="off" />
    <?php } ?>

    <?=$Add_to_Cart?>

    I see the add to cart button, but the items are not being added to cart. In cart there is nothing.

    Thanks,

    David

  4. #4
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,829
    Squirrelcart version
    v3.3.7
    If you don't have your form method set to "get" it won't work:
    PHP Code:
    <form action="<?=$Form_Action?>" method="post">
    Also, I'd recommend adding this after the <form> tag:
    PHP Code:
    <?=$Show_Cart?>

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    39
    Squirrelcart version
    not specified!

    Awesome

    replaced "post" with "get" and added the other items. it worked like a charm.

    As always, thanks for the great support!

    David

  6. #6
    Squirrelcart Staff Jamie's Avatar
    Join Date
    May 2002
    Posts
    6,829
    Squirrelcart version
    v3.3.7
    You're welcome

  7. #7
    Registered User
    Join Date
    Aug 2007
    Posts
    39
    Squirrelcart version
    not specified!
    By the way, I'm not much of a programmer, but I do work in the computer field. Thanks to your support, I'm starting to understand about PHP and hope to continue my knowledge about PHP.

    David

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts