Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Good Evening!

I am in the process of modifying Couch Cart as the current site I am working on needs it for Quote Request Submission with no payment.

I have based my edits on the suggestion in this thread (but started this new request since the original was in a different Couch forum):
https://www.couchcms.com/forum/viewtopic.php?f=2&t=8665&p=16756&hilit=cart+don%27t+want+paypal#p16756

I know I must be missing something fairly small, because the form function seems to be fine but no email sent/received.

Any assistance greatly appreciated. I will follow up with the contents of my cart page etc.

Thanks! :)
Posting separately to keep things organized.

Here are the contents of my cart page in progress:

Code: Select all
<?php require_once 'couch/cms.php'; ?>
<cms:template title='Quote Request' />
<cms:no_cache />
<!doctype html>
<html>
<head>
   <meta charset="utf-8">
   <title>Your Quote Request</title>
   <link href="css/styles.css?v=8" rel="stylesheet" media="screen,projection" type="text/css">
   <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,700" rel="stylesheet" media="screen,projection" type="text/css">
   <!--[if lt IE 9]>
      <script src="js/ie9.js" type="text/javascript"></script>
   <![endif]-->
</head>
<body>
   <div class="page-wrap">
      <header>
         <div class="header">
            <a href="<cms:link "<cms:pp_config 'tpl_products' />" />" class="logo">Couch<span class="color">Cart</span></a>
         </div>
         <nav>
            <ul>
               <li class="nav-button">
                  <a href="<cms:link "<cms:pp_config 'tpl_products' />" />" class="nav">Products</a>
               </li>
                    <li class="nav-button">
                  <a href="<cms:pp_cart_link />" class="nav">My Quote Request</a>
               </li>
               <li class="nav-button">
                  <a href="<cms:pp_cart_link />" class="nav cart"><span class="quantity"><cms:pp_count_items /></span> item(s)</a>
               </li>
            </ul>
         </nav>
      </header>

      <section>
         <cms:set order_complete_msg="<cms:get_flash 'order_complete_msg' />" /> 
          <cms:if order_complete_msg >
              <cms:show order_complete_msg />
             <cms:else />
             
            <cms:if "<cms:pp_count_items />" >
         <div class="row">
            <div class="twelve columns">

               <table>
                  <thead>
                     <tr>
                        <th class="col-desc"  colspan="4">Item</th>
                        <th class="col-quantity">Qty</th>
                     </tr>
                  </thead>
                  <tbody>
                            <cms:pp_cart_items>
                                <tr>
                                    <td class="col-desc"  colspan="4">
                                        <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>
                                </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>
                               
                     <tr class="row-total">
                        <td class="col-total-label" colspan="4"></td>
                        <td class="col-total"><input class="button update-button" type="submit" value="Update Quantities"></td>
                     </tr>
                  </tbody>
               </table>               

                  <cms:form method="post" anchor='0'>
               
                         <div class="form-group">
                             <label for="name" class="col-sm-4 control-label">Your Name&#58;
                             </label>
                             <div class="col-sm-8">
                               <cms:input type='text' name='name' id='name' class="form-control" placeholder='First Last' required='1' />
                               <cms:if k_error_name>
                                    <p id='name_error' class='error txtred'>Please include your full name.</p>
                               </cms:if>
                             </div>
                        </div>

                        <div class="form-group">
                             <label for="name" class="col-sm-4 control-label">Company Name&#58;
                             </label>
                             <div class="col-sm-8">
                               <cms:input type='text' name='company' id='company' class="form-control" placeholder='Company' />
                             </div>
                        </div>

                        <div class="form-group">
                             <label for="name" class="col-sm-4 control-label">Phone&#58;
                             </label>
                             <div class="col-sm-8">
                               <cms:input type='text' name='phone' id='phone' class="form-control" placeholder='Contact Phone' />
                             </div>
                        </div>

                        <div class="form-group">
                             <label for="email" class="col-sm-4 control-label">Your Email Address&#58;
                             </label>
                           <div class="col-sm-8">
                                <cms:input type='text' name='email' id='email' class="form-control" placeholder='you&#64;domain.com' required='1' validator='email' />
                                <cms:if k_error_email>
                                  <p id='email_error' class='error txtred'>Please enter a valid email address.</p>
                                </cms:if>
                             </div>
                        </div>
               
               
                         <input class="button"  name="submit" type="submit" value="Request My Quote" />

                         <cms:if k_success >
                               <cms:set email_from='order@company.com' />   
                             <cms:set email_bcc='info@company.com' />   
                             <cms:set email_subject='Quote Request' />
                               <cms:set email_debug='1' />   
                   
                             <cms:embed 'sales_email.html' />   

                             <cms:set_flash name='order_complete_msg' value="<cms:embed 'sales_success_msg.html' />"/>
                   
                             <cms:pp_empty_cart />
                             <cms:redirect k_page_link />
                         </cms:if>
                  </cms:form>
               </cms:if> 
            </div>
         </div>
           
            <cms:else />
               <div class="message">
                     <p class="info">There are no items in your Quote Request!</p>
               </div>
           </cms:if>
        </section>
   </div>
   <div class="footer-wrap">
      <div class="footer-bar">
         <p><span class="powered-by">Powered by <a href="http://www.couchcms.com/">CouchCMS</a></span>
         </p>
      </div>
   </div>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
   <script src="js/input-restriction.js" type="text/javascript"></script>
</body>
</html>
<?php COUCH::invoke(); ?>
And the contents of <cms:embed 'sales_email.html' /> (contained in the snippets folder):

Code: Select all
<cms:send_mail from=email_from to=frm_email bcc=email_bcc subject=email_subject debug=email_debug>

   <cms:show frm_name />

   Thank you for your order.

   Your request for a quote has been confirmed &amp; we will be in touch shortly.

   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_discount />">Discount: -$<cms:number_format "<cms:pp_discount />" />
   </cms:if>
   <cms:if "<cms:pp_shipping />">Shipping: $<cms:number_format "<cms:pp_shipping />" />
   </cms:if>
   <cms:if "<cms:pp_taxes />">Taxes: $<cms:number_format "<cms:pp_taxes />" />
   </cms:if>


   Delivery Address:
   <cms:show frm_address />

</cms:send_mail>
@jamager, please spend a few seconds to make code look nice.
ScreenCut-03-22---07-28-37-.png
code formatting
ScreenCut-03-22---07-28-37-.png (29.54 KiB) Viewed 3396 times
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thanks!
@jamager,

Nothing seems to be wrong with the coding, as far as I can see.
As to why the email is not being sent, I suggest you please use the alternative email addon (viewtopic.php?f=5&t=10750). It will provide more detailed report about any problems in the mail sending process on your server.

If the problem turns out to be the mail() function being disabled on your server, you may ask your host about the SMTP creds and use that instead (or use your Gmail account).

Hope it helps. Please let us know how things go.
The problem seems to be solved.

Thank you so much for your review and input. I had assumed that I must have done something wrong as I am new to using Couch and coding beyond HTML & CSS is not my forte.

I contacted support for the site's host. They stepped away from LiveChat for a while, came back with an email test that went through just fine and everything worked perfectly after that. I don't know what they changed on their end (Turning it off and on again? :D ) but everything works now, so I can keep working too!

Thanks again and have a good evening!
7 posts Page 1 of 1
cron