Sha256: 94d02b5083d605fdeadf339ff190db9ba7716562a6e67773f5c0c3dbf85cc8d7
Contents?: true
Size: 1.07 KB
Versions: 26
Compression:
Stored size: 1.07 KB
Contents
Spree.showProductAddedModal = function(product, variant) { var modalSelector = '.product-added-modal' var nameSelector = '.product-added-modal-product-details-name' var priceSelector = '.product-added-modal-product-details-price' var imageSelector = '.product-added-modal-product-image-container-image' var modalNoImageClass = 'product-added-modal--no-image' var price = variant.display_price var images = variant && variant.images.length > 0 ? variant.images : product.images var name = product.name var leadImage = images.length === 0 ? null : images[0] var $modal = $(modalSelector) $modal.find(nameSelector).text(name) $modal.find(priceSelector).html(price) if (leadImage !== null) { $modal .removeClass(modalNoImageClass) .find(imageSelector) .attr('src', leadImage.url_product) .attr('alt', leadImage.alt || name) } else { $modal.addClass(modalNoImageClass) } $modal.modal() } Spree.hideProductAddedModal = function() { var modalSelector = '.product-added-modal' var $modal = $(modalSelector) $modal.modal('hide') }
Version data entries
26 entries across 26 versions & 1 rubygems