Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@claudiosanches
claudiosanches / functions.php
Last active Aug 29, 2015
WooCommerce - Stop to trim zeros!
View functions.php
add_filter( 'woocommerce_price_trim_zeros', '__return_false' );
@claudiosanches
claudiosanches / functions.php
Created Feb 18, 2014
WooCommerce - Custom catalog order by.
View functions.php
<?php
function custom_woocommerce_catalog_orderby( $items ) {
unset( $items['price'] );
unset( $items['price-desc'] );
return $items;
}
@claudiosanches
claudiosanches / functions.php
Created May 6, 2014
WooCommerce MercadoPago - Exclude ticket/boleto
View functions.php
<?php
function custom_wc_mercadopago_args( $args ) {
$args['payment_methods'] = array(
'excluded_payment_types' => array(
array( 'id' => 'ticket' )
)
);
return $args;
@claudiosanches
claudiosanches / functions.php
Last active Aug 29, 2015
WooCommerce Correios - Move the WooCommerce Correios shipping product simulator
View functions.php
<?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 / style.css
Last active Aug 29, 2015
WooCommerce Correios - Simulator CSS
View style.css
/* Simulador */
#wc-correios-simulator {
}
/* Título do simulador */
#wc-correios-simulator strong {
}
@claudiosanches
claudiosanches / class-wc-language-pack-upgrader.php
Created May 26, 2014
WooCommerce Language Pack Upgrader class (proposal)
View class-wc-language-pack-upgrader.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* WooCommerce Language Pack Upgrader class
*
* Downloads the last language pack.
*
@claudiosanches
claudiosanches / functions.php
Created Jun 23, 2014
WooCommerce - Just one thumbnail in product page.
View functions.php
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 Jul 1, 2014
PayPal Adaptive Payments example
View paypal.txt
ninja@email.com|20
sensei@email.com|15
@claudiosanches
claudiosanches / index.html
Created Jul 5, 2014
Base64 Encode of 1x1px Transparent GIF
View index.html
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">
@claudiosanches
claudiosanches / style.css
Created Jul 9, 2014
WooCommerce - PagSeguro Checkout transparente
View style.css
.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 {