keat Posted February 16, 2016 Share Posted February 16, 2016 On some of my contact forms, I'm using a very primitive capture method (don't ask its manual) I spotted re-capture in store settings, so created a re-capture account and site key etc. However, the google instructions mention dropping the code inside the <head> tags, which the documents editor doesn't show. Is there an easy way to use this ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 16, 2016 Share Posted February 16, 2016 The admin Editor is used only to compose the actual Document content, Product Description, Category Description, and HTML email content. CubeCart is not coded to edit skin template files (as you may have seen in Wordpress, and other applications). Find the /skins/YOUR_SKIN/templates/main.php (and main.checkout.php, if it exists) template, open it in a programmer's text editor, and add the code with this editor. It is critically important that any braces in this code be surrounded by white-space: var = {['name','address']}; // BAD var = { ['name','address'] }; // GOOD Otherwise, Smarty will think what is inside the braces belongs to it. Quote Link to comment Share on other sites More sharing options...
keat Posted February 16, 2016 Author Share Posted February 16, 2016 I'll take that as a no then Quote Link to comment Share on other sites More sharing options...
keat Posted February 17, 2016 Author Share Posted February 17, 2016 If there is no simple way to apply recapture to site documents or contact forms, then what is the purpose of the recapture facility in the store settings. I'm a liitle confused. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 17, 2016 Share Posted February 17, 2016 Site Documents are (supposed to be) read-only. Nothing was envisioned to have a SiteDoc be interactive. The Contact Form is not really a SiteDoc. If the Store Setting, Features tab, "Enable Recaptcha" is enabled, then customers will see a captcha on the Contact Us page. CubeCart keeps a session variable that will cause the captha to NOT show once a captcha on any page has been successful. For example, a successful verification on the Registration page will cause no additional captchas to appear on the Product Review, Checkout, Contact Us, or anywhere else -- for that session. If you are not seeing a captcha on the Contact Us page (not a part of the admin, Contact Form, Content tab), then maybe you already solved one on some other page. Quote Link to comment Share on other sites More sharing options...
keat Posted February 17, 2016 Author Share Posted February 17, 2016 My site imported all the contact and info pages from the V3 upgrade, so I havn't used the built in V6 contact form. I may have a look, however, I'm guessing it wont do what we want. We have a few contact forms, eg, one where the customer would fill out a form to obtain a catalogue download. And another, where a customer could recommend a friend or product. I have a home made capture on these pages, but it's pretty poor. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 18, 2016 Share Posted February 18, 2016 CC6's Contact Form feature allows you to create a list of "departments". The visitor filling out the Contact Us form can choose which department the form will be emailed to. However, there is no separate "Contents" that can be created specific to each department -- not without creating a plugin. Quote Link to comment Share on other sites More sharing options...
keat Posted February 18, 2016 Author Share Posted February 18, 2016 As my site already had the V3 contact form, i felt no need to create another one. Since ctreating the new V6 contact form, I now see the re-capture and all makes perfect sense. Quote Link to comment Share on other sites More sharing options...
keat Posted March 4, 2016 Author Share Posted March 4, 2016 Having found the contact form and it's ability to email multiple departments from one point, I deleted my V3 forms in favour of this. I've enable recapture and it works just fine. However, the store admin recommends 'New Re-Capture'. I've enabled this and configured my keys etc, but nothing appears. I guess I'm not overly concerned as re-capture is far superior to what I had before, but if 'New Re-Capture' is stronger, i would prefer this. Is there anything else I should be doing to get this to work ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 4, 2016 Share Posted March 4, 2016 Please remind us of the skin name and version of that skin you are using. In Foundation, for example, the template content.recaptcha.php has this: {if $RECAPTCHA==='2'}<!-- New reCaptcha --> {if empty($CONFIG.recaptcha_public_key) || empty($CONFIG.recaptcha_secret_key)} <p>{$LANG.form.recaptcha_key_not_set}</p> {else} <div class="g-recaptcha" data-sitekey="{$CONFIG.recaptcha_public_key}"></div> {/if} {else} <!-- what to display if RECAPTCHA is not "New reCaptcha" --> This is paired with code in the template content.recaptcha.head.php: {if $RECAPTCHA==='2'}<script src='https://www.google.com/recaptcha/api.js'></script>{/if} So, if your skin does not have these two files, or is not coded for the "New reCaptcha" feature in the version of CC6 you have installed, then that may explain why you don't see it. Assuming you haven't already solved a reCaptcha for this session. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 I'm using Mican Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 Another conversation on the forums discusses using a skin originally developed for CC5. We can find the Foundation skin code that displays the "New reCaptcha" and incorporate that into the CC5 skin. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 Recapture is far far superior to the made up rubbish I had on V3. The Mican skin fits almost perfectly with our company logo, the boss loves the look and feel, so we decided to adopt it, unbeknown that it may cause a few issues, I started working around it. Unless a foundation skin comes along that wows the boss, then Mican is probably here to stay. If it's easy to incorporate 'New Re-Capture' into Mican, then I'm more than happy to tinker. If not, then I'm happy to keep what we have. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 Ok, let's do this. In the Mican /templates/ folder, create a new file. content.recaptcha.head.php ========================== {if $RECAPTCHA==='2'}<script src='https://www.google.com/recaptcha/api.js'></script>{/if} In the Mican /templates/ folder, edit: main.php ============== Find: {if $FBOG} <meta property="og:image" content="{$PRODUCT.thumbnail}"> <meta property="og:url" content="{$VAL_SELF}"> {/if} Add After: {include file='templates/content.recaptcha.head.php'} In the Mican /templates/ folder, edit: content.recaptcha.php ====================== Find: <legend>{$LANG.form.verify_human}</legend> Add After: {if $RECAPTCHA==='2'} {if empty($CONFIG.recaptcha_public_key) || empty($CONFIG.recaptcha_secret_key)} <p>{$LANG.form.recaptcha_key_not_set}</p> {else} <div class="g-recaptcha" data-sitekey="{$CONFIG.recaptcha_public_key}"></div> {/if} {else} Find: {$DISPLAY_RECAPTCHA} Add After: {/if} Since we have edited templates, be sure to clear the cache (admin, Maintenance, Rebuild tab, Clear Cache). Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 I made the changes, but I don't see any Recapture image Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 5, 2016 Share Posted March 5, 2016 If CC thinks the recaptcha was satisfied at some point in a session you will not see the recaptcha again. So, just to be sure, clear out not only all the CC cache, but your browser as well. You need to get rid of any session cookies. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 If I switch back to standard, the image appears. Also, on the New one, I do see a message 'prove you are human' but no image Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 As a test, in admin, Store Settings, Features tab, completely blank the New reCaptcha site and secret key fields. Be sure "New reCaptcha (Recommended) is chosen. Click the Save button. On the storefront, view the Register page. You should see: Verify you are a human reCaptcha public and/or private key has not been set! That shows that some, if not all, of the edit in content.recaptcha.php is correct. Next, have your browser show you the Source HTML. You should see:<script src='https://www.google.com/recaptcha/api.js'> somewhere in the <head> section. Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 Hold on 5, i think i rolled back the skin when it didn't work. with the keys removed, I do see 'Keys not set' message in the page source I only see this though. <fieldset id="recaptcha-title"> <legend>Verify you are a human</legend> <p>reCAPTCHA public and/or private key has not been set!</p> </fieldset> content.recaptcha.php {if $RECAPTCHA} <fieldset id="recaptcha-title"> <legend>{$LANG.form.verify_human}</legend> {if $RECAPTCHA==='2'} {if empty($CONFIG.recaptcha_public_key) || empty($CONFIG.recaptcha_secret_key)} <p>{$LANG.form.recaptcha_key_not_set}</p> {else} <div class="g-recaptcha" data-sitekey="{$CONFIG.recaptcha_public_key}"></div> {/if} {else} <script type="text/javascript"> var RecaptchaOptions = { theme : 'clean' }; </script> {$DISPLAY_RECAPTCHA} {/if} </fieldset> {/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 In the <head> section, do you see:<script src='https://www.google.com/recaptcha/api.js'> Quote Link to comment Share on other sites More sharing options...
keat Posted March 5, 2016 Author Share Posted March 5, 2016 I did a search on 'recap' and that's all that showed. If I switch to the old recapture I do see lots more reference to 'recap' Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 5, 2016 Share Posted March 5, 2016 I think the edit in the template main.php did not stick. Quote Link to comment Share on other sites More sharing options...
keat Posted March 6, 2016 Author Share Posted March 6, 2016 Doh. I dropped the edit before the {/if} Quote Link to comment Share on other sites More sharing options...
keat Posted March 6, 2016 Author Share Posted March 6, 2016 Had a thought today whilst on the trian to the city. As i only modified the Mican skin, then anyone trying to register via the mobile skin would have the same issue. I was right. Thankfully, we have mobile internet, so I swiftly rolled back to the old Re-Capture. Would these edits be much the same for the Mobile skin ??? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 6, 2016 Share Posted March 6, 2016 These edits would be appropriate for any and all skins that were originally coded for CC5. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.