Author Topic: Total number of products on order  (Read 4018 times)

K&K media production

  • VirtueMart Developer Team
  • Global Moderator
  • Full Member
  • *
  • Posts: 838
  • VirtueMart Version: VM3 on J3
Re: Total number of products on order
« Reply #15 on: June 09, 2017, 01:59:45 am »
Quote
Use of undefined constant items - assumed 'items'

'items'

Code: [Select]
<?php 
  $totalNrOfOrderItems
0;
  foreach (
$this->orderDetails['items'] as $orderItem) {
    
$totalNrOfOrderItems $totalNrOfOrderItems $orderItem->product_quantity
  }
  echo 
vmText::_('VM_TOTAL_NUMBER_OF_ORDER_ITEMS') . $totalNrOfOrderItems
?>

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2858
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Total number of products on order
« Reply #16 on: June 09, 2017, 08:31:23 am »
Of course You are right.

I wonder why the code snippet showed [items] instead of ['items']. Could swear that I copied it from the code without editing. Bý the way, Your example shows [imems] instead of [items] ;)

Will also change my original post.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)

2cool

  • Jr. Member
  • **
  • Posts: 236
Re: Total number of products on order
« Reply #17 on: June 09, 2017, 16:05:57 pm »
Thanks for your help, got one last question:

I added this to nl-NL.override.ini:
VM_TOTAL_NUMBER_OF_ORDER_ITEMS="Totaal aantal artikelen: "

This doesn't work anymore?
shows: VM_TOTAL_NUMBER_OF_ORDER_ITEMS2 on invoice mails?

Regards,
Pas

K&K media production

  • VirtueMart Developer Team
  • Global Moderator
  • Full Member
  • *
  • Posts: 838
  • VirtueMart Version: VM3 on J3
Re: Total number of products on order
« Reply #18 on: June 09, 2017, 20:31:58 pm »
you need it for frontend AND backend

2cool

  • Jr. Member
  • **
  • Posts: 236
Re: Total number of products on order
« Reply #19 on: June 10, 2017, 16:30:11 pm »
Yes! works perfect real nice, thanks for your help.

Regards,

Pas