Marketpress Framemarket buy now bug

0

Hi,

I have installed (Grid market) child of Framemarket theme. The problem is that the products on the main page always show ‘Buy now’ button even though the settings in Marketpress are to show ‘Add to Cart’ button.

I investigated the issue and it turns out that in file /framemarket/library/functions/marketpress.php on line 331 its hardcoded:

$content .= '<a class="mp_link_buynow" href="' . $permalink . '">' . __('Buy Now ยป', 'mp') . '</a>';

Can you please tell the developer to make it compatible with MP backend settings.

Thanks.

  • Patrick Cohen
    • Technical Docs Wrangler

    Hi @Mindblaze

    That’s odd. On my test site running GridMarket, the button text changes just fine.

    Forgive me for asking, but are you sure you have tried changing the correct button? There are identical settings for both single products and product listings under the Presentation tab.

  • Patrick Cohen
    • Technical Docs Wrangler

    @Mindblaze

    Ah, now I see the issue.

    I can change the button text easily on the main site or any sub-site running GridMarket, for that site’s product listing only.

    But you are right, if the main site is running GridMarket and displaying network products, the button text remains at “Buy Now” on the front-page marketplace.

    I’ll flag the theme developer on this to see if he can get that modified.

  • Mindblaze
    • The Incredible Code Injector

    Thank you testing it out. Yeah its hardcoded in the theme for Global products.

    Its in the file /framemarket/library/functions/marketpress.php on line 331:

    $content .= '<a class="mp_link_buynow" href="' . $permalink . '">' . __('Buy Now ยป', 'mp') . '</a>';

  • Mindblaze
    • The Incredible Code Injector

    okay, i am able to do it myself.

    I have added some code in the core of marketpress to make this functionality. It seems it was missing in the core.

    In order to make the Global Cart work with ‘Add to cart’ button:

    one has to add in marketpress/marketpress-includes/template-functions.php

    line 1712

    $blog_id = (is_multisite()) ? $blog_id : 1;

    and line 1767

    $button .= '<input type="hidden" name="blog_id" value="' . $blog_id . '" />';

    Then change in marketpress/marketpress.php

    line 2747 From:

    $blog_id = (is_multisite()) ? $blog_id : 1;

    To

    if ( is_multisite() ) {
    switch_to_blog( $_POST['blog_id'] );
    } else {
    $blog_id = 1;
    }

    and finally where the global cart button is being displayed in file /framemarket/library/functions/marketpress.php on line 331:

    From:

    $content .= '<a class="mp_link_buynow" href="' . $permalink . '">' . __('Buy Now ยป', 'mp') . '</a>';

    to:

    $content .= mp_buy_button(false, 'list', $post->ID);

    Hope it helps anyone who is looking for this solution. I think this should be added in core with added securities and what not so everything is hooked properly.