Announcement

Collapse
No announcement yet.

Add to Cart on Homepage Bestsellers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Add to Cart on Homepage Bestsellers

    Hi all..

    Has anyone managed to add an add to cart button for each product on a best sellers, or new products list?

    The only way I can see to do it is try and adapt the 'add to cart from anywhere' style link. Not sure you can get the sectionId of the product at that level though.

    Any ideas?

    Thanks,

    Steve

    #2
    Hi,

    See this thread
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      Thanks Tracy,

      For anyone else, that thread just says it isn't possible unless you hard code the products. I have got halfway there.

      Add a custom product variable ProdSectionId. Manually set this to the SectionId of the section in which the product can be found, for each product in the best sellers list (you can find this by adding sectionID to your section template where noone will notice it). Then use this code in your mini best seller layout.

      Code:
      <actinic:block if="%3cactinic%3avariable%20name%3d%22ProdSectionId%22%20%2f%3e%20%21%3d%20%22%22">
         <a href="http://www.yoururl.com/cgi-bin/ca000001.pl?SID=<actinic:variable name="ProdSectionId" />&PAGE=PRODUCT&Q_<actinic:variable name="ProductReference" />=1" title="Add <actinic:variable name="ProductName" /> to Cart"><img src="add_cart_button.gif" alt="Add <actinic:variable name="ProductName" /> to Cart" border="0" style="margin-top:4px;">
      </actinic:block>
      Only just tried this and it works well, adding 1 of the product to the cart. If you forget to set the ProdSectionId, the add to cart button will not show. Really good to have customers buy immediately as they enter the site. If anyone can think of a better way to get the SectionId of a product, this solution would be perfect!

      Thanks,

      Steve

      Comment


        #4
        Steve,

        I dont see and easier way, the SID value for a product should be visible once you have a look at the source code of a page, perhaps you could just enter the SID value into the URL instead of having to rely on the variable bringing it in.

        Kind regards,
        Bruce King
        SellerDeck

        Comment

        Working...
        X