WordPress.org

Ready to get started?Download WordPress

Forums

PHP issue in template with wp e-commerce (1 post)

  1. Jguiss Webmaster
    Member
    Posted 4 years ago #

    Hi ! Happy new year !

    I have a litle PHP issue, i think a lot of people can solve it so please help me !

    This is a template tags of wp-ecommerce to insert a button (add to cart):
    <?php echo wpsc_add_to_cart_button(1); ?>
    If i put it in my category.php i retrieve the button (add to cart) for my product with the ID 1. All is ok but i want to print the button to corresponding ID (product)

    I have created a custom field for each post:
    key : addcart
    value : <?php echo wpsc_add_to_cart_button(1); ?>

    I retrieve it with :
    <?php echo get_post_meta($post->ID, "addcart", true);?>
    But nothing is print !

    I have tried to modify my custom field like this :
    key : addcart
    value : 1

    And to retrieve it with :
    <?php echo wpsc_add_to_cart_button(echo get_post_meta($post->ID, "addcart", true);); ?>
    But it's a PHP error....


    It's maybe more complicated to understand me than to solve the problem...

    Thanks in advance for those who stay on this

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by Jguiss Webmaster
  • This topic is not resolved
  • WordPress version: 2.9