Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Total Units


WhirlyGirl

Recommended Posts

Hi,

 

I am looking for a module or hack to display the total number of items ordered (units) above the sub-total on the invoice.

 

I presume the best way to do this would be as an order total module, however I can't find one in the contributions.

 

Can anybody help, or do you know of a modules that will achieve this?

 

Thanks in advance,

 

WG

Link to comment
Share on other sites

Hi,

 

I am looking for a module or hack to display the total number of items ordered (units) above the sub-total on the invoice.

 

I presume the best way to do this would be as an order total module, however I can't find one in the contributions.

 

Can anybody help, or do you know of a modules that will achieve this?

 

Thanks in advance,

 

WG

I thought that this was the default?

Link to comment
Share on other sites

Sorry, I should have explained this more clearly. It shows total units for each item with no problems, but I would like it to show the total units in the whole order, for example, if you purchase:

 

4 X Chairs

1 X Table

8 X Place Mats

 

 

I would like it to show in the list of order totals as:

 

Total Units: 13

Sub-Total: ?price

VAT: ?VAT

Freight Charge: ?shipping

Total: ?total

 

 

If this is a built in feature I must be missing it, becuase I have spent days searching for a way to do it with no luck! :(

 

Look forward to your replies,

 

WG

Link to comment
Share on other sites

use the low order fee class it's in the order totals modules. Just rename the strings to "total units" and then retrieve the number of items from the $order globals $order->products array. Add the qty field of the array to setup the total units.

 

$total_units = 0;
for( $i=0, $j=count($order->products); $i<$j; $i++) {
$total_units += $order->products[$i]['qty'];
}

 

Then the $total_units will be the 'value' of the loworderfee module.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...