Marketpress Multisite: Display single product on the main site

Is there a way to display on the main site a product from a specific subsite by id? Thank you!

  • aecnu
    • WP Unicorn

    Greetings Blast,

    Thank you for the great question.

    I would think it is possible as long as you have in the network admin dashboard settings the Limit Global Widgets/Shortcodes To Main Blog set to no and then using the [mp_product] shortcode as defined in the shortcodes tab located in the regular site admin dashboard of the store --> Products --> Store Settings --> Shortcodes tab

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

  • Blast
    • WPMU DEV Initiate

    Hello @aecnu and thank you for your help!

    I tried it, but unfortunately it doesn't work. What I want to do:

    Main site is store.com and subsite is store.com/sub. I want to display a product (id=x) from "sub" on store.com. Should the shortcode [mp_product product_id="x"] work globally if called in store.com?

    Thanks for your time!

  • aecnu
    • WP Unicorn

    Greetings Blast,

    Thank you for another great question.

    I am not sure if the coding will work on the main site though you have the syntax correct but this is not a global short code though it may indeed work since they are tapping the same database.

    Example
    [mp_product product_id="1" title="1" content="excerpt" image="single" meta="1"]

    Have you given it a shot to see if it indeed works?

    Please advise.

    Cheers, Joe

  • Blast
    • WPMU DEV Initiate

    Hello again Joe,

    Yes, I have tried this, but it doesn't work. Any other ideas?

    I'll try making a function with the substore name/id and product id as input and title, image, link, description etc as output.

    Thanks!

  • aecnu
    • WP Unicorn

    Greetings Blast,

    OK I am at the limit of what I can possibly do here and information I can offer to help you on this one.

    Therefore I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Blast
    • WPMU DEV Initiate

    Thanks Aaron! If anyone else wants this, I made it with the Global Product widget, displaying 1 product and limited by tag (unique tag on the product.)

    Also, I have found a little bug:

    When displaying a global product the excerpt_length doesn't work.

    marketpress-ms.php: line 1369

    replace $excerpt_length = apply_filters('excerpt_length', 55); with
    $excerpt_length = apply_filters('excerpt', 55);

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.