Site URL: https://disc-tangerine-2xzy.squarespace.com/
Hi all,
In March I was approached by a potential client who sold cakes via a Squarespace website and wanted to set up a means for customers to schedule to pick up their orders. I did a ton of research and figured out code which embedded a scheduling iframe on the cart page only (huge shout outs to @codeandtonic, @creedon, @paul2009 and others whose answers on various Squarespace Forum helped me work out the code). Everything worked perfectly until 2 days ago when the scheduling iframe suddenly disappeared. I've gone in and I think the reason for it disappearing was Squarespace's 'New Client Scheduling Page' activating, but I've reverted it back to the original and I still can't work out how to get the iframe back.
My final working code was:
<!---jquery--->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!---acuity--->
<script src="https://embed.acuityscheduling.com/js/embed.js" type="text/javascript"></script>
<!---START scheduling WORKING--->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', init);
window.addEventListener('mercury:load', init);
function init(){
jQuery.noConflict()(function ($) {
window.Squarespace.onInitialize(Y, function(){
// cart page condition
if(window.location.pathname.startsWith("/cart")){
// acuity iframe
var acuityIframe = '<div id="spacer-before-acuity"></div><h3 class="cart-title">CHOOSE PICKUP TIME</h3><iframe src="https://app.squarespacescheduling.com/schedule.php?owner=19092763"title="Pick Up Order" width="100%" height=540" frameBorder="0"></iframe>';
// iframe after cart container
$(acuityIframe).insertAfter(".cart-container");
}
window.onload=init;
});
});
}
</script>
<!---END scheduling WORKING--->
I'm quite lost on what to do now. Firefox is currently sometimes showing the iframe, but not reliably, and it took ages to work out the right code without disabling Ajax previously. If anyone has any insight, it would be so appreciated! Thank you!
Password: hello