This file contains 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_filter( 'wc_shipping_simulator_package_data', function( $package ){ | |
if( $product_id = $_GET['product'] ?? $_POST['product_id'] ?? false ){ | |
$package['seller_id'] = get_post_field( 'post_author', $product_id ); | |
} | |
return $package; |
This file contains 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 | |
Route::match( | |
['get', 'post'], | |
'{controller}/{action?}/{params?}', | |
function ($controller, $action = 'index', $params = '') { | |
$params = explode('/', $params); | |
$methodParams = []; | |
foreach ($params as $key => $param) { |
This file contains 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 | |
/** | |
* Pagar.me API | |
* | |
* @package WooCommerce_Pagarme/API | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |
This file contains 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 | |
if( !class_exists( 'WCPagarmePixPayment\Pagarme\PagarmeApiV4' ) ){ | |
return; | |
} | |
use WCPagarmePixPayment\Pagarme\PagarmeApiV4; | |
class ArtiPagarmeApi extends PagarmeApiV4 { |
This file contains 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 | |
/** | |
* Moving cart calculator to the top of the cart collaterals | |
*/ | |
add_filter( 'woocommerce_shipping_show_shipping_calculator', '__return_false' ); | |
add_action( 'woocommerce_cart_totals_before_shipping', function(){ | |
$packages = WC()->shipping()->get_packages(); | |
$first_package = array_shift( $packages ); | |
$formatted_destination = WC()->countries->get_formatted_address( $first_package['destination'], ', ' ); |
This file contains 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 | |
// Valor declarado. | |
add_filter( 'woocommerce_correios_shipping_args', function( $args ){ | |
if( 24 >= $args['nVlValorDeclarado'] ){ | |
$args['nVlValorDeclarado'] = 0; | |
} | |
return $args; |
This file contains 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( 'wp_enqueue_scripts', function(){ | |
$is_pix_payment_page = function(){ | |
global $wp; | |
//Page is view order or order received? | |
if( !isset($wp->query_vars['order-received']) && !isset($wp->query_vars['view-order']) ) | |
return; |
This file contains 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
# You must place it above the "# BEGIN WordPress" comment. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Just change the URL to your liking. | |
RewriteRule ^(.*)$ https://www.production-site.com/wp-content/uploads/$1 [L] | |
</IfModule> |
This file contains 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( 'wcfm_order_details_after_shipping_address', function( $order ){ | |
$cpf = $order->get_meta( '_billing_cpf' ); | |
?> | |
<div><strong>CPF:</strong> <?php echo esc_html( $cpf ); ?></div> | |
<?php | |
} ); |
This file contains 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_filter( 'woocommerce_shipping_calculator_enable_country', '__return_false' ); | |
add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' ); |
NewerOlder