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
(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);
/**
* 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>';
<?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" />
<?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
*/
@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']);
@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 / 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 / style.css
Created May 14, 2017 02:20
Woocommerce Product Align Add to Cart Button
.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;
@eder-dias
eder-dias / fuctions.php
Created May 20, 2017 19:31
Move add to cart button above the description [Woocommerce]
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
@eder-dias
eder-dias / functions.php
Created May 20, 2017 19:50
Move single meta info below thumbnails [Woocommerce]
// Remove product category/tag meta from its original position
remove_action ('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
// Add product meta in new position
add_action ('woocommerce_product_thumbails', 'woocommerce_template_single_meta', 40);