LAT APPAREL - Ladies' Curvy Fine Jersey Tee - 3816 (2024)

Add to Wish List

'; colorsSwatchHtml += '

'; } else { //Code for Hexa Codes //console.log('single code '); if (slcColorLabel === 'All Colors') return true; if (selectedColor == '') selectedColor = colorData.slc_color_id; if (selectedColorKey == '') selectedColorKey = key; var slcColorLabelArray = slcColorLabel.split("-"); var slcColorCodeArray = slcColorLabelArray[1].split("~"); if (slcColorCodeArray.length == 1) { //Swatch with one color colorsSwatchHtml += '

'; colorsSwatchHtml += '

'; colorsSwatchHtml += '

'+colorName+'

'; colorsSwatchHtml += '

'; } else if (slcColorCodeArray.length == 2 || slcColorCodeArray.length == 3) { //Swatch with 2 colors var colorClass = 'two-color'; if (slcColorCodeArray.length == 3) { colorClass = 'three-color'; } colorsSwatchHtml += '

'; for (var j=0;j

'; } colorsSwatchHtml += '

'+colorName+'

'; colorsSwatchHtml += '

'; } } colorDropdownHtml += '

'; }); colorDropdownHtml +=''; //colorsSwatchHtml += '

Colors Available:

'; $('.allcolor-wrapper').html(colorsSwatchHtml); $('.select-wrapper').html(colorDropdownHtml); changeColor(); /** * Looping the available sizes to build the table header row. */ var sizeHeader = '

'; $.each(AvailableSizes, function(sizeLabel, sortOrder){ sizeHeader += ''+sizeLabel+''; }); console.log('user logged in === '+userLoggedIn); console.log('selected color == '+selectedColor); //console.log('selected warehouse == '+selectedWarehouse); if (userLoggedIn != 0) { sizeHeader += ''; } $('#super-product-table').html(sizeHeader); return colorsSwatchHtml; } function notify(customer_id, product_id,warehouse,size,selectedColor,sourceCode) { var status = jQuery('#notify_'+product_id+'_'+warehouse).prop("checked"); jQuery.ajax({ type: "GET", url: '/customscript/ajax/notify', data: "customer_id=" + customer_id + "&product_id=" + product_id + "&status=" + status + "&warehouse=" + warehouse, success: function (result) { // if(globalData.child_by_color[selectedColor][size].notify_warehouses === undefined){ globalData.child_by_color[selectedColor][size.split('_').join(' ')].notify_warehouses=sourceCode; // } globalData.child_by_color[selectedColor][size.split('_').join(' ')].notify_status = status; jQuery('#ogData').val(JSON.stringify(globalData)); console.log(result); globalAlert({ title: 'Notify Me', content: result }); //alert(result); } }); }; function WHinfo(warehouse, product_id) { jQuery('#product_addtocart_form').mage('validation', { }); if (jQuery('#product_addtocart_form').valid() !== false) { jQuery.ajax({ type: "GET", url: '/customization/product/warehouse', data: "warehouse=" + warehouse + "&product_id=" + product_id }); } } function changeWarehouse() { $ = jQuery; $("#wh_store").change(function () { var wrVal = $(this).val(); $("#super-product-table tbody").show(); if(wrVal == "ALL") { $("#super-product-table tbody").find("tr[wh-data]").show(); }else { $("#super-product-table tbody").each(function(){ var base = $(this); base.find("tr[wh-data]").hide(); base.find("tr[wh-data]").each(function(){ if($(this).attr("wh-data") == wrVal){ $(this).show(); } }); }); $("#super-product-table tbody").each(function(){ if ($(this).has("> tr[wh-data]:visible").length === 0){ $(this).hide(); } }); } }); } function changeColor() { $ = jQuery; $('#color_option').change(function(){ var selectedColor = $(this).val(); var selectedColorKey = $('option:selected',this).attr('color_key'); console.log('Came to change color option '+selectedColor+' == '+selectedColorKey); if (selectedColorKey == 'all_color') { $('table#super-product-table tbody').remove(); $('#color_option > option').each(function(index){ if(index > 0) { switchColor(this.value, $(this).attr('color_key'),'all_color'); jQuery('#color_option').find('option[value="'+this.value+'"]').removeAttr("selected"); } }); jQuery('#color_option').find('option[value="all_color"]').attr("selected", "selected"); jQuery('#color_option').val('all_color'); } else { switchColor(selectedColor, selectedColorKey, 'single_color'); } }); } /** * This function is used to switch b/w the colors and render the table grid and reload the warehouse dropdown. * @param selectedColor */ function switchColor(selectedColor, selectedColorKey, noOfColors = 'single_color') { var swatchBaseUrl = jQuery('#color_swatch_image_url').val(); console.log('came to switch color '+ selectedColor+'== kee == '+selectedColorKey); var globalData = jQuery('#ogData').val(); globalData = JSON.parse(globalData); jQuery('div#global-box-tocart').remove(); if (globalData == '' || selectedColor == '') return false; var getSelectedColorData = globalData.child_by_color[selectedColor]; /** * Remove active class first **/ jQuery('.swatch-item').each(function(){ jQuery(this).removeClass('_active'); }); jQuery('#swatch_'+selectedColor).addClass('_active'); jQuery('#color_option > option').each(function(){ jQuery(this).removeAttr("selected"); }); //console.log(getSelectedColorData); var selectedColorTitle = globalData.colors_data[selectedColorKey].color_label; selectedColorTitle = selectedColorTitle.replaceAll('|', ''); //To Update the active selected color label. jQuery('#active-color').html(selectedColorTitle); var gridHtml = ''; gridHtml += ''; if (selectedColorKey == 'ALL') selectedColorKey='ALL_Colors'; var slcColorLabel = globalData.colors_data[selectedColorKey].slc_color_label; if (slcColorLabel.indexOf(':') > -1) { //If the swatch is image var slcColorLabelArray = slcColorLabel.split(":"); gridHtml += ''; } else { var slcColorLabelArray = slcColorLabel.split("-"); var slcColorCodeArray = slcColorLabelArray[1].split("~"); if (slcColorCodeArray.length == 1) { //Swatch with one color gridHtml += ''; } else if (slcColorCodeArray.length == 2 || slcColorCodeArray.length == 3) { var gridClose = ''; for (var j=0;j'; gridClose += ''; } else { var width = 'width: 33.33%;'; if (j == 0) { floatClass = 'float:left;'; width = 'width: 100%;'; } gridHtml += '

