Changeset 3096888
- Timestamp:
- 06/03/2024 04:54:34 PM (22 months ago)
- File:
-
- 1 edited
-
robokassa/trunk/wp_robokassa.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
robokassa/trunk/wp_robokassa.php
r3092020 r3096888 752 752 $current['quantity'] = 1; 753 753 754 // Получаем цену каждого товара 755 $item_price = $product->get_price(); 756 757 // Рассчитываем налог на единицу товара 754 758 $tax_per_item = ($taxes / $woocommerce->cart->get_cart_contents_count()); 755 759 756 $current['cost'] = ($item['line_total'] + $tax_per_item); 760 // Устанавливаем цену и сумму для текущего товара 761 $current['cost'] = $item_price + $tax_per_item; 757 762 $current['sum'] = $current['cost']; 758 763 759 764 if (get_option('robokassa_country_code') == 'RU') { 760 $current['payment_object'] = \get_option('robokassa_payment_paymentObject');761 $current['payment_method'] = \get_option('robokassa_payment_paymentMethod');765 $current['payment_object'] = get_option('robokassa_payment_paymentObject'); 766 $current['payment_method'] = get_option('robokassa_payment_paymentMethod'); 762 767 } 763 768 764 if (isset($receipt['sno']) && ($receipt['sno'] == 'osn') || (get_option('robokassa_country_code') == 'KZ')) {769 if (isset($receipt['sno']) && $receipt['sno'] == 'osn' || get_option('robokassa_country_code') == 'KZ') { 765 770 $current['tax'] = $tax; 766 771 } else { … … 771 776 } 772 777 } else { 778 $current = []; 773 779 $current['name'] = $product->get_title(); 774 780 $current['quantity'] = (float)$item['quantity']; 775 781 782 // Получаем цену каждого товара 783 $item_price = $product->get_price(); 784 785 // Рассчитываем налог на все количество текущего товара 776 786 $tax_per_item = ($taxes / $woocommerce->cart->get_cart_contents_count()) * $current['quantity']; 777 787 778 $current['cost'] = ($item['line_total'] + $tax_per_item) / $current['quantity']; 788 // Устанавливаем цену и сумму для текущего товара 789 $current['cost'] = $item_price + ($tax_per_item / $current['quantity']); 779 790 $current['sum'] = $current['cost'] * $current['quantity']; 780 791 781 792 if (get_option('robokassa_country_code') == 'RU') { 782 $current['payment_object'] = \get_option('robokassa_payment_paymentObject');783 $current['payment_method'] = \get_option('robokassa_payment_paymentMethod');793 $current['payment_object'] = get_option('robokassa_payment_paymentObject'); 794 $current['payment_method'] = get_option('robokassa_payment_paymentMethod'); 784 795 } 785 796 786 if (isset($receipt['sno']) && ($receipt['sno'] == 'osn') || (get_option('robokassa_country_code') == 'KZ')) {797 if (isset($receipt['sno']) && $receipt['sno'] == 'osn' || get_option('robokassa_country_code') == 'KZ') { 787 798 $current['tax'] = $tax; 788 799 } else { 789 800 $current['tax'] = 'none'; 790 801 } 791 792 802 793 803 $receipt['items'][] = $current;
Note: See TracChangeset
for help on using the changeset viewer.