Skip to content

Instantly share code, notes, and snippets.

@davidbiehl
davidbiehl / puppet-elasticsearch.pp
Created January 23, 2015 06:11
Install ElasticSearch with Puppet
# https://github.com/elasticsearch/puppet-elasticsearch
class { 'elasticsearch':
manage_repo => true,
repo_version => '1.4',
version => '1.4.2',
java_install => true
}
elasticsearch::instance { 'es-01': }
VsrLoader.bootstrap().then(function() {
console.warn("first", Ecwid, Ecwid.Cart); // Ecwid.Cart is undefined
Ecwid.OnAPILoaded.add(function() {
console.warn("loaded", Ecwid, Ecwid.Cart); // Ecwid.Cart is available
});
});
@davidbiehl
davidbiehl / ecwid_free_shipping_promo_in_cart.html
Last active March 22, 2016 14:03 — forked from makfruit/ecwid_free_shipping_promo_in_cart.html
An HTML/Javascript code snippet for Ecwid to show a simple promo message popup on the cart page for orders less than the defined subtotal
<!-- An HTML/Javascript code snippet for Ecwid to show a simple promo message popup on the cart page for orders less than the defined subtotal -->
<script>
if (typeof(Ecwid) == 'object') {
Ecwid.OnAPILoaded.add(function() {
var promoMessage = "Orders $99 and up ship free!";
var minSubtotal = 99;
var checkSubtotal = function(order) {
if (order) {
var subtotal = order.total - order.shipping - order.tax;