Plugin Directory

Changeset 3111028


Ignore:
Timestamp:
07/02/2024 09:48:02 AM (21 months ago)
Author:
robokassa
Message:

1.6.1 fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • robokassa/trunk/wp_robokassa.php

    r3106617 r3111028  
    11611161        }
    11621162
     1163        if (is_plugin_active('woocommerce-checkout-add-ons/woocommerce-checkout-add-ons.php')) {
     1164            $additional_items = $order->get_items('fee');
     1165
     1166            foreach ($additional_items as $additional_item) {
     1167                $additional_item_name = $additional_item->get_name();
     1168                $additional_item_total = floatval($additional_item->get_total());
     1169
     1170                $products_items = array(
     1171                    'name' => $additional_item_name,
     1172                    'quantity' => 1,
     1173                    'cost' => $additional_item_total,
     1174                    'sum' => $additional_item_total,
     1175                    'payment_object' => \get_option('robokassa_payment_paymentObject'),
     1176                    'payment_method' => 'full_payment',
     1177                    'tax' => $tax,
     1178                );
     1179
     1180                $fields['items'][] = $products_items;
     1181
     1182                switch ($tax) {
     1183                    case "vat0":
     1184                        $fields['vats'][] = ['type' => $tax, 'sum' => 0];
     1185                        break;
     1186                    case "none":
     1187                        $fields['vats'][] = ['type' => $tax, 'sum' => 0];
     1188                        break;
     1189                    case "vat10":
     1190                        $fields['vats'][] = ['type' => $tax, 'sum' => ($shipping_total / 100) * 10];
     1191                        break;
     1192                    case "vat20":
     1193                        $fields['vats'][] = ['type' => $tax, 'sum' => ($shipping_total / 100) * 20];
     1194                        break;
     1195                    default:
     1196                        $fields['vats'][] = ['type' => 'novat', 'sum' => 0];
     1197                        break;
     1198                }
     1199            }
     1200        }
     1201
    11631202        foreach ($items as $item) {
    11641203            $products_items = [
Note: See TracChangeset for help on using the changeset viewer.