Skip to content

Instantly share code, notes, and snippets.

View dancr13's full-sized avatar
๐Ÿ˜Ž

Daniel dancr13

๐Ÿ˜Ž
View GitHub Profile
name: wordpress
recipe: wordpress
proxy:
pma:
- pma.wordpress.lndo.site
config:
webroot: .
via: nginx
php: '7.0'
xdebug: true
<?php
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
use Automattic\WooCommerce\HttpClient\HttpClientException;
function getWoocommerceConfig()
{
$woocommerce = new Client(
@dancr13
dancr13 / productos.json
Last active November 7, 2017 03:53
productos.json
[{
"sku": "GIJOE036",
"categorias": ["GI Joe", "80s", "Cartoon"],
"titulo": "Cobra Commander G.I. Joe T-Shirt",
"url": "cobra-commander-g-i-joe-t-shirt",
"pics": ["https:\/\/80stees.imgix.net\/s\/files\/1\/0384\/0921\/products\/cobra-commander-g-i-joe-t-shirt.v3.dsk.jpeg?v=1461357556&usm=18&auto=format&fit=max&h=710&w=463&"],
"desc": "This G.I Joe shirt is officially licensed by Hasbro and features a print of the Cobra logo.",
"articulos": [{
"precio": 26.97,
"descuento": 0,
<?php
/*
Plugin Name: Hangar plugin
Description: Hangar prueba
Version: 0
Author: Daniel Bogarin
License: GPL2
*/
class WPHangarAPi {
@dancr13
dancr13 / Cart.php
Last active October 9, 2017 13:30
Shipping by Quantity, Copy this in root/override/classes
<?php
class Cart extends CartCore
{
/**
* This is a override of getTotalShippingCost.
* This calculates the shipping according to the quantity into the cart.
* For each product into the cart, the shipping is going to be incremental by its 50%.
* E.g: Shipping initial Cost = 2000 and there are 3 products
* So, One product 2000, two Products 2000 + 1000 = 3000, three products 3000 + 1500 = 4500 and etc.
@dancr13
dancr13 / colonesToDollar.sql
Last active September 24, 2017 20:24
This exchange colones to dollars
/* 575.747289 is the exchange rate to change. */
UPDATE ps_product_shop SET price = (price/575.747289);
/* 575.747289 is the exchange rate to change. */
UPDATE ps_product SET price = (price/575.747289) ;
@dancr13
dancr13 / importer.php
Last active November 6, 2018 14:10
Importer to Woocomerce
<?php
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
use Automattic\WooCommerce\HttpClient\HttpClientException;
function getWoocommerceConfig()
{
@dancr13
dancr13 / importer.php
Created August 24, 2017 04:52
Prueba Importador Json
<?php
/**
* WordPress Cron Implementation for hosts, which do not offer CRON or for which
* the user has not set up a CRON job pointing to this file.
*
* The HTTP request to this file will not slow down the visitor who happens to
* visit when the cron job is needed to run.
*
* @package WordPress
*/
@dancr13
dancr13 / Diputados.php
Created July 18, 2017 13:20 — forked from chongkan/Diputados.php
Diputadas y Diputados de Costa Rica en Formato JSON
<?php
include('simple_html_dom.php');
$diputadosCostaRica = new DiputadosCostaRica();
$diputadosCostaRica->index();
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
}