Skip to content

Instantly share code, notes, and snippets.

@luiseduardobraschi
Created March 28, 2024 06:19
Show Gist options
  • Save luiseduardobraschi/a288ad9a7a2a8e8bf292dd899dfa8407 to your computer and use it in GitHub Desktop.
Save luiseduardobraschi/a288ad9a7a2a8e8bf292dd899dfa8407 to your computer and use it in GitHub Desktop.
Compatibilidade Dokan e Simulador de Frete para WooCommerce (Luiz Bills)
<?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;
}, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment