Credit card type | EBANX payment type code | Credit card numbers |
---|---|---|
American Express | amex |
378282246310005 or 371449635398431 |
Aura | aura |
5078601870000127985 or 5078601800003247449 |
Diners Club | diners |
30569309025904 or 38520000023237 |
Discover | discover |
6011111111111117 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide the "In stock" message on product page. | |
* | |
* @param string $html | |
* @param string $text | |
* @param WC_Product $product | |
* @return string | |
*/ | |
function my_wc_hide_in_stock_message( $html, $text, $product ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom variable price HTML. | |
* Shows "Starting at" prefix with when min price is different from max price. | |
* | |
* @param stirng $price Product price HTML | |
* @param WC_Product_Variable $product Product data. | |
* @return string | |
*/ | |
function cs_my_wc_custom_variable_price_html( $price, $product ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'rest_api_init', function() { | |
register_rest_route( 'my-route/v1', '/products/(?P<id>\d+)', array( | |
'methods' => 'GET', | |
'callback' => function( $data ) { | |
$product = wc_get_product( $data['id'] ); | |
if ( empty( $product ) ) { | |
return null; | |
} | |
return $product; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce Remove billing fields | |
* Description: Remove billing address, fone and company fields from WooCommerce checkout. | |
* Author: Claudio Sanches | |
* Author URI: https://claudiosmweb.com | |
* Version: 0.0.1 | |
* License: GPLv2 or later | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rand_related_products_query( $query ) { | |
$query['limits'] = ' ORDER BY RAND() ' . $query['limits']; | |
return $query; | |
} | |
add_filter( 'woocommerce_product_related_posts_query', 'rand_related_products_query' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: PAC Gratuito | |
* Plugin URI: https://claudiosmweb.com/woocommerce/woocommerce-deixar-o-metodo-de-entrega-pac-dos-correios-gratuito/ | |
* Description: Deixa o valor do PAC do WooCommerce Correios sempre como gratuito. | |
* Author: Claudio Sanches | |
* Author URI: http://claudiosmweb.com/ | |
* Version: 1.0.0 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add order again button in my orders actions. | |
* | |
* @param array $actions | |
* @param WC_Order $order | |
* @return array | |
*/ | |
function cs_add_order_again_to_my_orders_actions( $actions, $order ) { | |
if ( $order->has_status( 'completed' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cs_woocommerce_locate_template( $template, $template_name, $template_path ) { | |
global $woocommerce; | |
$_template = $template; | |
if ( ! $template_path ) { | |
$template_path = $woocommerce->template_url; | |
} | |
$plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/'; | |
// Look within passed path within the theme - this is priority |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Test cards | |
$cards = array( | |
'378282246310005', // American Express | |
'371449635398431', // American Express | |
'5078601870000127985', // Aura | |
'5078601800003247449', // Aura | |
'30569309025904', // Diners Club | |
'38520000023237', // Diners Club |