Quote Originally Posted by lat9 View Post
I've never used the product_cost_display plugin, so I don't know how easy/difficult it would be to add that column. In any case, what you are requesting is over-and-above the scope of "Printable Price List"; if you are interested in pursuing a custom-programming solution, please PM me.
OK, that wasn't too difficult. There are a couple of edits to be made.

First, /includes/modules/pages/pricelist/header_php.php, starting at line 52, make the highlighted additions:
Code:
    $profile_settings = array (
      array ('PL_GROUP_NAME', 'group_name', 'char'),
      array ('PL_PROFILE_NAME', 'profile_name', 'char'),
      array ('PL_USE_MASTER_CATS_ONLY', 'master_cats_only', 'bool'),
      array ('PL_SHOW_BOXES', 'show_boxes', 'bool'),
      array ('PL_CATEGORY_TREE_MAIN_CATS_ONLY', 'main_cats_only', 'bool'),
      array ('PL_MAINCATS_NEW_PAGE', 'maincats_new_page', 'bool'),
      array ('PL_NOWRAP', 'nowrap', 'bool'),
      array ('PL_SHOW_MODEL', 'show_model', 'bool-col', 'p.products_model'),
      array ('PL_SHOW_MANUFACTURER', 'show_manufacturer', 'bool-col', 'p.manufacturers_id'),
      array ('PL_SHOW_WEIGHT', 'show_weight', 'bool-col', 'p.products_weight'),
      array ('PL_SHOW_SOH', 'show_stock', 'bool-col', 'p.products_quantity'),
      array ('PL_SHOW_NOTES_A', 'show_notes_a', 'bool-col'),
      array ('PL_SHOW_NOTES_B', 'show_notes_b', 'bool-col'),
      array ('PL_SHOW_PRICE', 'show_price', 'bool-col', 'p.products_price'),
      array ('PL_SHOW_TAX_FREE', 'show_taxfree', 'bool-col', 'p.products_price'),
      array ('PL_SHOW_SPECIAL_PRICE', 'show_special_price', 'bool'),
      array ('PL_SHOW_SPECIAL_DATE', 'show_special_date', 'bool'),
      array ('PL_SHOW_ADDTOCART_BUTTON', 'show_cart_button', 'bool-col'),
      array ('PL_ADDTOCART_TARGET', 'add_cart_target', 'char'),
      array ('PL_SHOW_IMAGE', 'show_image', 'bool', 'p.products_image'),
      array ('PL_IMAGE_PRODUCT_HEIGHT', 'image_height', 'int'),
      array ('PL_IMAGE_PRODUCT_WIDTH', 'image_width', 'int'),
      array ('PL_SHOW_DESCRIPTION', 'show_description', 'bool'),
      array ('PL_TRUNCATE_DESCRIPTION', 'truncate_desc', 'int'),
      array ('PL_SHOW_INACTIVE', 'show_inactive', 'bool'),
      array ('PL_SORT_PRODUCTS_BY', 'sort_by', 'char'),
      array ('PL_SORT_ASC_DESC', 'sort_dir', 'char'),
      array ('PL_DEBUG', 'debug', 'bool'),
      array ('PL_HEADER_LOGO', 'show_logo', 'bool'),
      array ('PL_SHOW_PRICELIST_PAGE_HEADERS', 'show_headers', 'bool'),
      array ('PL_SHOW_PRICELIST_PAGE_FOOTERS', 'show_footers', 'bool'),
    
    );
  
//-20160204-lat9-Add support for products_cost field  *** 1 of 1 ***
    global $sniffer;
    if ($sniffer->field_exists (TABLE_PRODUCTS, 'products_cost')) {
      define ('PL_SHOW_PRODUCT_COST_' . $this->current_profile, 'true');
      $profile_settings[] = array ('PL_SHOW_PRODUCT_COST', 'show_cost', 'bool-col', 'p.products_cost');
      
    }
//-20160204-lat9-Add support for products_cost field  *** 1 of 1 ***
Next up, /includes/templates/template_default/pricelist/tpl_main_page.php. Two edits in this file, the first starting at line 139:
Code:
    if ($price_list->config['show_notes_b']) {
?>
        <td class="ntsPL"><div><?php echo TABLE_HEADING_NOTES_B; ?></div></td>
<?php      
    }
    $pl_currency_symbol = (defined ('PL_INCLUDE_CURRENCY_SYMBOL') && PL_INCLUDE_CURRENCY_SYMBOL == 'false') ? '' : $price_list->currency_symbol;
    
//-bof-20160204-lat9-Add support for products_cost  *** 1 of 2 ***
    if ($price_list->config['show_cost']) {
?>
        <td class="prcPL"><div><?php echo 'Cost ' . $pl_currency_symbol; ?></div></td>
<?php  
    }
//-eof-20160204-lat9-Add support for products_cost  *** 1 of 2 ***
Next, find the start of the next block (around line 251 with the above addition):
Code:
        if ($price_list->config['show_notes_b']) {
?>
        <td class="ntsbPL">&nbsp;</td>
<?php          
        }

        $price_class = ($special_price_ex > 0) ? 'prcPL notSplPL' : 'prcPL';
        
//-bof-20160204-lat9-Add support for products_cost  *** 2 of 2 ***
        if ($price_list->config['show_cost']) {
?>        
        <td class="<?php echo $price_class; ?>"><?php echo $price_list->display_price ($current_row['products_cost']);; ?></td>
<?php   
        }
//-eof-20160204-lat9-Add support for products_cost  *** 2 of 2 ***

        if ($price_list->config['show_price']) {
?>        
        <td class="<?php echo $price_class; ?>"><?php echo $products_price_inc; ?></td>
<?php           
        }
The 'cost' column will appear to the left of the other product price-related columns.