mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Add fees when creating line items from cart
This commit is contained in:
parent
efcbf5dd7d
commit
2273213cae
3 changed files with 33 additions and 4 deletions
|
@ -38,6 +38,15 @@ class ApiModule implements ModuleInterface {
|
|||
* @param ContainerInterface $container The container.
|
||||
*/
|
||||
public function run( ContainerInterface $container ): void {
|
||||
add_action(
|
||||
'woocommerce_after_calculate_totals',
|
||||
function ( \WC_Cart $cart ) {
|
||||
$fees = $cart->fees_api()->get_fees();
|
||||
if ( $fees ) {
|
||||
WC()->session->set( 'fees', $fees );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue