This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#where-to-append').append( | |
`<div class="container"> | |
<p>${obj.content}</p> | |
</div>` | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var product_id = {{product.id}}; | |
var key = 'asdasdasdasd'; | |
$.get('https://api.yotpo.com/v1/widget/'+key+'/products/'+product_id+'/reviews.json', function(data){ | |
var reviews = data.response.reviews; | |
//console.log(reviews); | |
//console.log(reviews.length); | |
if(reviews.length != 0){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign heading = 'You may also like' %} | |
<div id="related-product-from-cart-items" class="featured-product-items"> | |
{% assign tag = '' %} | |
{% assign prod_handle = '' %} | |
{% assign item_handle = '' %} | |
{% for item in cart.items %} | |
{% assign item_handle = item_handle | append: item.product.handle | append: ';' %} | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add the custom field on checkout page | |
*/ | |
add_action( 'woocommerce_after_checkout_billing_form', 'display_extra_fields_after_billing_address' , 10, 1 ); | |
function display_extra_fields_after_billing_address () { | |
_e( "Delivery Date: ", "add_extra_fields"); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var seen = {}; | |
$('a').each(function() { | |
var txt = $(this).text(); | |
if (seen[txt]) | |
$(this).remove(); | |
else | |
seen[txt] = true; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//header.php | |
(function($){ | |
$(document).ready(function(){ | |
var cart_count = $('.cart-customlocation').text(); | |
var cart_element = `<span>${cart_count}</span>`; | |
var cart_menu = $("#menu-user-menu").children('li:first-child').find('a'); | |
$(cart_menu).find('span').remove(); | |
$(cart_menu).append(cart_element); | |
}); | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://w3bits.com/flexbox-masonry/ | |
https://w3bits.com/labs/flexbox-masonry/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insertAfter(el, referenceNode) { | |
referenceNode.parentNode.insertBefore(el, referenceNode.nextSibling); | |
} | |
// example | |
var newEl = document.createElement('div'); | |
newEl.innerHTML = '<p>Hello World!</p>'; | |
var ref = document.querySelector('div.before'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- assign collection = collections[section.settings.collection] -%} | |
<div class="wrapper collection-slider collection-slider-{{ section.id }}" data-section-id="{{ section.id }}"> | |
{% if section.settings.primary_header != blank or section.settings.secondary_header %} | |
<h2><span class="font-300">{{section.settings.primary_header}}</span> {{section.settings.secondary_header}}</h2> | |
{% endif %} | |
<div class="grid-uniform collection-slider-container"> | |
{% for product in collection.products %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var replace = require('gulp-replace'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var rename = require('gulp-rename'); | |
var imagemin = require('gulp-imagemin'); | |
function minifiedImages(){ | |
return gulp.src('./images/*') |