Created
November 22, 2017 05:53
-
-
Save aayushdrolia/15d68a6ca6a637dae3685d9f564e9b29 to your computer and use it in GitHub Desktop.
FB checkout js and css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var customerName = $('#billing_first_name').val(); | |
var noteCharacter = 0; | |
var billingName = "you"; | |
var time = $('body > div.container.page-container > div > ul > li > div > span').text().replace(':', ''); | |
$("#shipping_myfield12").val(''); | |
$( ".prev" ).click(function() { | |
$(".next").prop("disabled",false); | |
$('.next').css( 'cursor', 'pointer' ); | |
$('.next').css( 'background-color', '#edcc35' ); | |
}); | |
$( "html" ).on("tap",function(){ | |
if ($("#timeline-3").hasClass("active")) { | |
if ( $( ".shippingError" ).length ) { | |
$(".next").prop("disabled",true); | |
} | |
} | |
}); | |
$( "html" ).mouseover(function() { | |
if ($("#timeline-3").hasClass("active")) { | |
if ( $( ".DeliveryError" ).length ) { | |
$(".next").prop("disabled",true); | |
$('.next').css( 'cursor', 'not-allowed' ); | |
$('.next').css( 'background-color', '#eee' ); | |
}else { | |
$(".next").prop("disabled",false); | |
$('.next').css( 'cursor', 'pointer' ); | |
$('.next').css( 'background-color', '#edcc35' ); | |
} | |
} | |
}); | |
$('#billing_first_name').keyup(function() { | |
var billingName = $('#billing_first_name').val(); | |
$(".customerName").html(billingName); | |
}); | |
$("#ship-to-different-address").children().bind('click', function(){ return false; }); | |
$( ".woocommerce-billing-fields h3" ).html("<br><span style='display:inline-block; text-transform:none; color:black !important; font-size:23px; font-family:Roboto !important'>Hey <span class='customerName'>" + customerName + "</span>!</span><br>"); | |
$("#order_review_heading").html("<span style='display:inline-block; text-transform:none; color:black !important; font-size:23px; font-family:Roboto !important'>Let's break it down</span>"); | |
$("#payment_heading").html("<span style='display:inline-block; text-transform:none; color:black !important; font-size:23px; font-family:Roboto !important'>The last step</span>") | |
$( ".woocommerce-billing-fields h3" ).append( "<span style='display:inline-block; color:black !important; text-transform:none; font-size:14px; color:#8a8c8e !important;'>Who's footing the bill?</span>" ); | |
$('#ship-to-different-address-checkbox').prop('checked', true); | |
$( "#ship-to-different-address label" ).html("Who's the lucky recipient?<br><span class='littleYellow'><a class='addressbookClick' style='color:#8a8c8e !important;' href='#'>Pick a name from your little black book</span></a>"); | |
$("#order_comments_field label").html("Delivery Instructions"); | |
$( "#ship-to-different-address label" ).prepend("<br><span style='display:inline-block; text-transform:uppercase; color:black !important; font-size:14px; font-family:Roboto !important; color:#8a8c8e !important;'>You're crushing it <span class='customerName'>" + customerName + "</span>!</span><br>"); | |
$("#shipping_myfield12_field label").removeClass("hidden"); | |
$("#shipping_myfield12_field").append("<div class='theirTextBox'>IT WILL LOOK LIKE THIS:<br><span class='theirText'></span></div>"); | |
var maxLength = 200; | |
$('#shipping_myfield12').keyup(function() { | |
var length = $(this).val().length; | |
var length = maxLength-length; | |
$('#chars').text(length); | |
var messageText = $('#shipping_myfield12').val(); | |
$(".theirText").html(messageText); | |
}); | |
$("#delivery_date_field label").after("<br>"); | |
$("#shipping_myfield12").attr('maxlength','200'); | |
$("#shipping_myfield12_field label").html("Message Card: <span id='chars'>200</span> characters remaining"); | |
$(".prev").click(function () { | |
$("#form_actions").hide().delay(500).fadeIn(); | |
}); | |
$(".next").click(function () { | |
$("#form_actions").hide().delay(500).fadeIn(); | |
}); | |
$("#form_actions").after("<div class='continueShopping'><a href='http://flowerbombers.staging.wpengine.com/'>< Continue Shopping</a></div>"); | |
$(document).ready(function() { | |
$( ".next" ).show(); | |
if ($('.newCustomerText').is(':visible')) { | |
$( ".next" ).hide(); | |
} else { | |
$( ".next" ).show(); | |
} | |
if ( $( ".order_details.order-details-list" ).length ) { | |
console.log("here"); | |
$( ".checkoutShow" ).show(); | |
} | |
}); | |
$( ".next" ).click(function() { | |
event.preventDefault(); | |
}); | |
$("label[for='e_deliverydate']").after('<br>'); | |
$('.alert.alert-success.def-m').after("<span style='line-height:inherit; width:100%; text-align:center; display:inline-block; text-transform:none;padding-top:5%; color:black !important; font-size:40px; font-family:Roboto !important'>Well done! Your order has been placed.</span><br><span style='display:inline-block; font-size: 1.5em !important; color: black !important; padding-top: 1% !important; padding-bottom:1%;width:100%; text-align:center;'class='littleYellow'>They're gonna love it!</span>"); | |
$('#order_comments').attr("placeholder", "Tell us any details to help us get these beautiful blooms to the right recipient. Crazy dog? Gate code? Mean receptionist? Friendly neighbor that can take it?"); | |
$(".next").click(function() { | |
if ($(".woocommerce-invalid-required-field")[0]){ | |
$('html, body').animate({ | |
scrollTop: $(".woocommerce-invalid-required-field").offset().top - 340 | |
}, 100); | |
} | |
}); | |
$(".addressbookClick").click(function() { | |
$('#address_book_field').slideDown(); | |
}); | |
$('#select2-shipping_state-result-r4fk-AL').html("Select State"); | |
$("#e_deliverydate").click(function () { | |
var time = $('span.digits.clock_1000').text().replace(':', ''); | |
console.log("test"); | |
var itime = parseInt(time); | |
console.log(itime); | |
console.log(time); | |
if( itime > 1400) { | |
console.log("higher"); | |
$('.ui-datepicker-today').css("pointer-events", "none"); | |
$('.ui-datepicker-today').removeClass("todayDelivery"); | |
}else { | |
console.log("lower"); | |
$('.ui-datepicker-today').css("pointer-events", "all !important"); | |
$('.ui-datepicker-today').addClass("todayDelivery"); | |
} | |
}); | |
$('tax-rate > th').html("TAX"); | |
$('#shipping_myfield4').attr("placeholder", "Mobile Phone - This helps us locate your lucky recipient *"); | |
$('.my_account_orders').after("<span style='font-size:18px;' class='renewText'>We hope you're in love with us and will want to renew. We won't do it automatically though."); | |
$(".shop_table_responsive > tbody > tr:nth-child(2) > th").html("mobile"); | |
/*---------------------------------------------------------------- JS ENDS HERE--------------------------------*/ | |
/*-----------------------------------CSS STARTS HERE------------------------------------------------------------*/ | |
#checkout_login > div > div > form > p:nth-child(1) { | |
text-align: center; | |
color: white; | |
} | |
.footerstillhere { | |
display:none; | |
} | |
.yellowhandwritingfooter { | |
display:none; | |
} | |
#checkout_coupon { | |
display:block !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment