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 | |
// 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 | |
function wcbr_create_lottery_numbers( $order_id ){ | |
$order = wc_get_order( $order_id ); | |
$items = $order->get_items(); | |
$lucky_product_id = 28; | |
foreach( $items as $item_id => $item ) { |
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 | |
function arti_mpme_custom_disable_me_shipping_field(){ | |
global $post; | |
$me_disabled = get_post_meta( $post->ID, '_me_product_disabled', true ); | |
?> | |
<div class="dokan-form-group"> | |
<input id="_me_product_disabled" name="_me_product_disabled" value="yes" type="checkbox"<?php checked( $me_disabled, 'yes' ); ?>> |
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 | |
// Adicionar status permitido para gerar etiquetas. | |
add_filter( 'arti_me_labels_generation_allowed_statuses', function( $statuses ){ | |
$statuses[] = 'id_do_seu_status'; | |
// $statuses[] = 'id_de_outro_status'; | |
return $statuses; |
NewerOlder