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
s3 = Aws::S3::Resource.new | |
keys = s3.bucket("jumpseller").objects(prefix: "store/store-name/").collect(&:key) | |
keys = keys.delete_if {|key| key.include?('themes') || key.include?('assets') || key.include?('pages') || key.include?('logo') } # selecting only products. | |
keys.each do |key| | |
p key | |
object = s3.bucket('jumpseller').object(key) | |
begin | |
object.restore_object({ |
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
# make sure you have the IAM policy allowed to do: "s3:DeleteObject" | |
# read: http://docs.aws.amazon.com/AmazonS3/latest/dev/RemDelMarker.html | |
client = Aws::S3::Client.new | |
ovs = client.list_object_versions(bucket: 'bucket-name', prefix: "store/store-name/") | |
ovs.delete_markers.each do |ov| | |
p "key: #{ov.key} - latest: #{ov.is_latest} - last_modified: #{ov.last_modified}" | |
client.delete_object({ bucket: 'bucket-name', key: ov.key, version_id: ov.version_id }) # the important part here is deleting the correct version. | |
end |
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"> | |
// On the Admin Panel Configuration: https://www.evernote.com/l/APbc8GhuD4VCBam1eRbZb_M0Jr-wKdQqTVQ add the Custom Fields: | |
// Select List (Boleta o Factura) with the options: "Boleta Electrónica" and "Factura Electrónica" | |
// Input Fields: "Razón Social" and "Giro" | |
// Store Theme Checkout Form: https://www.evernote.com/l/APYKFPLISu9GpJihPufTIFUiLT7bhyUgWBU | |
// use this on the Template: "Payment/Checkout" with {% include 'factura_boleta_validator' %} | |
$(document).ready(function(){ | |
//Chile Tax ID Verifier | |
$("#order_shipping_address_taxid").attr("pattern", "[0-9]{7,8}-[0-9Kk]{1}"); // with . and . [0-9]{1,2}.[0-9]{3}.[0-9]{3}-[0-9Kk]{1} | |
$("#order_shipping_address_taxid").attr("placeholder", "ej. 12345678-5"); |
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"> | |
$(document).ready(function(){ | |
$("#order_shipping_address_taxid").attr("pattern", "[0-9]{7,8}-[0-9Kk]{1}"); // with . and . [0-9]{1,2}.[0-9]{3}.[0-9]{3}-[0-9Kk]{1} | |
$("#order_shipping_address_taxid").attr("placeholder", "12345678-5"); | |
$("#order_shipping_address_taxid").attr("title", "ej. 12345678-5"); | |
}); | |
</script> |
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"> | |
$( document ).ready(function() { | |
$('#shipping_address_same_as_shipping').hide(); // removes the checklist button | |
$('#shipping_address h2').text('{% t "Billing Address" %}'); // change text | |
}); | |
</script> |
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
// 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 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 '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 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"> | |
// 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 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 '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 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
Jumpseller.addProductToCart(336248, 1, {"Sexo":379610, "Modelo":379612, "Color": 379615, "Cuello": 379621, "Manga": 379623}) |