'; if (j > 0) { gridHtml += '

'; } gridClose = ''; } } gridHtml += gridClose; } } gridHtml += '
'+selectedColorTitle+''; gridHtml += 'Price'; /** * Price render if the user is logged in */ var sizes = globalData.all_sizes; if (globalData.is_user_logged_in > 0) { console.log('came to price render '); var priceData = globalData.custom_price_data; var tierPriceData = globalData.tier_price_data; jQuery.each(sizes, function(size, sortOrder){ var sizeData = getSelectedColorData[size]; if (sizeData == undefined) { gridHtml += ''; } else { console.log(sizeData); var productPrice = priceData[sizeData.sku]; if (productPrice == undefined) { //If the Deal price is not available, look for tier price by group //console.log(sizeData); productPrice = tierPriceData[sizeData.sku]; } if (productPrice == undefined) { //If the deal price and tier price are not there, normal price productPrice = sizeData.price; } gridHtml += '

$'+productPrice; gridHtml += '

'; } }); } /** * Inventory Render and loop by available warehouses */ if (globalData.hasOwnProperty('available_warehouses_by_color') && globalData.available_warehouses_by_color.hasOwnProperty((selectedColor))) { var availableWarehouses = globalData.available_warehouses_by_color[selectedColor]; var allSources = globalData.all_source_details; globalAddToCartStatus = false; var orangeStatus = false; jQuery.each(allSources, function(sourceCode,SourceName){ if (!availableWarehouses.hasOwnProperty(sourceCode)) { delete allSources[sourceCode]; } }); jQuery.each(allSources, function(sourceCode,source){ if (globalData.logged == true && globalData.customer_email!='' && jQuery.inArray(globalData.customer_email, globalData.limit_emails)!= -1 && jQuery.inArray(source.source_description, globalData.limit_warehouses)!= -1) { delete allSources[sourceCode]; // return false; } }); var notLoggedIn = ''; if (globalData.is_user_logged_in <= 0) { notLoggedIn = 'notloginQty'; } var WarehouseDropdownHtml = ''; // var orangeStatus = ''; jQuery.each(allSources, function(sourceCode,source){ /** * Here we have added the logic to hide the warehouse, w.r.t the store configuration mentioned restrict Sku * */ let hidewarehouseSKus = allSources[sourceCode]['hidewarehouse_skus']; if(hidewarehouseSKus.length > 0 && jQuery.inArray(globalData['parent_sku'], hidewarehouseSKus) !== -1) { return; } gridHtml += ''; gridHtml += ''; gridHtml += ''+source.source_name; gridHtml += ''; gridHtml += ''; gridHtml += 'Inventory'; var wHAddtoCartStatus = false; var productId = ''; //Loop Each size and get Inventory jQuery.each(sizes, function(size, sortOrder) { var sizeData = getSelectedColorData[size] if (sizeData == undefined) { //gridHtml += ''; gridHtml += ''; } else { productId = sizeData.entity_id; var priceData = globalData.custom_price_data; var tierPriceData = globalData.tier_price_data; var productMobilePrice = priceData[sizeData.sku]; if (productMobilePrice == undefined) { //If the Deal price is not available, look for tier price by group //console.log(sizeData); productMobilePrice = tierPriceData[sizeData.sku]; } if (productMobilePrice == undefined) { //If the deal price and tier price are not there, normal price productMobilePrice = sizeData.price; } console.log('size data from inventory loop') if (globalData.is_user_logged_in > 0) { gridHtml += ''; if (sizeData.hasOwnProperty('quantity_per_source') && sizeData.quantity_per_source.hasOwnProperty(sourceCode) && sizeData.quantity_per_source[sourceCode] > 0) { var QtyLabel = sizeData.quantity_per_source[sourceCode]; if (QtyLabel >= 500) QtyLabel = '500+'; gridHtml += '

