MarketPress: Buy Now Button Shortcode with Product ID Not Working

I’m using Marketpress with the SimpleMarket theme and I am trying to use the “buy now” button shortcode on posts and pages with a specific product id. The button shows up on the post or page and works when you click the “add to cart” link, but the specific product does not show up in the cart. It appears in the cart as the title of the page or post with no price. It is to my understanding that the product id is the equivalent of the post id, correct? How can I add an “add to cart” button on posts or pages for a specific product in the store?

Thank you!

  • 3SixtyEvolve
    • New Recruit

    Hi @ynattirb

    Greetings from the WPMU DEV Support Team and thank you for being a member of our community.

    I am not too sure if I understand why you're trying to use the 'Buy Now' shortcode on the individual product pages, since you can do the setting from the MarketPress Store Settings. Please see my screenshots as reference.

    If you're trying to achieve something specific, please let me know and I can see if there is a workaround for it. I did test the 'Buy Now' button on my own test site and it was working fine. If you can confirm the attributes that you're specifying in your shortcode I can check it for you as well.

    Look forward to receive your feedback.

    Have a good weekend!


  • digitsoft
    • The Crimson Coder

    @gina – I think @ynattirb was trying to put a buy button anywhere on the site they wanted

    I tested this thoroughly and I got the same results regardless of product id I used – it always adds the post title to the shopping cart and not the product id specified. I even verified this by looking at the source for an add to cart button on an existing product.

    I created a new page with just “Test” as the text and then added the shortcode for a product.

    I’d assume the same thing when looking at the shortcode info:

    Product Buy Button [mp_buy_button] – Displays the buy or add to cart button.

    Optional Attributes:

    “product_id” – The ID for the product. Optional if shortcode is in the loop.

    “context” – What context for display. Options are list or single, default single which shows all variations.

    Example: [mp_buy_button product_id=”1″ context=”single”]

    So either this is not possible or there’s a bug.

    I’m curious to see as well since as you know I’m working on some Marketpress stuff…

  • 3SixtyEvolve
    • New Recruit

    Hi @digitsoft

    Thank you for giving your view on things. I greatly appreciate it :slight_smile:

    I am just heading out of the forums for the day – need to get some shuteye, but I will look into this matter tomorrow to see why and whether is is correct or not.

    Talk soon again :slight_smile:


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.