Hi,
I've nearly completed my cart implementation and am at the stage of testing a coupon code - when I apply it I get my flash message "Your coupon discount has been applied!" but the price / discount etc does not show on the page.
This is my template code for checkout.php - It's as per the example with a few layout adjustments to suit my template, unless I am missing something
Also - I've set shipping on each product and that breakdown does not show.
I've nearly completed my cart implementation and am at the stage of testing a coupon code - when I apply it I get my flash message "Your coupon discount has been applied!" but the price / discount etc does not show on the page.
This is my template code for checkout.php - It's as per the example with a few layout adjustments to suit my template, unless I am missing something
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:no_cache />
<cms:embed 'header.inc' />
<cms:embed 'masthead.inc' />
<cms:embed 'breadcrumbs.inc' />
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Checkout <small>Review your order and checkout</small></h1>
</div>
<cms:if "<cms:pp_count_items />" >
<div class="alert">
Please review your order before we proceed to PayPal to make the payment. <br>
If you have a discount coupon, please apply it below.
</div>
<table class="table table-striped" id="cart">
<thead>
<tr>
<th class="col-desc">Item</th>
<th class="col-quantity">Qty</th>
<th class="col-price">Price</th>
<th class="col-subtotal">Total</th>
</tr>
</thead>
<tbody>
<cms:pp_cart_items>
<tr>
<td class="col-desc">
<a href="<cms:show link />" class="cart-thumb">
<img src="<cms:show product_thumb />" width="70" height="64" alt="<cms:show title />">
</a>
<div class="desc-box">
<a href="<cms:show link />"><cms:show title /></a>
<p><cms:pp_selected_options separator='<br>' /></p>
</div>
</td>
<td class="col-quantity"><cms:show quantity /></td>
<td class="col-price">
<cms:if line_discount><span class="compare-price"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format orig_price /></span></cms:if>
<cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format price />
</td>
<td class="col-subtotal"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format line_total /></td>
</tr>
</cms:pp_cart_items>
<cms:if "<cms:pp_discount />" || "<cms:pp_shipping />" || "<cms:pp_taxes />" >
<tr class="row-extras">
<td class="col-extras-label" colspan="3">Subtotal</td>
<td class="col-extras"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format "<cms:pp_sub_total />" /></td>
</tr>
</cms:if>
<cms:if "<cms:pp_discount />">
<tr class="row-extras">
<td class="col-extras-label" colspan="3">Discount:</td>
<td class="col-extras col-discount"><span class="subtract">-</span><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format "<cms:pp_discount />" /></td>
</tr>
</cms:if>
<cms:if "<cms:pp_shipping />">
<tr class="row-extras">
<td class="col-extras-label" colspan="3">Shipping:</td>
<td class="col-extras"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format "<cms:pp_shipping />" /></td>
</tr>
</cms:if>
<cms:if "<cms:pp_taxes />">
<tr class="row-extras">
<td class="col-extras-label" colspan="3">Taxes:</td>
<td class="col-extras"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format "<cms:pp_taxes />" /></td>
</tr>
</cms:if>
<tr class="row-total">
<td class="col-total-label" colspan="3">Total:</td>
<td class="col-total"><cms:get_custom_field 'store_currency' masterpage='globals.php' /><cms:number_format "<cms:pp_total />" /></td>
</tr>
</tbody>
</table>
<div class="cart-operations">
<div class="coupon-box pull-left">
<!-- START COUPON FORM -->
<cms:form method="post" anchor='0'>
<cms:if k_success >
<cms:pages masterpage="<cms:pp_config 'tpl_coupons' />" custom_field="code==<cms:show frm_coupon_code /> | end_date>=<cms:date format='Y-m-d' />" limit='1'>
<cms:no_results>
<cms:delete_session 'coupon_found' />
<cms:delete_session 'coupon_code' />
<cms:delete_session 'coupon_discount' />
<cms:delete_session 'coupon_type' />
<cms:delete_session 'coupon_min_amount' />
<cms:delete_session 'coupon_free_shipping' />
<cms:set_flash name='coupon_flash_msg' value="<p class='error'>Coupon is invalid or expired!</p>" />
<cms:pp_refresh_cart />
</cms:no_results>
<cms:set_session name='coupon_found' value='1' />
<cms:set_session name='coupon_code' value=code />
<cms:set_session name='coupon_discount' value=discount />
<cms:set_session name='coupon_type' value=type />
<cms:set_session name='coupon_min_amount' value=min_amount />
<cms:set_session name='coupon_free_shipping' value=free_shipping />
<cms:if min_amount ge "<cms:pp_sub_total />" >
<cms:set_flash name='coupon_flash_msg' value="<p class='notice'>Coupon discount will be applied when cart total is more than <cms:pp_config 'currency_symbol' /><cms:show min_amount />!</p>" />
<cms:else />
<cms:set_flash name='coupon_flash_msg' value="<p class='success'>Your coupon discount has been applied!</p>" />
</cms:if>
<cms:pp_refresh_cart />
</cms:pages>
<cms:redirect k_page_link />
</cms:if>
<div class="input-append input-prepend">
<cms:input type="text" placeholder="Enter coupon code" name="coupon_code" value="<cms:get_session 'coupon_code' />" class="coupon-input"/>
<button type="submit" class="btn coupon-button"/>Apply Coupon</button>
</div>
<cms:get_flash 'coupon_flash_msg' />
</cms:form>
<!-- END COUPON FORM -->
</div>
<cms:form method="post" anchor='0'>
<cms:if k_success >
<cms:pp_payment_gateway empty_cart='0' />
</cms:if>
<div class="pull-right">
<a href="<cms:pp_cart_link />" class="btn" >Edit Cart</a>
<cms:input name="paypal" class="btn btn-primary checkout-button" type="submit" value="Continue to PayPal" />
</div>
</cms:form>
</div>
<cms:else />
<div class="message">
<p class="info">Your cart is empty!</p>
</div>
</cms:if>
</div>
</div>
</div>
<cms:embed 'footer.inc' />
<?php COUCH::invoke(); ?>
Also - I've set shipping on each product and that breakdown does not show.