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 // Do not include this if already open! | |
/** | |
* Code goes in theme functions.php. | |
*/ | |
add_filter( 'woocommerce_get_price_suffix', 'custom_woocommerce_get_price_suffix', 10, 2 ); | |
function custom_woocommerce_get_price_suffix( $price_display_suffix, $product ) { | |
if ( ! $product->is_taxable() ) { | |
return ''; |
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 total_saving = 0 %} | |
{% for item in cart.items %} | |
{% if item.variant.compare_at_price > item.variant.price %} | |
{% assign saving = item.variant.compare_at_price | minus: item.variant.price | times: item.quantity %} | |
{% assign total_saving = saving | plus: total_saving %} | |
{% endif %} | |
{% endfor %} | |
You Saved: {{ total_saving }} //example: $40 |
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
//this script requires jQuery | |
function isVisibleOnScreen(target){ | |
var depth = $(target).offset().top; //depth from the top | |
var targetHeight = $(target).height(); //height of the target element | |
var winHeight = $(window).height(); //current window height | |
var totalTargetDepth = parseInt(targetHeight)+parseInt(depth)+winHeight; //total depth | |
var scrolledDepth = $(window).scrollTop(); //how far you scrolled | |
var elmVisible = winHeight+scrolledDepth; //the point where the target starts displaying at the bottom of the screen | |
//console.log(scrolledDepth+'-'+elmVisible+'-'+depth); | |
//runs the logic condition |
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 total=0 %} | |
{%for variant in product.variants %} | |
{% capture i %}{{ total | plus:variant.inventory_quantity }}{%endcapture%} | |
{% assign total = i %} | |
{%endfor%} | |
Total Stock: {{ total }} |
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
{% for item in cart.items %} | |
<div class="mbl-cart-container" id="DevLine-{{forloop.index}}"> | |
<div class="mbl-quantity"> | |
<p><i class="fas fa-plus" data-line-id="{{ forloop.index }}"></i></p> | |
<p class="dev-line-qty" id="Q-{{forloop.index}}">{{ item.quantity }}</p> | |
<p><i class="fas fa-minus" data-line-id="{{ forloop.index }}"></i></p> | |
</div> | |
<div class="mbl-line-image"> | |
<a href="{{ item.url }}"> |
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
<script> | |
$(document).ready(function(){ | |
/* | |
STEPS: | |
1. Grab the img id from the src on gallery thumb click | |
2. loop thru the radio button images and grab the img src | |
2a. click the button that's it! | |
*/ | |
/* |
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 current = [1, 2, 3, 4, 7, 8], | |
prev = [1, 2, 4], | |
isMatch = false, | |
missing = null; | |
var i = 0, y = 0, | |
lenC = current.length, | |
lenP = prev.length; | |
for ( ; i < lenC; i++ ) { |
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
<div class="cart-promo"> | |
<h2>ENTER A PROMO CODE</h2> | |
<input type="text" id="devPromo"> | |
<a href="/checkout?discount=none" id="redemDevPromo">Apply Coupon</a> | |
</div> | |
<script> | |
$(document).ready(function(){ | |
//listen to the promo button click | |
$('#redemDevPromo').on('click', function(event){ | |
//disable the button event |
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
{% for item in cart.items %} | |
<a class="cart-removal" data-line-id="{{ forloop.index }}" href="/cart/change?line={{ forloop.index }}&quantity=0" rel="{{ item.id }}">Remove Item</a> | |
{% 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
{% comment %} | |
This file can be added as a snippet and add it anywhere you want to display | |
{% endcomment %} | |
<div id="pageheader"> | |
<div class="util-area"> | |
<div class="search-box"> | |
<form class="search-form" action="/search" method="get" _lpchecked="1"> | |
<i class="icon-mag"></i> | |
<input type="text" name="q" placeholder="Search" autocomplete="off"> | |
<input type="submit" value="→"> |
OlderNewer