Skip to content

Instantly share code, notes, and snippets.

:shipit:

Claudio Sanches claudiosanches

:shipit:
Block or report user

Report or block claudiosanches

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 / index.html
Last active Aug 29, 2015
HTML5 - Validar número de celular em São Paulo
View index.html
<div class="form-group">
<label for="phone">Telefone <span class="required">*</span></label>
<input type="text" class="form-control" id="phone" name="phone" placeholder="(99) 9999-9999" pattern="(\([0-9]{2}\))\s([9]{1})?([0-9]{4})-([0-9]{4})" title="Número de telefone precisa ser no formato (99) 9999-9999" required="required" />
</div>
@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">
You can’t perform that action at this time.