Post by nodric » Sat Feb 16, 2013 11:56 pm

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.

The Best 4x4xfar


Active Member

Posts

Joined
Wed Jul 06, 2011 10:39 pm

Post by labeshops » Sun Feb 17, 2013 12:29 am

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.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by nodric » Sun Feb 17, 2013 12:44 am

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

The Best 4x4xfar


Active Member

Posts

Joined
Wed Jul 06, 2011 10:39 pm

Post by labeshops » Sun Feb 17, 2013 12:55 am

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.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA
Who is online

Users browsing this forum: No registered users and 19 guests