Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@claudiosanches
claudiosanches / functions.php
Last active August 29, 2015 13:56
WooCommerce - Stop to trim zeros!
add_filter( 'woocommerce_price_trim_zeros', '__return_false' );
@claudiosanches
claudiosanches / functions.php
Created February 18, 2014 17:53
WooCommerce - Custom catalog order by.
<?php
function custom_woocommerce_catalog_orderby( $items ) {
unset( $items['price'] );
unset( $items['price-desc'] );
return $items;
}
@claudiosanches
claudiosanches / functions.php
Created May 6, 2014 03:49
WooCommerce MercadoPago - Exclude ticket/boleto
<?php
function custom_wc_mercadopago_args( $args ) {
$args['payment_methods'] = array(
'excluded_payment_types' => array(
array( 'id' => 'ticket' )
)
);
return $args;
@claudiosanches
claudiosanches / style.css
Last active August 29, 2015 14:01
WooCommerce Correios - Simulator CSS
/* Simulador */
#wc-correios-simulator {
}
/* Título do simulador */
#wc-correios-simulator strong {
}
@claudiosanches
claudiosanches / functions.php
Last active August 29, 2015 14:01
WooCommerce Correios - Move the WooCommerce Correios shipping product simulator
<?php
/**
* Move the WooCommerce Correios shipping product simulator.
*/
remove_action( 'woocommerce_single_product_summary', array( 'WC_Correios_Product_Shipping_Simulator', 'simulator' ), 45 );
add_action( 'woocommerce_single_product_summary', array( 'WC_Correios_Product_Shipping_Simulator', 'simulator' ), 25 );
@claudiosanches
claudiosanches / class-wc-language-pack-upgrader.php
Created May 26, 2014 21:01
WooCommerce Language Pack Upgrader class (proposal)
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* WooCommerce Language Pack Upgrader class
*
* Downloads the last language pack.
*
@claudiosanches
claudiosanches / functions.php
Created June 23, 2014 22:16
WooCommerce - Just one thumbnail in product page.
function custom_woocommerce_show_product_thumbnails() {
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
if ( ! empty( $attachment_ids ) ) {
$attachment_id = current( $attachment_ids ); // pega o primeiro
$image_link = wp_get_attachment_url( $attachment_id );
@claudiosanches
claudiosanches / paypal.txt
Created July 1, 2014 19:31
PayPal Adaptive Payments example
ninja@email.com|20
sensei@email.com|15
@claudiosanches
claudiosanches / index.html
Created July 5, 2014 00:44
Base64 Encode of 1x1px Transparent GIF
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
@claudiosanches
claudiosanches / style.css
Created July 9, 2014 03:54
WooCommerce - PagSeguro Checkout transparente
.payment_method_pagseguro > input[type="radio"],
.payment_method_pagseguro > label,
.woocommerce #payment div.payment_box.payment_method_pagseguro:after,
.woocommerce-page #payment div.payment_box.payment_method_pagseguro:after,
.payment_box.payment_method_pagseguro > p {
display: none;
}
.woocommerce #payment div.payment_box.payment_method_pagseguro,
.woocommerce-page #payment div.payment_box.payment_method_pagseguro {