I am using clear_cart to clear the cart when a completed order returns to the site from Paypal Express. The Shop page has a link to /checkout to go make a purchase using the Paypal express gateway. The checkout_form returns from Paypal to "checkout/order_status" and is supposed to display one of the following messages.
I am getting a "too many redirects" error (error 310) anytime I try to go to /checkout because the clear_cart tag is rendering and redirecting whether a transaction has been authorized or not. I can't even get to the checkout page usually to check my cart and be sent to Paypal. I have cleared the EE cache as well as Chrome cache multiple times with no success. Why is this tag acting when there is no order_status in segment_2 and also causing an infinite redirect?
Here is the full code I am using on the checkout page:
{!-- VIEW CART CONTENTS --}
{exp:cartthrob:cart_items_info limit="1"}
{if no_results}
<p>There is nothing in your cart yet</p>
{/if}
<ul class="cart-table">
{exp:cartthrob:cart_info}
<li>Total Items: <span>{total_items}</span></li>
<li>Subtotal: <span>{cart_subtotal}</span></li>
<li>Shipping: <span>{exp:cartthrob:cart_shipping}</span></li>
<li>Tax Rate: <span>{cart_tax_rate}</span></li>
<li>Tax: <span>{cart_tax}</span></li>
<li><p class="lead"><strong>Total: <span>{cart_total}</span></strong></p></li>
{/exp:cartthrob:cart_info}
</ul>
{/exp:cartthrob:cart_items_info}
{!-- Current items --}
{exp:cartthrob:cart_items_info}
{if no_results}
<p>You have nothing in your cart. <a class="blue" href="/shop">GO SHOP »</a></p>
{/if}
{if total_items > 0}
{if first_row}
{exp:cartthrob:update_cart_form return="checkout" class="cart_form" show_errors="yes" error_handling="inline"}
{/if}
<ul class="cart-table">
{errors}
<p class="error">{error}</p>
{/errors}
{if product_detail_image}
<img src="{product_detail_image:feed}"/>
{if:else}
<img src="{site_url}content/img/ride.png"/>
{/if}
<li><p class="lead"><strong>{title}</strong> <span>Qty: <input type="text" name="quantity[{row_id}]" size="1" maxlength="2" value="{quantity}" /></span></p>
<p>{exp:cartthrob:item_options entry_id="{entry_id}" row_id="{row_id}"}
{if dynamic}
<label>{option_label}</label>
{input}
{if:else}
{if options_exist}
{select}
{if "{inventory}" > "0"}<option {selected} value="{option_value}">{option_name} {option_price}</option>{/if}
{/select}
{/if}
{/if}
{/exp:cartthrob:item_options}
<span><input type="checkbox" name="delete[{row_id}]"> Delete this item</span></p>
</li>
</ul>
{if last_row}
<select name="shipping_option">
{exp:cartthrob:get_shipping_options}
<option value="{rate_short_name}" {if selected}selected{/if}>{rate_title} - {rate_price}</option>
{/exp:cartthrob:get_shipping_options}
</select>
<input type="submit" value="Update Cart" />
{/exp:cartthrob:update_cart_form}
{/if}
{/if}
{/exp:cartthrob:cart_items_info}
{!-- CHECKOUT --}
{exp:cartthrob:checkout_form return="checkout/order_status" gateway="paypal_express"
required="first_name|last_name|address|city|zip|country_code|shipping_address|shipping_city|shipping_zip|shipping_country_code|email_address"
}
{if total_items > 0}
<h3>Payment:</h3>
{gateway_fields}
<input type="submit" value="Checkout with Paypal" />
{/if}
{/exp:cartthrob:checkout_form}
Quick note: I also tried
{if segment_2 == "order_status"}but this is probably irrelevant