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
import requests | |
import math | |
import pandas as pd | |
import flatten_json | |
# instalar flatten_json con: pip install flatten_json | |
# Referencia: https://github.com/amirziai/flatten | |
# parámetros | |
url_api_productos_contar = "https://api.jumpseller.com/v1/products/count.json" |
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
// Step 1: Create a virtual Product Called "Envio a Cobranza" with two Variants: Portugal/Spain | |
// Step 2: Get the Product and variants IDs | |
// Step 3: replace the following variables with the Product ID (in the product settings URL), Variant Ids (see tip below) and Manual Payment ID (In the payment method URL in the admin panel) | |
var productId = "2388937" | |
var portugalId = "1883423" | |
var spainId = "1883423" | |
var paymentId = "136033" | |
/* TIP: To get the variant ID of the countries I added this code to the product page and checked the console |
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
class Date | |
def to_words | |
if self == Date.today | |
"Today" | |
elsif self <= Date.today - 1 | |
if self == Date.today - 1 | |
"Yesterday" | |
elsif ((Date.today - 7)..(Date.today - 1)).include?(self) | |
"Last #{self.strftime("%A")}" | |
elsif ((Date.today - 14)..(Date.today - 8)).include?(self) |