Checkout page vs orderstatus page price per item

Ok, I’ll admit to doing only a cursory search for this in the forums…I’m hoping it’s an easy fix.

Selling physical items where folks will more than likely add more than 1 of the same item to their cart.

On the shopping cart page for 2 books at $50 EACH it shows:

Item Price Quantity

book 100$ 2

Cart Total: $100

Client wants it to show the per item price.

And on the order status page…it DOES show the per item price:

Item Quantity Price Subtotal Download

book 2 $50 $100

So how do I make the shopping cart display the per item price?

Let me know if you need any more info or links to the test site!

(Side note…since this isn’t a download…should I just use css to not display the Download header?)

Cheers,

Brian

  • digitsoft
    • The Crimson Coder

    You can edit /marketpress/marketpress-includes/template-functions.php

    Insert after line 195:

    $content .= '<th class="mp_cart_col_price">'.__('Price Per:', 'mp').'</th>';

    Insert after line 214 (this is after inserting above):

    $content .=  '  <td class="mp_cart_col_price">' . $mp->format_currency('', $data['price']) . '</td>';

    Now this area looks like:

    $content .= '<form id="mp_cart_form" method="post" action="">';
    $content .= '<table class="mp_cart_contents"><thead><tr>';
    $content .= '<th class="mp_cart_col_product" colspan="2">'.__('Item:', 'mp').'</th>';
    $content .= '<th class="mp_cart_col_price">'.__('Price:', 'mp').'</th>';
    $content .= '<th class="mp_cart_col_price">'.__('Price Per:', 'mp').'</th>';
    $content .= '<th class="mp_cart_col_quant">'.__('Quantity:', 'mp').'</th></tr></thead><tbody>';

    $totals = array();
    $shipping_prices = array();
    $tax_prices = array();
    foreach ($selected_cart as $bid => $cart) {

    if (is_multisite())
    switch_to_blog($bid);

    foreach ($cart as $product_id => $variations) {
    foreach ($variations as $variation => $data) {
    $totals[] = $mp->before_tax_price($data['price'], $product_id) * $data['quantity'];

    $content .= '<tr>';
    $content .= ' <td class="mp_cart_col_thumb">' . mp_product_image( false, 'widget', $product_id, 50 ) . '</td>';
    $content .= ' <td class="mp_cart_col_product_table"><a href="' . apply_filters('mp_product_url_display_in_cart', $data['url'], $product_id) . '">' . apply_filters('mp_product_name_display_in_cart', $data['name'], $product_id) . '</a>' . '</td>'; // Added WPML
    $content .= ' <td class="mp_cart_col_price">' . $mp->format_currency('', $data['price'] * $data['quantity']) . '</td>';
    $content .= ' <td class="mp_cart_col_price">' . $mp->format_currency('', $data['price']) . '</td>';
    $content .= ' <td class="mp_cart_col_quant"><input type="text" size="2" name="quant[' . $bid . ':' . $product_id . ':' . $variation . ']" value="' . $data['quantity'] . '" />&nbsp;<label><input type="checkbox" name="remove[]" value="' . $bid . ':' . $product_id . ':' . $variation . '" /> ' . __('Remove', 'mp') . '</label></td>';
    $content .= '</tr>';
    }
    }

    Obviously you can change the text to whatever you want…

    Enjoy!

    Rob

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.