'; console.log(jQuery.inArray(source.source_description, globalData.orange_warehouses)); console.log("asdf"); if (jQuery.inArray(source.source_description, globalData.orange_warehouses) != -1 || jQuery.inArray(sizeData.sku, globalData.orange_skus) != -1) { gridHtml += '

' + QtyLabel + '

'; } else { gridHtml += '

' + QtyLabel + '

'; } gridHtml += '';gridHtml += '

'; if (globalData.child_by_color[selectedColor][size] !== undefined) { if(globalData.child_by_color[selectedColor][size].qty_increment !== undefined){ if(globalData.child_by_color[selectedColor][size].qty_increment[sourceCode] > 0){ gridHtml += '

'; gridHtml += 'Minimum order quantity per Size:'+globalData.child_by_color[selectedColor][size].qty_increment[sourceCode]; gridHtml += '

'; } } } gridHtml += ''; globalAddToCartStatus = true; wHAddtoCartStatus = true; } else { // Show notify me option if (globalData.child_by_color[selectedColor][size].notify_status && globalData.child_by_color[selectedColor][size].notify_warehouses == sourceCode) { gridHtml += '

Notify Me

'; } else { gridHtml += '

Notify Me

'; } } gridHtml += ''; } else { gridHtml += ''; gridHtml += '

XXX

'; } } }); /** * Display the Addtocart button if the user is logged in and any of the size has inventory */ if (globalData.is_user_logged_in > 0 && wHAddtoCartStatus) { gridHtml += ''; gridHtml += ''; } else { gridHtml += ''; } /** * Build the warehouse dropdown html */ WarehouseDropdownHtml += ''; }); } else { var sizesLength = Object.keys(globalData.all_sizes).length + 2; globalAddToCartStatus = false; gridHtml += '

No warehouses has been available for the selected color

