Article in cart?

WL7ea
Junior Member
Beiträge: 6
Registriert: Do 20. Jul 2017, 18:30

Article in cart?

Beitragvon WL7ea » So 23. Jul 2017, 19:05

Hello,

How can I check if the "current" article is in the cart?

Thank you.

WL7ea
Junior Member
Beiträge: 6
Registriert: Do 20. Jul 2017, 18:30

Re: Article in cart?

Beitragvon WL7ea » Do 24. Aug 2017, 19:02

Found a solution :)

Code: Alles auswählen

<we:repeatShopItem shopname="shop">
   <?php $oid = $GLOBALS['oid']; $wedoc_ID = $lv->f("wedoc_ID"); ?>
</we:repeatShopItem>
<we:condition name="productInCartBool">
   <we:conditionAdd field="ID" value="$oid" var="WE_ID" compare="="/>
   <we:conditionAnd to="top" />
   <we:conditionAdd field="WE_ID" value="$wedoc_ID" compare="="/>
</we:condition>

<we:listview type="object" classid="1" condition="$productInCartBool">
  <we:ifFound>
     Product is in cart
  </we:ifFound>
  <we:ifNotFound>
     Product is not in cart
  </we:ifNotFound>
</we:listview>

AndreasWitt
webEdition Member
webEdition Member
Beiträge: 525
Registriert: Do 26. Okt 2006, 12:51
Wohnort: Brandenburg a. d. Havel
Kontaktdaten:

Re: Article in cart?

Beitragvon AndreasWitt » Mo 28. Aug 2017, 15:35

... your code more simple :)

Code: Alles auswählen

<we:DID to="global" nameto="currentDocID"/>
<we:repeatShopItem shopname="shop">
   <we:field type="text" name="WE_ID" to="global" nameto="actCartArticleID"/>
   <we:ifVar type="global" name="actCartArticleID" match="\$currentDocID" operator="equal">
      Product is in cart
   <we:else/>
      Product is not in cart
   </we:ifVar>
</we:repeatShopItem>
Andreas Witt - WebManagement
Leiter Entwicklung im webEdition e.V.
Andreas Witt & Thomas Göbe - Das 1. webEdition Buch
mail: witt@andreas-witt.net
web: http://www.andreas-witt.net


Zurück zu „Shop Module“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast