Skip to content

Instantly share code, notes, and snippets.

View eder-dias's full-sized avatar

Eder Dias eder-dias

  • Brasil - São Paulo
View GitHub Profile
@eder-dias
eder-dias / DNS Prefetch domains
Created March 13, 2019 06:58 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@eder-dias
eder-dias / styles.css
Last active August 3, 2017 21:45 — forked from ahmedeshaan/Product Button Align
Product Button Align
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {min-height: 500px !important; margin-bottom:10px; }
ul.products li.product a.button {position: absolute !important; bottom: 500px; }
.box-text {
min-height: 145px;
position: relative;
}
.add-to-cart-button {
position: absolute;
top: 90px;
@eder-dias
eder-dias / 0_reuse_code.js
Created May 21, 2017 00:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@eder-dias
eder-dias / wordpress-text-change
Created May 3, 2017 03:47 — forked from simonlk/wordpress-text-change
Change any text string in WordPress & WooCommerce
function wc_translate_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Like this? Try these:', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_translate_strings', 20, 3 );
@eder-dias
eder-dias / gist:259881fb36d85a0883af
Created October 8, 2015 13:54 — forked from mikejolley/gist:1604009
WooCommerce - Add a special field to the checkout, order emails and user/order meta
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**
@eder-dias
eder-dias / remove-billing.php
Created October 4, 2015 17:26 — forked from jgalea/remove-billing.php
Remove billing details from WooCommerce checkout.
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
<?php
/**
* Plugin Name: WooCommerce Correios - Envelope
* Plugin URI: http://claudiosmweb.com/
* Description: Este plugin ajuda a usar uma taxa fixa para ser usada como preço de envelope
* Author: claudiosanches
* Author URI: http://claudiosmweb.com/
* Version: 1.0
* License: GPLv2 or later
*/
<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);