Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Managing Customers and Orders / Showing Price of item with no attributes in packingslip

Showing Price of item with no attributes in packingslip

Locked

Started by wiggst3r on 8 Sep 2008, 11:19 AM · Views: 968

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
8 Sep 2008, 11:19 AM
#1
wiggst3r avatar

wiggst3r

New Zenner

Join Date:
Mar 2008
Posts:
39
Plugin Contributions:
0

Post #1 by wiggst3r

Hi

In my admin packingslip, I have a slight problem.

I've changed it, so that it displays the products quantity, name and the price. The only problem i have, is that the price is only displayed when the item that has been bought has got more than one attribute.

Such as:

Products
1 x Newport Universal Lighter Flints
2 x Bull Brand Slimline Filter Tips

  • Pack Size: 12 Pack (+£9.00)
    1 x Bull Brand Red Papers
  • Pack Size: 50 Box (+£6.00)

You can see. The first product, has no other attribute and thus doesn't display the small text, with the pack size and the price.

Is there any way, where I can display the price for these products that have no other attribute?

I've found the code where it displays the output, but I'm not sure how to change it.

<?php
    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++)
    {
      echo '      <tr class="dataTableRow">' . "\n" .
           '        <td class="dataTableContent" valign="top"   >' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
           '        <td class="dataTableContent" valign="top"  >' . $order->products[$i]['name'];

      if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0))
      {
        for ($j = 0; $j < $k; $j++) {
          echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
          if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
          if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
          echo '</i></small></nobr>';
        }
      }

    }
?>

Any help will be appreciated