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
<?php | |
if(is_product()) { | |
global $product; | |
$price = round((float)$product->get_price(),2); | |
$category = ''; | |
foreach(get_the_terms( $id, 'product_cat' ) as $term) { | |
$category = $term->name; | |
} |
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
<? | |
add_action( 'wp', 'woo_get_variations_attributes' ); | |
function woo_get_variations_attributes() | |
{ | |
if(is_product()) { | |
global $product; | |
$product_obj = get_page_by_path($product, OBJECT, 'product'); | |
$product_id = $product_obj->ID; | |
$product = new Woo_WC_Product_Variable($product_id); |
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
<?php | |
class Woo_WC_Product_Variable extends WC_Product_Variable { | |
public function get_all_variations() { | |
$available_variations = array(); | |
foreach($this->get_children() as $child_id){ | |
$variation = wc_get_product($child_id); | |
$available_variations[] = $this->get_available_variation($variation); | |
} |
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
<?php | |
add_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 ); | |
if(!function_exists('woocommerce_single_variation')) { | |
function woocommerce_single_variation() { | |
echo '<div class="woocommerce-variation single_variation woo_single_variation"></div>'; | |
} | |
} |
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
jQuery(document).ready(function(){ | |
console.log("Start"); | |
if(jQuery("table.variations").length){ | |
if(jQuery("table.variations tr td.value div:nth-child(2) span:nth-child(1)").length > 0) { | |
setTimeout(function(){ | |
eval(jQuery(".tawcvs-swatches").find("span").first().trigger("click")); | |
}, 1500); | |
} |
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
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
$ua = $_SERVER['HTTP_USER_AGENT']; | |
//User agent must be set to "**MY-SECRET-USER-AGENT**" and the ?secret must be "key" | |
if("**MY-SECRET-USER-AGENT**" == $ua && isset($_GET['secret']) && "key" == $_GET['secret']){ |
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
#!/bin/sh | |
# The mac address of your Dash. Like: 74:75:48:b9:80:fb | |
MACADDR= | |
# Number of seconds to wait in between checks | |
INTERVAL=3 | |
# Number of seconds to sleep after the button is pressed | |
WAITFOR=60 |
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
FROM node:argon | |
# Creando el directorio de la aplicación | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
# Instalando todas sus dependencias | |
COPY package.json /usr/src/app/ | |
RUN npm install |
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
'use strict'; | |
const express = require('express'); | |
// Constantes | |
const PORT = 8080; | |
const HOST = '0.0.0.0'; | |
// App | |
const app = express(); |
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
{ | |
"name": "app_nodejs_con_docker", | |
"version": "1.0.0", | |
"description": "Ejemplo de uso de Docker con Nodejs", | |
"author": "Gorkamu el puto amo <[email protected]>", | |
"main": "server.js", | |
"scripts": { | |
"start": "node server.js" | |
}, | |
"dependencies": { |
NewerOlder