Shop: Standartartikelnr für Versandartikel
authorWerner Hahn <wh@futureworldsearch.net>
Wed, 7 Apr 2021 17:40:39 +0000 (19:40 +0200)
committerWerner Hahn <wh@futureworldsearch.net>
Thu, 24 Jun 2021 14:45:05 +0000 (16:45 +0200)
SL/ShopConnector/Shopware.pm
templates/webpages/shops/form.html

index 938f99b..04cd69a 100644 (file)
@@ -151,6 +151,20 @@ sub import_data_to_shop_order {
   }
   $shop_order->positions($position-1);
 
+  if ( $self->config->shipping_costs_parts_id ) {
+    my $shipping_part = SL::DB::Part->find_by( id => $self->config->shipping_costs_parts_id);
+    my %shipping_pos = ( description    => $import->{data}->{dispatch}->{name},
+                         partnumber     => $shipping_part->partnumber,
+                         price          => $import->{data}->{invoiceShipping},
+                         quantity       => 1,
+                         position       => $position,
+                         shop_trans_id  => 0,
+                         shop_order_id  => $id,
+                       );
+    my $shipping_pos_insert = SL::DB::ShopOrderItem->new(%shipping_pos);
+    $shipping_pos_insert->save;
+  }
+
   my $customer = $shop_order->get_customer;
 
   if(ref($customer)){
index aae9d8a..cda1e0b 100644 (file)
@@ -73,7 +73,7 @@
   </tr>
   <tr>
     <th align="right">[% 'Default part for shipping costs' | $T8 %]</th>
-    <td>[%- P.part.picker('shop.shipping_costs_parts_id', 'SELF.shop.shipping_costs_parts_id', style="width: 300px") %]</td>
+    <td>[%- P.part.picker('shop.shipping_costs_parts_id', SELF.shop.shipping_costs_parts_id, style="width: 300px") %]</td>
   </tr>
   <tr>
     <th align="right">[% 'Obsolete' | $T8 %]</th>