Page 1 of 1

Need a way to show options as line items on invoices

Posted: Sat Feb 16, 2013 11:56 pm
by nodric
Where products have options added, for instance a gasket set as shown on the ad below.

Image

The system generates an invoice that does not itemize that 'option' and simply shows it as small text under the main product. The price shown is the total cost of the order, rather than the options being listed as line items as shown below.

Image

We use these invoices/emails as picking lists, and sometimes the options are missed by the staff.

Is there a mod, or a easy way to fix this limitation? Commercial mods also perfectly acceptable.

Re: Need a way to show options as line items on invoices

Posted: Sun Feb 17, 2013 12:29 am
by labeshops
You could edit the admin/view/template/sale/order_invoice.tpl file and format the options section however you want - add a line break, change the font size, etc. The templates use pretty basic html for formatting, just leave the php portions of it as is.

Re: Need a way to show options as line items on invoices

Posted: Sun Feb 17, 2013 12:44 am
by nodric
labeshops wrote:You could edit the admin/view/template/sale/order_invoice.tpl file and format the options section however you want - add a line break, change the font size, etc. The templates use pretty basic html for formatting, just leave the php portions of it as is.
Yep, I can see the section.

Code: Select all

 </table>
  <table class="product">
    <tr class="heading">
      <td><b><?php echo $column_product; ?></b></td>
      <td><b><?php echo $column_model; ?></b></td>
      <td align="right"><b><?php echo $column_quantity; ?></b></td>
      <td align="right"><b><?php echo $column_price; ?></b></td>
      <td align="right"><b><?php echo $column_total; ?></b></td>
    </tr>
    <?php foreach ($order['product'] as $product) { ?>
    <tr>
      <td><?php echo $product['name']; ?>
        <?php foreach ($product['option'] as $option) { ?>
        <br />
        &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
        <?php } ?></td>
      <td><?php echo $product['model']; ?></td>
      <td align="right"><?php echo $product['quantity']; ?></td>
      <td align="right"><?php echo $product['price']; ?></td>
      <td align="right"><?php echo $product['total']; ?></td>
    </tr>
I am assuming this bit is the critical bit for formatting?

Code: Select all

 <td><?php echo $product['name']; ?>
        <?php foreach ($product['option'] as $option) { ?>
        <br />
        &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
        <?php } ?></td>
      <td><?php echo $product['model']; ?></td>
      <td align="right"><?php echo $product['quantity']; ?></td>
      <td align="right"><?php echo $product['price']; ?></td>
      <td align="right"><?php echo $product['total']; ?></td>
    </tr>
And I assume this specific bit is the option formatting?

Code: Select all

        &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
My questions is, why does this not display the option value in the price column?

I though this bit did that?

Code: Select all

?php echo $option['value']; ?></small>
In essence I'd simply like a sub heading under the main product saying 'Supply These Options' and then the options to each display their price in the 'price' column. As there is no product number associated with Options I guess we leave that as is.

Any suggestions on the exact syntax would be helpful, and of course appreciated ;D

Re: Need a way to show options as line items on invoices

Posted: Sun Feb 17, 2013 12:55 am
by labeshops
It's doable. If all your products have options, just add the "Supply These Options:" under ?php echo $product['name']; ?>.

remove the "<small> -" tag from the option line and it will make the text the same size.

Not sure on the pricing per option. The value call is for the text of the option, not the price of the option - name is the option name like "Color" and value is the specific option like "Red". Displaying the cost per option would take a bit more coding and work then I've done on the invoices myself, so hopefully someone else can help you there.