PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.2.18
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.2.18
1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 All 178 releases
disco / functions / cart.php

cart.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.2.18, at functions/cart.php

21 lines 470 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Set Cart Items discounts.
4 use Disco\App\Disco;
5
6 if ( ! function_exists( 'disco_set_cart_item_price_test' ) ) {
7
8 /**
9 * Set Cart Items discounts.
10 *
11 * @param object $cart Cart object.
12 * @return object
13 * @throws \Exception Error message.
14 */
15 function disco_set_cart_item_price_test( $cart ) {
16 return ( new Disco )->get_cart_items_discount( $cart );
17 }
18
19 add_action( 'woocommerce_before_calculate_totals', 'disco_set_cart_item_price_test', 1, 1 );
20 }
21