Hello!
We’ve had some issues where orders would not process after clicking the Paypal button. I’ve now discovered that removing the custom field “phone number” makes it possible to order again.
When the custom field is added, this happens:
Dev tools console:
snipcart.js:1 A 'cart-confirmation' error occured in Snipcart.
Reason: 'domain-crawling-failed'
--- Item 1 ---
[Item ID] omitted
[Item Unique ID] e4d1c810-c039-4f16-817f-921dd776b6ca
[Item Name] omitted
[Url] omitted
[Status] Unreachable
[Price in cart] 20
[Crawled prices] []
[Details] We have not been able to reach the item at URL: omitted. The URL must be available publicly. We suggest you take a look at the Security section of our documentation (http://docs.snipcart.com/getting-started/security) to understand how the validation works. You can also take a look at this post that shows how to develop locally with Snipcart (https://snipcart.com/blog/develop-a-snipcart-powered-website-locally-using-ngrok).
--- Item 2 ---
[Item ID] omitted
[Item Unique ID] 839c987b-9df9-452f-889c-34733155b2de
[Item Name] omitted
[Url] omitted
[Status] Unreachable
[Price in cart] 20
[Crawled prices] []
[Details] We have not been able to reach the item at URL: omitted. The URL must be available publicly. We suggest you take a look at the Security section of our documentation (http://docs.snipcart.com/getting-started/security) to understand how the validation works. You can also take a look at this post that shows how to develop locally with Snipcart (https://snipcart.com/blog/develop-a-snipcart-powered-website-locally-using-ngrok).
{kind: 'cart-confirmation', reason: 'domain-crawling-failed', technicalReason: {…}, data: Array(2), code: 'snipcart.errors.order_validation.domain_crawling', …}
If I remove templatesURL from the script tag, it works again:
<script>
window.SnipcartSettings = {
publicApiKey: omitted,
loadStrategy: "on-user-interaction",
// templatesUrl: "/snipcart-templates.html",
modalStyle: "side",
version: "3.4.0"
};
(function(){var c,d;(d=(c=window.SnipcartSettings).version)!=null||(c.version="3.0");var s,S;(S=(s=window.SnipcartSettings).currency)!=null||(s.currency="usd");var l,p;(p=(l=window.SnipcartSettings).timeoutDuration)!=null||(l.timeoutDuration=2750);var w,u;(u=(w=window.SnipcartSettings).domain)!=null||(w.domain="cdn.snipcart.com");var m,g;(g=(m=window.SnipcartSettings).protocol)!=null||(m.protocol="https");var f,v;(v=(f=window.SnipcartSettings).loadCSS)!=null||(f.loadCSS=!0);var E=window.SnipcartSettings.version.includes("v3.0.0-ci")||window.SnipcartSettings.version!="3.0"&&window.SnipcartSettings.version.localeCompare("3.4.0",void 0,{numeric:!0,sensitivity:"base"})===-1,y=["focus","mouseover","touchmove","scroll","keydown"];window.LoadSnipcart=o;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();function r(){window.SnipcartSettings.loadStrategy?window.SnipcartSettings.loadStrategy==="on-user-interaction"&&(y.forEach(function(t){return document.addEventListener(t,o)}),setTimeout(o,window.SnipcartSettings.timeoutDuration)):o()}var a=!1;function o(){if(a)return;a=!0;let t=document.getElementsByTagName("head")[0],n=document.querySelector("#snipcart"),i=document.querySelector('src[src^="'.concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,'"][src$="snipcart.js"]')),e=document.querySelector('link[href^="'.concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,'"][href$="snipcart.css"]'));n||(n=document.createElement("div"),n.id="snipcart",n.setAttribute("hidden","true"),document.body.appendChild(n)),$(n),i||(i=document.createElement("script"),i.src="".concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,"/themes/v").concat(window.SnipcartSettings.version,"/default/snipcart.js"),i.async=!0,t.appendChild(i)),!e&&window.SnipcartSettings.loadCSS&&(e=document.createElement("link"),e.rel="stylesheet",e.type="text/css",e.href="".concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,"/themes/v").concat(window.SnipcartSettings.version,"/default/snipcart.css"),t.prepend(e)),y.forEach(function(h){return document.removeEventListener(h,o)})}function $(t){!E||(t.dataset.apiKey=window.SnipcartSettings.publicApiKey,window.SnipcartSettings.addProductBehavior&&(t.dataset.configAddProductBehavior=window.SnipcartSettings.addProductBehavior),window.SnipcartSettings.modalStyle&&(t.dataset.configModalStyle=window.SnipcartSettings.modalStyle),window.SnipcartSettings.currency&&(t.dataset.currency=window.SnipcartSettings.currency),window.SnipcartSettings.templatesUrl&&(t.dataset.templatesUrl=window.SnipcartSettings.templatesUrl))}})();
</script>
and snipcart-templates.html contains:
<!DOCTYPE html>
<html>
<head><title>Templates</title></head>
<body>
<div id="snipcart-templates">
<address-fields section="top">
<div>
<snipcart-label for="phone">
Phone number
</snipcart-label>
<snipcart-input name="phone">
</snipcart-input>
</div>
</address-fields>
</div>
</body>
</html>
Ideas on how to solve this? We need the phone number for shipping.