This file contains 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
To design a proper architecture to sincronize product stocks between a Jumpseller store and a ERP (or any similar system), consider: | |
1. Define a storage system (a MySQL, SQLite or even a plain-text file works perfectly) to hold at least two columns: jumpseller_product_id and erp_id | |
2. Record each part of IDs, jumpseller_product_id and erp_id, using Jumpseller GET /products endpoint, like: | |
jumpseller_product_id, erp_id | |
123456, adidas-red-43 | |
123457, adidas-red-44 | |
123458, adidas-red-45 | |
3. Once the matching of all products from Jumpseller Store and the ERP system is done, | |
4. You can start work on keeping stock updated, by adding a third column: synced_at, like: |
This file contains 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
{% if order.subtotal < 100 %} | |
<script> | |
// Add this to your checkout block. Change the minimum from 100 to your desired number. Use a large number to block all purchase, change to 0 to block none | |
// Design your message | |
var message = '<i class="fa fa-info-circle fa-fw"></i>There is a minimum order required of <strong>100 USD</strong>' | |
var alert_m = '<div align="middle" id="alert-minimum" class="text-center alert alert-warning m-0">' + message + '<br><a onclick="history.go(-1); return false;" href="#" class="btn btn-sm btn-secondary mt-2" title="← {% t 'Go back & Keep Shopping' %}">← {% t "Go back & Keep Shopping" %}</a></div>' | |
$(document).ready(function(){ | |
$("#checkout").before(alert_m) |
This file contains 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> | |
(function($) { | |
jQuery.fn.Rut = function(options) { | |
var defaults = { | |
digito_verificador: null, | |
on_error: function() {}, | |
on_success: function() {}, | |
validation: true, | |
format: true, | |
format_on: 'change' |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import Image | |
def autocrop_image(image, border = 0): | |
# Get the bounding box | |
bbox = image.getbbox() | |
# Crop the image to the contents of the bounding box |