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

Reply To: Problems adding "Add to Cart" on index.php using Custom Fields

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Problems adding "Add to Cart" on index.php using Custom Fields › Reply To: Problems adding "Add to Cart" on index.php using Custom Fields

January 12, 2010 at 12:45 am #17167
amin007
Participant

@bballa, The PHP code you have cooked up is no good. Please note that this is no way possible for us to teach you PHP programming language here. You should maybe look at the official site for PHP and see if they have any forum for this.

with that said, here is the method signature of the function that you are trying to call:

function get_button_code_for_product($id)

the “get_button_code_for_product” method takes one parameter and that is the ID of the product that you are trying to show the button for. So all you need to do is pull the product ID from the custom field and pass it to this function. You can try something like the following:

<?php
$values = get_post_custom_values('prodid');
echo get_button_code_for_product($values[0]);
?>

Just a note… the above code hasn’t been tested.

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