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 shipping_methods_ids = []; // 10441, 19855, 26703, 26704, 27216, 63580 | |
// select usable shipping methods | |
switch(event.target.value){ | |
case "75995": | |
if({{order.total}} >= 50000) | |
shipping_methods_ids = ['10441', '19855', '27216']; | |
else |
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
require 'byebug' | |
require 'awesome_print' | |
require 'httparty' | |
username = 'elite.track' | |
password = 'axwdavgo' | |
client_id = 35318 | |
pickup = 1000000047 | |
response = HTTParty.get("https://api.dhlglobalmail.com/v2/auth/access_token?username=#{username}&password=#{password}") |
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 | |
define('HOOKS_TOKEN', 'XXXXX'); // get your token at Admin Panel > Config > Notifications / Webhooks. | |
function verify_webhook($data, $hmac_header) | |
{ | |
$calculated_hmac = base64_encode(hash_hmac('sha256', $data, HOOKS_TOKEN, true)); | |
return ($hmac_header == $calculated_hmac); | |
} |
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
# after the App is Authorized, the /callback route is requested. | |
# on the App itself, the /callback controller will: | |
# 1. confirm the App is authorized | |
# 2. save the Authorization tokens on the Database | |
# 3. create the Javascript App on the Store. | |
app.get '/callback' do | |
halt 403, 'Authorization denied' if authorization_denied? // App Authorization | |
store = find_or_create_app( | |
klass: model_name, |
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
curl -X POST -d '{ "product" : {"name": "My new Product!", "price": 100, "description": "<p>Articulo en preventa</p><p>No depende del idioma.<p>Trepidante! Porque todos los jugadores intentan encajar las piezas en su plantilla simultaneamente"} }' "https://api.jumpseller.com/v1/products.json?login=87cf9e6326e83bfed88b8dad4fae5b41&authtoken=5c7e86d7318ba2f10b9b2b0e6291ff30" -H "Content-Type:application/json" |
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 vina_cat in store.category['vinas'].subcategories %} | |
{% for product_cat in product.categories %} | |
{% if vina_cat.id == product_cat.id %} // identify the vina category (monos) | |
{% assign cat = vina_cat %} | |
{% endif %} | |
{% end %} | |
<h2>{% t 'Wines from the same vineyard' %}</h2> |
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
def do_request_login(method, resource, data) | |
url = "#{ENV['JUMPSELLER_API_BASE_URL']}#{resource}?#{{login: integration_config.login, authtoken: integration_config.authtoken}.to_query}" | |
for i in 1..10 do | |
perform_request(method, url, data) | |
if resp.code >= 200 and resp.code < 300 or resp.code == 404 | |
return resp | |
elsif resp.nil? or resp.code == 403 # and message "Rate Limit Exceeded"? | |
sleep 1.0 | |
else | |
raise "Error #{resp.code}: #{resp.inspect}" |
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
$(document).ready(function() { | |
var parentId; | |
var parentOptionCounter = 0; | |
$.each($(".prod-options option"), function( index, option ) { | |
var stock = $(option).data("variant-stock"); | |
if(index == 0 || parentId !== $(option).parent().attr('id')){ | |
parentId = $(option).parent().attr('id'); | |
parentOptionCounter = 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
<script type="text/javascript"> | |
var Fn = { | |
// Valida el rut con su cadena completa "XXXXXXXX-X" | |
validaRut : function (rutCompleto) { | |
if (!/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test( rutCompleto )) | |
return false; | |
var tmp = rutCompleto.split('-'); | |
var digv = tmp[1]; | |
var rut = tmp[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
var setQuantityOne = function(data){ | |
$.each(data.products, function(index, item) { | |
//console.log(item); | |
Jumpseller.updateCart(item.id, 1, {}); | |
}); | |
}; | |
Jumpseller.getCart({callback: setQuantityOne}) |