The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-08-2018, 01:35 AM
Demi Hou's Avatar
Demi Hou Demi Hou is offline
 
Join Date: Jun 2015
Posts: 18
Default "Next-gen look and feel of product pages on the storefront" breaks "$('.ecwid-" javascript

If turn on feature Next-gen look and feel of product pages on the storefront,
my javascript (partial shown below) breaks.
I'm guessing the .ecwid syntax has changed. anyone know how to fix?

Ecwid.OnPageLoaded.add(function(page) {

/// MGM/hotel override deliver instructions
if (page.type == "CHECKOUT_PAYMENT_DETAILS") {
document.querySelector(".ecwid-PaymentCommentsBlock .ecwid-Checkout-blockTitle").innerHTML = "Enter optional notes regarding the order. Deliveries start at 10:30am. Orders placed after 10am for same-day will go out starting 4-5pm. For special delivery times, please contact us at 702-423-8590.";
}

// This script used by product Options for custom date picker. it is implemented by defining a Text box name 'Delivery Date'
// for each product you want to support.
// Code should go into header of MGM landing page


// lock in 'Message for Gift Card' to 150 chars
$('.ecwid-productoption-Message_for_gift_card').prop('maxLength','150');

// setup for before 5pm order time
var todayBefore
var dt = new Date();
var time = dt.getHours();
if(time < 17) {
todayBefore = 0
} else {
todayBefore = 1
}

// If MGM (starts with M and has 3 letters before -), must order before 5pm
if (page.type == "PRODUCT" && (SKU.charAt( 0 ) == "M" && SKU.charAt( 3 ) == "-") && !((SKU == "MGW-0004") || (SKU == "MFF-0011") || (SKU == "MGO-0020"))) {
function datepicker() {
$('.ecwid-productoption-Delivery_Date').prop('readOnly', true);
$(".ecwid-productoption-Delivery_Date").datepicker({
showOn: "button",
buttonImage: "http://demisgiftbaskets.com/docs/Calendar.png",
buttonImageOnly: true,
// before 5pm
minDate: todayBefore,
buttonText: "Select MGM delivery date: " + SKU,
firstDay: 1,
beforeShowDay: $.datepicker.Weekends
});
};
datepicker();
}
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:53 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.