Changeset 1023219
- Timestamp:
- 11/10/2014 05:43:47 PM (11 years ago)
- Location:
- wc-ebay-enterprise-affiliates/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
woocommerce-ebay-enterprise-affiliates.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-ebay-enterprise-affiliates/trunk/readme.txt
r1019003 r1023219 5 5 Requires at least: 3.0 6 6 Tested up to: 4.0 7 Stable tag: 1. 0.17 Stable tag: 1.1.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 21 21 == Changelog == 22 22 23 = 1.1.0 - 11/10/2014 = 24 * Add shipping discount // props @KamikazeXeX 25 23 26 = 1.0.1 - 11/03/2014 = 24 27 * Use product ID instead of SKU -
wc-ebay-enterprise-affiliates/trunk/woocommerce-ebay-enterprise-affiliates.php
r1019003 r1023219 66 66 'desc_tip' => true, 67 67 ); 68 69 $options[] = array( 70 'title' => __( 'Shipping Discount', 'wc-ebay' ), 71 'desc' => __( 'If shipping is included in your prices, this discount will reduce the totals sent to EEAN so commissions are not paid on included shipping prices.', 'wc-ebay' ), 72 'id' => 'woocommerce_ebay_affiliate_shipping_discount', 73 'default' => '', 74 'type' => 'text', 75 'desc_tip' => true, 76 ); 68 77 69 78 $options[] = array( … … 119 128 * absint() should always give us a number greater or equal to zero. 120 129 */ 121 $item_query_args[ 'TOTALAMOUNT' . $i ] = isset( $item['line_total'] ) ? absint( $item['line_total'] - $individual_discount ) : 0; 130 $shipping_discount = 1 - ( floatval( WC_Admin_Settings::get_option( 'woocommerce_ebay_affiliate_shipping_discount', 0 ) ) / 100 ); 131 $total = isset( $item['line_total'] ) ? $shipping_discount * ( $item['line_total'] - $individual_discount ) : 0; 132 $item_query_args[ 'TOTALAMOUNT' . $i ] = 0 < $total ? number_format( $total, 2, '.', '' ) : 0; 122 133 } 123 134 }
Note: See TracChangeset
for help on using the changeset viewer.