function dmLoad() { if ($('.page-productdetails .product-title:contains("booklet")').length > 0) { if ($(".product-sheets-container")[0]) { if ($(".product-pages-container")[0]) { $('.product-sheets-container input').attr('disabled', true); $(this).on("keyup", function() { var pages = $('.product-pages-container input').val(); $('.product-sheets-container input').val(pages / 4); }); } } } }
function dmLoad() { if ($('.page-productdetails .product-title:contains("YOUR PRODUCT NAME HERE")').length > 0) { function requireInk() { if ($(".product-single-sided-black-sheets-container input").val() == "" && $(".product-single-sided-color-sheets-container input").val() == "" && $(".product-double-sided-black-sheets-container input").val() == "" && $(".product-double-sided-color-sheets-container input").val() == "" && $(".product-double-sided-mixed-sheets-container input").val() == "") { $("#btnAddToCart").addClass("disabled2"); } else { $("#btnAddToCart").removeClass("disabled2"); } $("input").on("keyup", function() { requireInk(); }); } requireInk(); } }
.disabled2 { pointer-events: none !important; cursor: not-allowed !important; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; opacity: .65; }
$(document).ready(function() { $('.product-orderdue-container').each(function() { $(this).insertBefore('#upnlResourcePanel'); }); function ConvertDropdownToButtons(dropdownField, classes, reverse) { var dropdownValue = dropdownField.val(); var dropdownId = dropdownField.attr("id"); $(dropdownField).parent().addClass('button-container'); $(dropdownField) .find("option") .each(function() { if ($(this).val()) { var btn = $('<div id="' + $(this).val() + '" data-value="' + $(this).val() + '" data-target="' + dropdownId + '" class="' + classes + '">' + $(this).text() + "</div>"); if ($(this).val() == dropdownValue) { btn.addClass("selected active"); } if (reverse === true) { btn.insertAfter(dropdownField); } else { btn.insertBefore(dropdownField); } btn.on("click", function() { var selected = $(this).hasClass("selected active"); var target = $(this).data("target"); var value = $(this).data("value"); $('.btn-dropdown[data-target="' + target + '"]').removeClass("selected active"); if (selected) { $(this).removeClass("selected active"); } else { $(this).addClass("selected active"); } try { var selectorAll = "#" + target + " option"; $(selectorAll).removeAttr("selected"); if (!selected) { $(dropdownField).val($(this).data("value")).change(); } else { $(dropdownField).get(0).selectedIndex = 0; if ($(dropdownField).val() !== '') { $("#" + $(dropdownField).val()).addClass("selected active"); } $(dropdownField).change(); } } catch (e) {} return false; }); } }); } ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_0"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_1"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_2"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_3"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_4"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_5"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_6"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_7"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_8"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_9"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductAttributeList_10"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlProductOptions"), ("btn-dropdown btn btn-default")); ConvertDropdownToButtons($(".page-productdetails #ddlOrderTargetDate"), ("btn-dropdown btn btn-default")); }); function dmLoad() { $(".page-productdetails .button-container .select2").hide(); $(".page-checkout .button-container select").hide(); $('#upnlResourcePanel .product-orderdue-container').remove(); }
.page-productdetails label:not(#fulFileUpload_button) { width: 100%; } .btn-dropdown { min-width: 24%; margin: .5%; margin-bottom: 8px; border-radius: 5px; padding: 6px; }
If you have any ideas for portal customizations you'd like to see us tackle or need help implementing any of this code, email our support team at support@docketmanager.ca