Basket total items

Michael_S
Senior Member
Beiträge: 160
Registriert: Mi 4. Feb 2004, 02:39
Wohnort: London / UK
Kontaktdaten:

Basket total items

Beitragvon Michael_S » Mi 6. Nov 2013, 16:40

How do I calculate the total number of items in a shopping basket?
Production Area
London, UK
http://productionarea.com

Michael_S
Senior Member
Beiträge: 160
Registriert: Mi 4. Feb 2004, 02:39
Wohnort: London / UK
Kontaktdaten:

Re: Basket total items

Beitragvon Michael_S » Mi 6. Nov 2013, 17:12

Worked it out ...

1. Calculate the number of items per product:

Code: Alles auswählen

<we:repeatShopItem shopname="shop">
	<we:calculate sum="item" print="false">
		<we:showShopItemNumber shopname="shop">
	</we:calculate>
</we:repeatShopItem>
2. Calculate the total items (print must be set to 'true'):

Code: Alles auswählen

<we:calculate sum="total" print="true" to="request" nameto="totalitems">
	<we:sum name="item" />
</we:calculate>
3. Display the total items:

Code: Alles auswählen

<we:var type="request" name="totalitems" /> <we:ifVar name="totalitems" match="1" type="request" operator="less|equal">item<we:else />items</we:ifVar>
Production Area
London, UK
http://productionarea.com


Zurück zu „Shop Module“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste