How to edit the shortcode [mp_list_products]

Need to know where can I find the source of _ that is appearing under "mp_product_content"...the area marked in Screenshot-1 and Screenshot-2.....

I require this to edit/remove description excerpt, bring title down etc.....the contents (image, title, description, price) that this shortcode is fetching....like I did some corrections in here http://moretique.com/store/ ... for this minor tweaking I did the changes here /public_html/wp-content/themes/framemarket/library/functions/marketpress.php

I need to know where else in the coding can I find the mentioning of "product_excerpt" the shortcode "mp_product_content" definitely is not fetching from here (marketpress.php) $product_content .= $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID); (see Screenshot-3) I've checked/tested it

Thanks

  • Timothy
    • Chief Pigeon

    Hey M.O.R.E..

    I'm not sure I understand your request here??

    Need to know where can I find the source of _ that is appearing under

    Thats your developer tools/firebug showing that there is more content there, click the arrow will expand it.

    You can find post_excerpt here:

    marketpress/marketpress-includes/template-functions.php

    Around line 1278:

    $product_content .= $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID);

    And here:

    /marketpress/marketpress.php

    Around line 3767 (the function):

    function product_excerpt($excerpt, $content, $product_id) {

    and around 6053:

    echo '<div class="mp_product_content">' . $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID) . '</div>';

    Take care.

  • M.O.R.E.
    • Site Builder, Child of Zeus

    One more issue....why this thing keeps coming when I go from Store>Products

    Warning: Invalid argument supplied for foreach() in /home/moretiqu/public_html/wp-content/plugins/marketpress/marketpress-includes/template-functions.php on line 1440

    Warning: Invalid argument supplied for foreach() in /home/moretiqu/public_html/wp-content/plugins/marketpress/marketpress-includes/template-functions.php on line 1480

    What should I do to remove it

  • Timothy
    • Chief Pigeon

    Hey again.

    I'm not able to recreate the error..... Could it any of the changes you have made so far? Might be worth backing it up and using a vanilla version of the plugin just to check.

    What code do you now have around those lines?

    Which versions of WP and the plugin are you using again?

    Take care.

  • M.O.R.E.
    • Site Builder, Child of Zeus

    Hi all

    This error is appearing periodically even before doing anything to template-function.php

    Only yesterday in order to restrict the "content excerpts" from showing up in product display I uncommented a portion of it.....I disabled this portion (appears in line 1278)
    //$product_content .= $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID);

    But the error is in line 1440 & 1480 and both the places it relates to this line "foreach ($meta as $key => $val) {" please see the code)

    `//unserialize
    foreach ($meta as $key => $val) {
    $meta[$key] = maybe_unserialize($val[0]);
    if (!is_array($meta[$key]) && $key != "mp_is_sale" && $key != "mp_track_inventory" && $key != "mp_product_link" && $key != "mp_file" && $key != "mp_price_sort")
    $meta[$key] = array($meta[$key]);
    }

    if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {
    if ($meta["mp_is_sale"] && $meta["mp_sale_price"][0]) {
    $price = '<span class="mp_special_price"><del class="mp_old_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</del>';
    $price .= '<span class="mp_current_price">'.$mp->format_currency('', $meta["mp_sale_price"][0]).'</span></span>';
    } else {
    $price = '<span class="mp_normal_price"><span class="mp_current_price">'.$mp->format_currency('', $meta["mp_price"][0]).'</span></span>';
    }
    } else {
    return '';
    }

    $price = apply_filters( 'mp_product_price_tag', '<span class="mp_product_price">' . $label . $price . '</span>', $post_id, $label );

    if ($echo)
    echo $price;
    else
    return $price;
    }

    @timothy
    I am using WordPress version 3.3.1, Custom Child Theme created from FrameMaker version 1.4.8 & & MarketPress version 2.4.2

    Thanks

  • M.O.R.E.
    • Site Builder, Child of Zeus

    And this code appears in line 1480

    //unserialize
      foreach ($meta as $key => $val) {
    	  $meta[$key] = maybe_unserialize($val[0]);
    	  if (!is_array($meta[$key]) && $key != "mp_is_sale" && $key != "mp_track_inventory" && $key != "mp_product_link" && $key != "mp_file")
    	    $meta[$key] = array($meta[$key]);
    	}
  • Timothy
    • Chief Pigeon

    Does this still happen with the default theme (not child) or Twenty Elevan?

    What about with all other plugins disabled?

    Something must be different or conflict as I don't see it on my install.

    Its usually something to do with the array.

    Let me know how it goes. :slight_smile:

  • M.O.R.E.
    • Site Builder, Child of Zeus

    Thanks a ton Timothy

    Its happening even after deactivating all the plugins (barring MarketPress)...then I deactivated my child theme and activated Gridmarket theme....and it's gone

    The error you getting should be regarding the custom-fields of the marketpress. Did you add any extra custom-fields? Or made any related changes?

    What is a custom field?....I only made changes and saved them in custom.css

    It means the problem lies with my child theme....should I recreate and edit it all over again?

    Thanks for all the help

  • Timothy
    • Chief Pigeon

    What has changed within the child theme wich is different from the parent?

    It could be a process of elimination. Lets say you changed 5 files in the child theme. Activate the theme with only the CSS. Check it. Upload 1 file. Check it then upload another and so on. It will let you track down which file it is causing the issue for you. :slight_smile:

    Let me know how you get.

  • M.O.R.E.
    • Site Builder, Child of Zeus

    Hi

    Strange creepy thing this..........:-!

    As suggested deleted all files...uploaded each file and checked/re-checked website with each uploading...added nothing...deleted nothing...and it just vanished

    Anyways thanks a lot Timothy & Mysolarix....will bug you again if some stupid thing (bug) occurs again.

    :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.