'; } console.log(noOfColors); if (noOfColors == 'single_color') { jQuery('table#super-product-table tbody').remove(); jQuery('table#super-product-table thead').after(gridHtml); jQuery('#color_option').find('option[value="'+selectedColor+'"]').attr("selected", "selected"); jQuery('#color_option').val(selectedColor); } else if(noOfColors == 'all_color') { var tbody = jQuery('table#super-product-table').find('tbody'); if (tbody.length == 0) { jQuery('table#super-product-table thead').after(gridHtml); } else { jQuery('table#super-product-table tbody:last-child').after(gridHtml); } } jQuery('#wh_store').html(WarehouseDropdownHtml); changeWarehouse(); /** * Update the Image based on the selection **/ if (globalData.image_urls.hasOwnProperty(selectedColor)) { var SimpleProdImage = globalData.image_urls[selectedColor]; jQuery(".fotorama__active").attr('href',SimpleProdImage); jQuery(".fotorama__active").html('LAT APPAREL - Ladies' Curvy Fine Jersey Tee - 3816 (2)LAT APPAREL - Ladies' Curvy Fine Jersey Tee - 3816 (3)'); } //Sticky issue /*setTimeout(function() { if (jQuery("#super-product-table").length && jQuery("#super-product-table").height() > 250) { jQuery("#super-product-table").stickyTableHeaders(); } },1000);*/ /** * Adding the Global Addto Cart button */ console.log('globalAddToCartStatus == '+globalAddToCartStatus); console.log('= sttus 2' + jQuery('div#global-box-tocart').length); if (globalAddToCartStatus == true && jQuery('div#global-box-tocart').length == 0) { var globalAddToCartHtml = '

'; globalAddToCartHtml += '

'; jQuery('#product_addtocart_form').append(globalAddToCartHtml); } else { //console.log('Came to else == '+globalAddToCartStatus); jQuery('.box-tocart').remove(); } } function hideLoader() { if (jQuery('.loading-mask').length) { jQuery('.loading-mask').hide(); } else { console.log('hide loader called and no loading div active') } }

Skip to the end of the images gallery

LAT APPAREL - Ladies' Curvy Fine Jersey Tee - 3816 (4)

Skip to the beginning of the images gallery

Description

  • 60% combed ringspun cotton / 40% polyester fine jersey, 4.5 oz.
  • Heather is 90% combed ringspun cotton / 10% polyester
  • Natural Heather is 100% combed ringspun cotton
  • Ribbed collar
  • Self-fabric back neck tape
  • Double needle sleeves and bottom hem
  • Side seam construction
  • EasyTear™ label
  • Fit:Ladies' Curvy - Full-Figured for a flattering fit.
  • Sizes:1 (14-16), 2 (18-20), 3 (22-24), 4 (26-28)

ALL INVENTORY QUANTITIES IN ORANGE ARE NON-RETURNABLE. ALL SALES ARE FINAL.

I have a solid background in web development, particularly in JavaScript and jQuery, which are essential technologies for creating dynamic and interactive web pages. I've successfully implemented various features and functionalities in web applications, including complex logic, AJAX requests, and dynamic content updates.

Looking at the provided code snippet, it appears to be a part of a JavaScript script responsible for handling color and size variations, as well as inventory management, for an e-commerce product page. The code is designed to dynamically update the displayed product information based on user selections, such as color and size. Below is an analysis of the key concepts and functions used in the code:

  1. Color and Size Swatches:

    • The script generates HTML for color swatches based on the available colors and their associated codes.
    • It dynamically updates the color swatches and the dropdown menu for color selection.
    • Swatches are created based on the number of colors available, and the script distinguishes between one, two, or three-color swatches.
  2. Size Handling:

    • The script dynamically generates a table header with available sizes.
    • It retrieves size information from the AvailableSizes object and builds the table header accordingly.
    • The changeColor() function is responsible for handling color changes and triggering the update of the displayed sizes.
  3. Inventory Management:

    • The script manages inventory information for each size and color combination.
    • It displays the available quantity for each size and color combination, and it includes a "Notify Me" option for out-of-stock items.
    • The "Add to Cart" functionality is implemented based on the available inventory.
    • The script handles multiple warehouses, allowing users to filter products based on warehouse selection.
  4. AJAX Requests:

    • The script uses AJAX to asynchronously communicate with the server for notifying users about product availability.
    • It fetches warehouse and product information based on user actions without requiring a full page reload.
  5. User Interface Updates:

    • The script dynamically updates the product image, color label, and price based on user selections.
    • It handles the display of information for both logged-in and non-logged-in users.
  6. Styling and Layout:

    • The script includes styling elements such as swatch colors, table structure, and dropdown menus to enhance the user interface.
  7. Miscellaneous:

    • The script includes functions like WHinfo, changeWarehouse, notify, and hideLoader to handle various aspects of the user interaction and page behavior.

Overall, the code is well-organized and modular, demonstrating a deep understanding of JavaScript, jQuery, and AJAX for creating a dynamic and responsive e-commerce product page.

LAT APPAREL - Ladies' Curvy Fine Jersey Tee - 3816 (2024)

References

Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 5853

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.