Results 1 to 2 of 2

Thread: PHP and Ajax Add To Cart button not appearing on product detail page

  1. #1

    Default PHP and Ajax Add To Cart button not appearing on product detail page [SOLVED]

    I am a novice but learning. I am using the secure site component to secure different pricing levels for wholesalers. I enabled ajax so I can see the list pages of products listed in mysql database. Clicking on the link to the detail page, it shows the details of the item, but you see on the page below the picture <input type="hidden" name="item_number" value=" and that is it, no button or anything else. I know it has to do with the data source that was inserted into the Layout Region HTML. It works on a non secure site, but with a secure site I have to enable ajax to see the items from my database. I am insterting the standard paypal button form tag in the bottom of the Layout Region HTML. Again I have done this on my main site and it works great. Any help you can provide I would be greatful. Below is the tag that I am using:

    <form name="_xclick" target="paypal" action="https://www.paypal.com" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="mybusiness@business.net">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="item_number" value="$DATASOURCE(10962,Products.ProductID)">
    <input type="hidden" name="item_name" value="$DATASOURCE(10962,Products.ProductName)">
    <input type="hidden" name="amount" value="$DATASOURCE(10962,Products.PriceYellow)">
    <input type="image" src="../../../images/addToCartButton.gif" border="0" name="submit">
    <input type="hidden" name="add" value="1">
    </form>
    Last edited by automaster209ca; 03-08-2011 at 04:36 PM. Reason: solved the issue

  2. #2

    Default No replies, so I found the problem

    I guess the more I kept working on it, eventually I would find the problem. I have recordsets set to a layout where it list 15 items at a time from my database for sale. When you click on the image, it links to a detail page where the item can be purchased. I incorporated this into a secure site using the Secure Site coponent in Fusion. With the Secure Site added I had to enable ajax for the layouts that show the list of items and to provide navitation and to allow for loging in and out of this wholesaler site. On the detail page the error was occurring as I stated in my first post.

    The resolution:

    What I found is that I can't enable Ajax or any of the Secure site component items on the Detail Page. If I add a secure site component item such as a log out or secure page item without Ajax, the page doesn't show, all you get is a white page.

    If you enable Ajax, then the page shows, but my description field disappears and the Add To Cart form elements become corrupt and you see the following text under the item detail information <input type="hidden" name="item_number" value=" showing up as text and the button image doesn't show.

    Because the detail page isn't populated unless you click on an image in the secure site, then I don't see any reason to add any of the secure site items on the Detail Page. I removed the Secure site components from the page then disabled Ajax on that page.

    Result:
    Page works awesome with my add to cart button and I have my secure site where I can have different levels of pricing depending on the wholesaler and their particular purchasing level using PHP, Mysql and NOF Secure component.

    I would like to thank everyone on here who has viewed some of my posts and have replied giving me some great help. The more I learn about Fusion 12 the more I like it. Again, thank you all.

Tags for this Thread

Posting Permissions

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