• skitelluride531

    (@skitelluride531)


    I am using the “Simple Shopping Cart” plugin. The way you call a shopping cart is:
    <?php echo print_wp_cart_button_for_product(Title,ProductPrice); ?>

    I have like 300 products, and the price and title are stored as either “The Title” or in a custom field for the product. Does anyone have any idea how to store the call for the custom field in a variable and then input it into that Shopping cart function above.

    This post seems to give an answer: https://www.tipsandtricks-hq.com/forum/topic/coding-question-for-simple-cart-wp-plugin-with-custom-field-template-plugin

    But I don’t understand where to add the following code:

    $prodname = <?php echo c2c_get_custom('MMTname'); ?>
    $prodprice = <?php echo c2c_get_custom('MMTprice'); ?>

    in order to change things to this:

    <?php echo print_wp_cart_button_for_product($prodname, $prodprice); ?>

    Thanks!

  • The topic ‘How to create new $var’ is closed to new replies.