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
require 'uri' | |
require 'net/https' | |
require 'ostruct' | |
require 'rubygems' | |
require 'yaml' | |
invoicexpressyml ||= YAML.load_file("config/invoicexpress.yml") | |
invoicexpresscfg = invoicexpressyml["development"] | |
host = [invoicexpresscfg["screen_name"], invoicexpresscfg["host"]].join(".") | |
api_key = invoicexpresscfg["api_key"] |
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
countries: | |
PT: Portugal | |
IE: Ireland | |
GB: UK | |
CA: Canada | |
US: United States | |
AF: Afghanistan | |
AL: Albania | |
DZ: Algeria | |
AS: American Samoa |
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
<? | |
$body = file_get_contents('php://input'); | |
#$data = json_decode($body, true); #decode JSON string. | |
file_put_contents("jumpseller_posts.txt", date("Y-m-d H:i:s")."\n".$body, FILE_APPEND); | |
?> |
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
def self.memmory(app_name, url) | |
pid, size = `ps ax -o pid,rss | grep -E "^[[:space:]]*#{$PROCESS_ID}"`.strip.split.map(&:to_i) | |
size_in_mb = size / 1024.0 | |
{ pid: pid, app: app_name, size: size_in_mb, url: url, server_time: Time.now } | |
end |
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
Jumpseller.addProductToCart(336248, 1, {"Sexo":379610, "Modelo":379612, "Color": 379615, "Cuello": 379621, "Manga": 379623}) |
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
require 'httparty' | |
LOGIN = 'my-store-code' | |
TOKEN = 'XXXXX' | |
response = HTTParty.get("https://api.jumpseller.com/v1/products/count.json?login=#{LOGIN}&authtoken=#{TOKEN}") | |
products_count = response.parsed_response["count"] | |
pages = products_count / 200 # the number of pages used for pagination. | |
last_pagination_count = products_count - pages * 200 # calculates the number of products present at the last pagination. |
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 type="text/javascript"> | |
// more info at: https://jumpseller.com/support/javascript-library | |
var callbackFunction = function(event, productInfo){ | |
if(!$.isEmptyObject(productInfo)){ | |
console.log(productInfo); | |
alert('stock: ' + productInfo.stock + ', stock unlimited?:' + productInfo.stock_unlimited); | |
} | |
}; | |
//update Product information with current variant |
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
require 'uri' | |
require 'net/http' | |
require 'openssl' | |
require "benchmark" | |
HOST = 'api.jumpseller.com' | |
# uri = URI.parse("http://#{HOST}/landing/pricing?currency=CLP") | |
uri = URI.parse("http://#{HOST}/v1/products/{product_id}.json?login=XXX&authtoken=XXX") |
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
// run in console for a Simple Product (without Product Variants): | |
// Jumpseller.addProductToCart(12345, 1, {}, {callback: addToCartCallback}); | |
<script type="text/javascript"> | |
function addToCartCallback(data) { | |
var sum = 0; // num of individual products in the cart. | |
$.each( data.products, function( index, product ){ | |
sum += product.qty; | |
}); | |
console.log('cart products sum:'); |
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 type="text/javascript"> | |
$( document ).ready(function() { | |
$('#shipping_address_same_as_shipping').hide(); // removes the checklist button | |
$('#shipping_address h2').text('{% t "Billing Address" %}'); // change text | |
}); | |
</script> |
OlderNewer