Skip to content

Instantly share code, notes, and snippets.

View lscoates's full-sized avatar

Luke Scoates lscoates

View GitHub Profile
var shipping_only = "You must first specify your Shipping Country"
var billing_only = "You must first specify your Billing Country"
var billing_or_shipping = "You must first specify your Billing or Shipping Country"
var shipping_or_billing = "You must first specify your Shipping or Billing Country"
$('#subscription_customer_attributes_country').change(function(e) {
var error_message = $("#long_vat_message").text();
if ((e.target.value !== "") && ((error_message === shipping_only) || (error_message === billing_or_shipping) || (error_message === shipping_or_billing))) {
hideVatErrorMessage();
// EXAMPLE of ID in the URL https://subdomain.chargify.com/setup/metafields/1033/edit
$(document).ready(function(){
var customLabel = $("label[for='subscription_metafields_XXX']");
customLabel.text(customLabel.text() + " *");
});
var customInput = $("#subscription_metafields_XXX");
var form = $("#signup-form");
var submitBtn = $("#subscription_submit");
//Limits both Billing and Shipping Countries to the US
$(function() {
$('.form__field--country select').find('option').remove();
$('.form__field--country select').append('<option value="US" checked="checked">United States</option>');
$('.form__field--country select').change();
});
$(document).ready(function() {
var organizationLabel = $('label[for="subscription_customer_attributes_organization"]');
organizationLabel.text(organizationLabel.text() + " *");
});
var form = $("#signup-form");
var organization = $("#subscription_customer_attributes_organization");
var submitBtn = $("#subscription_submit")
submitBtn.click(function() {
$(document).ready(function() {
var phoneLabel = $('label[for="subscription_customer_attributes_phone"]');
phoneLabel.text(phoneLabel.text() + " *");
});
var form = $("form:first");
var phone = $("#subscription_customer_attributes_phone");
var submitBtn = $("#subscription_submit")
submitBtn.click(function(){
function hideRecurringLineItem() {
$('#summary-recurring-charges').hide();
$('.plan__summary-component').hide();
};
$(document).bind("afterSummaryRefresh", hideRecurringLineItem);
// Just put what you want the setup fee text to be in the PLACE TEXT HERE placeholder
function changeSetupFee() {
var setupfee = $("#summary-setup-fee .plan__summary-table-row-label");
var text = setupfee.text().replace('Setup Fee', 'PLACE TEXT HERE');
setupfee.text(text);
};
$(document).bind("afterSummaryRefresh", changeSetupFee);
// CONFIGURE YOUR PLAN
$('.form__section--configure-plan h3').html("CONFIGURE YOUR PLAN");
$('#form__section-apply-components').html("UPDATE TOTALS");
$('#form__section-apply-components').data("loading-text", "<i class='fa fa-refresh fa-spin fa-fw'></i> UPDATING...");
$('#form__section-apply-components').data("button-text", "UPDATE TOTALS");
// COUPON CODE
$('.form__section--coupon h3').html("COUPON CODE");
$('#coupon_button').html("APPLY CODE");
$('#coupon_button').data("loading-text", "<i class='fa fa-refresh fa-spin fa-fw'></i> APPLYING...");
// Replace the values in `fieldLabel` and `field` with the field you want to add validations too.
// This example shows how you would require Organization.
$(document).ready(function() {
var fieldLabel = $('label[for="subscription_customer_attributes_organization"]');
fieldLabel.text(fieldLabel.text() + " *");
});
var field = $("#subscription_customer_attributes_organization");
var form = $("#signup-form");
/*
Name: PSP CSS Cheatsheet
Author: Bob Orchard
*/
/* Body Classes */
.public-signup-page {} /* Both Signup and Success Pages */
.public-signup-page__signup {}
.public-signup-page__success {}