Forum

Thread tagged as: Members, Shop

Member logged in

Hi All

Anyone tried this

anyone know why this does not work

<perch:member logged-in="true"> 

         <perch:form id="cart" app="perch_shop" next="/shop/checkout/confirmation">

     <perch:else:member />

        <perch:form id="cart" app="perch_shop" next="/shop/checkout">

     </perch:member>
Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Form tags cannot be dynamic.

If needs be, send them both to one page, and on that page bounce them to another if they're not logged in.

Ok thought so

in this case i have made two identical Carts

one with

<perch:form id="cart" app="perch_shop" next="/shop/checkout/confirmation">

and the other

<perch:form id="cart" app="perch_shop" next="/shop/checkout">

and used

<?php if (perch_member_logged_in()) {
  perch_shop_cart([
    'template'=>'cart/cart_members.html'
    ]);   
}   else {
    perch_shop_cart(); 
} ?>    

on the cart page