I am nearly there with couchcms and integrating couchcart into a clients, I add the product to the cart which has a checkout button on it which if clicked on goes to PayPal to pay which is good but I would like a order email confirmation sent to the customer and to the admin. I found this link where KK said the checkout.php can be modified
Would the following work on cart.php
- Code: Select all
https://www.couchcms.com/forum/viewtopic.php?f=2&t=7413
Would the following work on cart.php
- Code: Select all
<cms:if "<cms:pp_count_items />" >
<div class="container">
<div class="row">
<div class="col-sm-12">
<h2 class="page-heading sbheading"> <span class="page-heading-title">Shopping Basket</span> </h2>
<cms:pp_cart_form>
<table>
<thead>
<tr>
<th class="col-remove"> </th>
<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-remove"><a href="<cms:pp_remove_item_link />" class="cart-remove" title="Remove">×<span class="screen-reader">Remove</span></a></td>
<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"><input name="qty[<cms:show line_id />]" class="quantity-input" type="number" min="0" step="1" value="<cms:show quantity />" title="Quantity"></td>
<td class="col-price">
<cms:if line_discount><span class="compare-price">£<cms:number_format orig_price /></span></cms:if>
£<cms:number_format price />
</td>
<td class="col-subtotal">£<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="4">Subtotal</td>
<td class="col-extras">£<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="4">Discount:</td>
<td class="col-extras col-discount"><span class="subtract">-</span>£<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="4">Shipping:</td>
<td class="col-extras">£<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="4">Taxes:</td>
<td class="col-extras">£<cms:number_format "<cms:pp_taxes />" /></td>
</tr>
</cms:if>
<tr class="row-total">
<td class="col-total-label" colspan="4">Total:</td>
<td class="col-total">£<cms:number_format "<cms:pp_total />" /></td>
</tr>
</tbody>
</table>
<div class="cart-operations">
<div class="checkout-box">
<input class="button checkout-button" type="submit" name="checkout" value="Checkout">
</div>
<div class="update-box">
<input class="button update-button" type="submit" value="Update Quantities">
</div>
</div>
</cms:pp_cart_form>
</div>
</div>
</div>
<cms:form method="post" anchor='1'>
<cms:get_flash 'success_flash_msg' />
<cms:if k_success >
<cms:send_mail from='adminemailaddress@domain.co.uk' to=frm_email bcc='customeremailaddress@domain.co.uk' subject='Your order with XYZ' debug='1'>
Thank you for your order, <cms:show frm_name />.
Your order has been confirmed and is being processed. Here is the summary:
Items Ordered:<cms:pp_cart_items>
<cms:show title />. <cms:pp_selected_options separator=', ' /> (<cms:show quantity /> qty) - $<cms:number_format line_total /></cms:pp_cart_items>
<cms:if "<cms:pp_shipping />">Shipping: $<cms:number_format "<cms:pp_shipping />" /></cms:if>
Delivery Address:
<cms:show frm_address />
</cms:send_mail>
<cms:set_flash name='success_flash_msg' value="<p class='success'>Thank you for your order!</p>" />
<cms:redirect k_page_link />
</cms:if>
</cms:if>