Changeset 3092020
- Timestamp:
- 05/24/2024 09:59:55 AM (23 months ago)
- Location:
- robokassa/trunk
- Files:
-
- 3 edited
-
main_settings_rb.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
wp_robokassa.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
robokassa/trunk/main_settings_rb.php
r3062478 r3092020 58 58 'robokassa_culture', 59 59 'robokassa_iframe', 60 'robokassa_marking', 60 61 'robokassa_country_code', 61 62 'robokassa_out_currency', … … 431 432 </tr> 432 433 434 <tr valign="top"> 435 <th scope="row">Включить для попозиционной маркировки</th> 436 <td> 437 <select name="robokassa_marking"> 438 <?php if (get_option('robokassa_marking') == 1) { ?> 439 <option selected="selected" value="1">Включено</option> 440 <option value="0">Отключено</option> 441 <?php } else { ?> 442 <option value="1">Включено</option> 443 <option selected="selected" value="0">Отключено</option> 444 <?php } ?> 445 </select><br/> 446 <span class="text-description">При активированной функции, товары, количество которых больше одного в корзине, автоматически будут разбиты на отдельные позиции для чека<span> 447 </td> 448 </tr> 449 433 450 <!-- <tr valign="top" id="payment-method-rk"> 434 451 <th scope="row">Выбор способа оплаты</th> -
robokassa/trunk/readme.txt
r3062478 r3092020 2 2 Tags: robokassa payment gateway, robokassa, robokassa woocommerce, ecommerce, payment gateway, woo-commerce, woocommerce === 3 3 Requires at least: 5.7 4 Tested up to: 6. 4.35 Stable tag: 1. 5.04 Tested up to: 6.5.3 5 Stable tag: 1.6.0 6 6 Requires PHP: 5.6.32 7 7 License: GPLv2 or later … … 77 77 == Changelog == 78 78 79 = 1.6.0 = 80 * Добавлена поддержка плагина ["WooCommerce Checkout Add-Ons"](https://woocommerce.com/products/woocommerce-checkout-add-ons/) 81 * Добавлена новая функция, позволяющая автоматически разбивать товары в корзине на отдельные позиции при количестве больше одного 82 79 83 = 1.5.9 = 80 84 * Исправлены незначительные ошибки -
robokassa/trunk/wp_robokassa.php
r3062478 r3092020 6 6 * Author: Robokassa 7 7 * Author URI: https://robokassa.com 8 * Version: 1. 5.98 * Version: 1.6.0 9 9 */ 10 10 … … 174 174 $debug .= "order_id = $order_id \r\n"; 175 175 176 $roboDataBase = new RoboDataBase(mysqli_connect(DB_HOST, DB_USER,DB_PASSWORD,DB_NAME));176 $roboDataBase = new RoboDataBase(mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)); 177 177 $robokassa = new RobokassaPayAPI($mrhLogin, get_option('robokassa_payment_shoppass1'), get_option('robokassa_payment_shoppass2')); 178 178 … … 312 312 313 313 (new RobokassaSms( 314 (new RoboDataBase(mysqli_connect(DB_HOST, DB_USER,DB_PASSWORD,DB_NAME))),314 (new RoboDataBase(mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME))), 315 315 (new RobokassaPayAPI( 316 316 get_option('robokassa_payment_MerchantLogin'), … … 742 742 743 743 foreach ($cart as $item) { 744 745 744 $product = wc_get_product($item['product_id']); 746 747 $current['name'] = $product->get_title(); 748 $current['quantity'] = (float)$item['quantity']; 749 750 $tax_per_item = ($taxes / $woocommerce->cart->get_cart_contents_count()) * $current['quantity']; 751 752 $current['cost'] = ($item['line_total'] + $tax_per_item) / $current['quantity']; 753 $current['sum'] = $current['cost'] * $current['quantity']; 754 755 if (get_option('robokassa_country_code') == 'KZ') { 745 $quantity = (float)$item['quantity']; 746 747 // Проверяем, если функция включена, то разбиваем на дополнительные объекты 748 if (get_option('robokassa_marking') == 1) { 749 for ($i = 1; $i <= $quantity; $i++) { 750 $current = []; 751 $current['name'] = $product->get_title(); 752 $current['quantity'] = 1; 753 754 $tax_per_item = ($taxes / $woocommerce->cart->get_cart_contents_count()); 755 756 $current['cost'] = ($item['line_total'] + $tax_per_item); 757 $current['sum'] = $current['cost']; 758 759 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'); 762 } 763 764 if (isset($receipt['sno']) && ($receipt['sno'] == 'osn') || (get_option('robokassa_country_code') == 'KZ')) { 765 $current['tax'] = $tax; 766 } else { 767 $current['tax'] = 'none'; 768 } 769 770 $receipt['items'][] = $current; 771 } 756 772 } else { 757 $current['payment_object'] = \get_option('robokassa_payment_paymentObject'); 758 $current['payment_method'] = \get_option('robokassa_payment_paymentMethod'); 759 } 760 761 if (isset($receipt['sno']) && ($receipt['sno'] == 'osn') || (get_option('robokassa_country_code') == 'KZ')) { 762 $current['tax'] = $tax; 763 } else { 764 $current['tax'] = 'none'; 765 } 766 767 768 $receipt['items'][] = $current; 773 $current['name'] = $product->get_title(); 774 $current['quantity'] = (float)$item['quantity']; 775 776 $tax_per_item = ($taxes / $woocommerce->cart->get_cart_contents_count()) * $current['quantity']; 777 778 $current['cost'] = ($item['line_total'] + $tax_per_item) / $current['quantity']; 779 $current['sum'] = $current['cost'] * $current['quantity']; 780 781 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'); 784 } 785 786 if (isset($receipt['sno']) && ($receipt['sno'] == 'osn') || (get_option('robokassa_country_code') == 'KZ')) { 787 $current['tax'] = $tax; 788 } else { 789 $current['tax'] = 'none'; 790 } 791 792 793 $receipt['items'][] = $current; 794 } 795 } 796 797 798 // Проверяем, активен ли плагин WooCommerce Checkout Add-Ons 799 if (is_plugin_active('woocommerce-checkout-add-ons/woocommerce-checkout-add-ons.php')) { 800 $fees = $order->get_items('fee'); 801 foreach ($fees as $fee) { 802 803 $fee_name = $fee->get_name(); 804 $fee_total = floatval($fee->get_total()); 805 806 $fee_data = array( 807 'name' => $fee_name, 808 'quantity' => 1, 809 'cost' => $fee_total, 810 'sum' => $fee_total, 811 'payment_object' => \get_option('robokassa_payment_paymentObject'), 812 'payment_method' => \get_option('robokassa_payment_paymentMethod'), 813 'tax' => \get_option('robokassa_payment_tax'), 814 ); 815 816 $receipt['items'][] = $fee_data; 817 } 769 818 } 770 819 … … 806 855 807 856 808 if (get_option('robokassa_country_code') == 'KZ') { 809 } else { 857 if (get_option('robokassa_country_code') == 'RU') { 810 858 $current['payment_object'] = \get_option('robokassa_payment_paymentObject'); 811 859 $current['payment_method'] = \get_option('robokassa_payment_paymentMethod'); … … 1282 1330 } 1283 1331 } 1284
Note: See TracChangeset
for help on using the changeset viewer.