Tomato Trellis Garden on Wheels (2024)

Tomato Trellis Garden on Wheels (1)

Brand:[BRAND]
[TITLE]
SKU:[SKU]

SRP:[GRP]

SRP:[SRP]
WHSL:[WHSL]
" + addToCart + "

"; //var paginator = "

View All Results

"; //paginator = "

View All Results

"; var selectHeader = "'; } var minQty = 1; var maxQty = 99999999; var intervalQty = 1; if (prod.hydrofarmProduct.Warehouse != null) { if (prod.hydrofarmProduct.Warehouse.LowestQty > 1) { minQty = prod.hydrofarmProduct.Warehouse.LowestQty; } if (prod.hydrofarmProduct.Warehouse.HighestQty > 1) { maxQty = prod.hydrofarmProduct.Warehouse.HighestQty; } if (prod.hydrofarmProduct.Warehouse.MultipleQty > 1) { intervalQty = prod.hydrofarmProduct.Warehouse.MultipleQty; } } var defaultImage = getDefaultImage(prod); var base = template.replace("[IMG]", defaultImage) var isRmaOnly = "False"; //if not published or RMA only, then remove add to control and quantity controls if (!prod.published || isRmaOnly == "True" || prod.hydrofarmProduct.IsKit) { base = base.replace(addToCart, ""); } var isAvailable = prod.hydrofarmProduct.IsAvailable; var isQuote = prod.hydrofarmProduct.IsQuote; var isPreorder = prod.hydrofarmProduct.IsPreorder; var isVDS = prod.hydrofarmProduct.VDSOnly; //console.log('available: ' + isAvailable); if (!isAvailable || isQuote || isVDS) { //console.log('isAvailable: ' + isAvailable); // removes actions base = base.replace(addToCart, ""); // removes pricing base = base.replace("
WHSL:[WHSL]", ""); } if (isPreorder) { base = base.replace("[ADDLABEL]", "Preorder"); base = base.replace("[ADDPREORDERCLASS]", ""); } else if (isQuote) { base = base.replace("[ADDLABEL]", "Request a Quote"); base = base.replace("[ADDPREORDERCLASS]", ""); } else { base = base.replace("[ADDLABEL]", "Add to Cart"); base = base.replace("[ADDPREORDERCLASS]", ""); } if (base.indexOf('webimages') > 0) base = base.replace("[ERROR]", "onerror='this.src=\"" + defaultImage.replace('thumbs/', '') + "\"'"); else base = base.replace("[ERROR]", ""); base = base.replace("[MINQTY]", minQty).replace("[MINQTY]", minQty); base = base.replace("[MAXQTY]", maxQty); base = base.replace("[INTQTY]", intervalQty).replace("[INTQTY]", intervalQty); base = base.replace("[TITLE]", prod.label); base = base.replace("[ARIALABEL]", prod.label); base = base.replace("[ID]", prod.productId); base = base.replace("[INPUTID]", "qty_search_"+prod.productId); base = base.replace("[LINK]",prod.producturl); base = base.replace("[SKU]",prod.hydrofarmProduct.Sku); base = base.replace("[BRAND]",prod.hydrofarmProduct.Brand); base = base.replace("[SRP]", "$" + prod.hydrofarmProduct.RetailPrice + " " + "USD"); base = base.replace("[GRP]", "$" + prod.hydrofarmProduct.RetailPrice + " " + "USD"); var restrictWholesalePrice = "false"; //console.log('restrictWholesalePrice: ' + restrictWholesalePrice); if (restrictWholesalePrice === 'true') { base = base.replace("
WHSL:[WHSL]", ""); } else { base = base.replace("[WHSL]", "$" + prod.hydrofarmProduct.WholeSalePrice + " " + "USD"); } if (prod.hydrofarmProduct.WholeSalePrice == "TBD") { //console.log("Finding TBD"); //then no pricing, don't allow add to cart base = base.replace('guest_pricing d-none', 'guest_pricing'); base = base.replace('product_pricing', 'product_pricing d-none'); } base = base.replace("[UOM_SELECT]",baseSelect); items.push(base); } //TODO: Get this setup if (products[0].hasNextPage) items.push(paginator.replace($("#search_input_9e2c5b3bbe8344a39dc41857beff6180").val())); $('#search_container_9e2c5b3bbe8344a39dc41857beff6180 .search_dropdown_wrapper').html(items); $('#search_container_9e2c5b3bbe8344a39dc41857beff6180 .search_dropdown_wrapper').removeClass('d-none'); $('#search_container_9e2c5b3bbe8344a39dc41857beff6180 .search_dropdown').removeClass('d-none'); //Sets qty-controls disabled class var $qty = $('.qty-act').parents('.qty-controls').find('.qty-input'); var $theInput = document.getElementById($qty.attr("id")); if ($theInput) { if ($theInput.value <= 1 || $theInput.value == null) { $(".qty-act.minus-qty").addClass("disabled"); } } } //$('.search-box #search-dropdown-more-results').on('keydown', function (e) { // e.preventDefault(); // var keycode = (e.keyCode ? e.keyCode : e.which); // if (keycode == '13') { // $("#HeaderSearch_9e2c5b3bbe8344a39dc41857beff6180").click(); // } //}); function search() { console.dir('search'); if (!$('#search_container_9e2c5b3bbe8344a39dc41857beff6180 .category_dropdown').hasClass('d-none')) closeSearchDropdown(); var minLength = 3; var searchTerm = $("#search_input_9e2c5b3bbe8344a39dc41857beff6180").val(); if (searchTerm.length < minLength) { if (!initialSearch) populate([]); return; } $(".search-box #search-dropdown-more-results").on({ click: function () { $("#HeaderSearch_9e2c5b3bbe8344a39dc41857beff6180").click(); }, keypress: function (e) { e.preventDefault(); var keycode = (e.keyCode ? e.keyCode : e.which); if (keycode == '13') { $("#HeaderSearch_9e2c5b3bbe8344a39dc41857beff6180").click(); } } }); initialSearch = false; var searchItemsToReturn = 10; $('#auto_search_icon_9e2c5b3bbe8344a39dc41857beff6180').toggleClass('d-none'); $('#auto_search_loading_9e2c5b3bbe8344a39dc41857beff6180').toggleClass('d-none'); $.ajax({ url: '/searchtermautocomplete', dataType:'json', data: { term: searchTerm, catId: parseInt($("#search_category_select_9e2c5b3bbe8344a39dc41857beff6180 .selected").attr("data-id")), pageSize: searchItemsToReturn }, success: function (data) { //console.log('Response',data); populate(data.Products); $('#auto_search_icon_9e2c5b3bbe8344a39dc41857beff6180').toggleClass('d-none'); $('#auto_search_loading_9e2c5b3bbe8344a39dc41857beff6180').toggleClass('d-none'); if(data.Products.length > searchItemsToReturn - 1) { $('.search-box #search-dropdown-more-results-wrapper').removeClass('d-none'); } else { $('.search-box #search-dropdown-more-results-wrapper').addClass('d-none'); } }, error: AjaxCart.ajaxFailure }); } function addToCartCustom(element) { var attribute = $(element).prev().find('select'); var attributeName = $(element).prev().find('select').attr('name'); var attributeOption = attribute.find(":selected").val(); var id = $(element).attr('data-id'); var quantity = $(element).parent().find('input').val(); AjaxCart.setLoadWaiting(true); $.ajax({ url: "/addproducttocart/details/" + id.toString() + "/1", type: "POST", data: [{ name: attributeName, value: parseInt(attributeOption, 10) }, { name: "addtocart_" + id.toString() + ".EnteredQuantity", value: parseInt(quantity, 10) }], success: function (data) { AjaxCart.success_process(data); if (typeof cartModel !== 'undefined') { cartModel.assignCartItems({ model: data.cartModel }); } else{ console.error("Missing cart model"); } }, complete: AjaxCart.resetLoadWaiting, error: function () { AjaxCart.ajaxFailure(); AjaxCart.resetLoadWaiting(); } }); } function isNumber(input) { if (input === '' || typeof input === 'undefined') return false; let regex = new RegExp(/[^0-9]/, 'g'); return (input.match(regex) === null); } function incrementNumber(element, amount){ $(element).val(parseInt(element.val(),10) + amount); } function validateInput(element){ var inputValue = element.val(); if (isNumber(inputValue)) { var intValue = parseInt(inputValue,10); $(element).val(intValue); } else { $(element).val(1); } } //wait for query to load var typeAheadDebounce = function (func, timeout = 300) { var waitTimer = null; return function (...args) { clearTimeout(waitTimer); waitTimer = setTimeout(function () { func.apply(this, args); }, timeout); }; } document.addEventListener('DOMContentLoaded', function load() { if (!window.jQuery) return setTimeout(load, 50); var debounceSearch = typeAheadDebounce(function () { search() }); $("#search_input_9e2c5b3bbe8344a39dc41857beff6180").keyup(function() { debounceSearch(); //search(); }); $("#search_category_select_9e2c5b3bbe8344a39dc41857beff6180").change(function() { debounceSearch(); //search(); }); /* $(".search_dropdown").on("click", ".add_button", function (event) { var input = $(this).parent().prev(); incrementNumber(input, 1); }); $(".search_dropdown").on("click", ".remove_button", function(event){ var input = $(this).parent().next(); if(parseInt(input.val(),10) === 1) return; incrementNumber(input, -1); }); $(".search_dropdown").on("blur", ".quantity_input", function(event){ validateInput($(this)); }); */ $("#search_container_9e2c5b3bbe8344a39dc41857beff6180 .search_dropdown").on("click", ".add_to_cart_button_custom", function(event) { addToCartCustom($(this)); }); $("#search_container_9e2c5b3bbe8344a39dc41857beff6180 .search_container").on("click", "#category_open_9e2c5b3bbe8344a39dc41857beff6180", function(event) { $("#search_container_9e2c5b3bbe8344a39dc41857beff6180 .category_dropdown").toggleClass('d-none'); }); //intercept enter event to redirect to search page if input is focused $(document).on('keyup', function (e) { var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; if (key == 13) { var activeElement = $(document.activeElement); var catID = $("#search_category_select_9e2c5b3bbe8344a39dc41857beff6180").val(); if (activeElement.prop("id") === "search_input_9e2c5b3bbe8344a39dc41857beff6180" && activeElement.val() !== '' && typeof activeElement.val() !== 'undefined' ) { e.preventDefault(); //console.log("enter within search input"); window.location.href = "/search?q=" + encodeURIComponent(activeElement.val()) + "&isc=true&sid=true&cid=" + catID; } } }); $(document).ready(function () { $("#HeaderSearch_9e2c5b3bbe8344a39dc41857beff6180").click(function () { var activeElement = $("#search_input_9e2c5b3bbe8344a39dc41857beff6180"); var catID = $("#search_category_select_9e2c5b3bbe8344a39dc41857beff6180").val(); if (activeElement.val() !== '' && typeof activeElement.val() !== 'undefined') { //console.log("enter within search input"); window.location.href = "/search?q=" + encodeURIComponent(activeElement.val()) + "&isc=true&sid=true&cid=" + catID; } }); }); }, false); })(jQuery);

Tomato Trellis Garden on Wheels (2024)
Top Articles
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 6147

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.