Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Displaying 'Add to Cart' button on product list page

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Displaying 'Add to Cart' button on product list page

Tagged: add to cart button

  • This topic has 3 replies, 2 voices, and was last updated 13 years, 8 months ago by admin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 30, 2011 at 4:55 pm #4188
    dangermoose
    Spectator

    Hi there,

    You helped me out before with a similar problem I was having and for some reason even though I’ve set this site up in the same way, I can’t get the add the cart buttons to display on the page that lists all products. (It displays fine in the individual product page)

    Currently getting the error ‘Looks like you have entered a product ID () in the shortcode that doesn’t exist. Please check your product ID and the shortcode again!’

    The code in my template:

    <div id="productId">
    <p>
    <?php
    $values = get_post_custom_values('product_id');
    echo get_button_code_for_product($values[0]);
    ?>
    </p>
    </div>

    The shortcode in the page:

    [wp_eStore:product_id:1:end]

    I might be missing something obvious!

    August 31, 2011 at 1:30 am #36010
    admin
    Keymaster

    Well it’s simple, when you call this function you need to make sure you are providing a valid Product ID:

    get_button_code_for_product

    On this page (where you are having the issue)… the custom field value is wrong (it needs to be a valid product ID. WP eStore can’t display a button for a product if it doesn’t know which product to look for.

    September 14, 2011 at 1:55 pm #36011
    dangermoose
    Spectator

    Hi there,

    I’ve checked the custom field value & it’s definately correct, but still no luck. I’ve only got one product for testing at the minute so the value is simply ‘1’.

    I think it might have something to do with the fact that the shortcodes are placed in pages and not posts – do you think this is possible and might cause issues.

    get_post_custom_values

    I’m guesssing this is designed to pull values from posts – not pages?

    Thanks in advance!

    d.

    September 14, 2011 at 11:34 pm #36012
    admin
    Keymaster

    There is an easy way to test it out. Simply echo the value of the customer field that your are retrieving by doing the following:

    <?php
    $values = get_post_custom_values('product_id');
    echo "Custom field value: ".$values[0];
    echo get_button_code_for_product($values[0]);
    ?>

    This will tell you if you are really passing “1” to the eStore function or something else. I can guarantee you that eStore is not receiving a plain “1” there.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