From 82034151ec366dadc859bb418bdfa41e780ca62b Mon Sep 17 00:00:00 2001 From: Werner Hahn Date: Wed, 7 Apr 2021 19:40:39 +0200 Subject: [PATCH] =?utf8?q?Shop:=20Standartartikelnr=20f=C3=BCr=20Versandar?= =?utf8?q?tikel?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/ShopConnector/Shopware.pm | 14 ++++++++++++++ templates/webpages/shops/form.html | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SL/ShopConnector/Shopware.pm b/SL/ShopConnector/Shopware.pm index 938f99b17..04cd69a59 100644 --- a/SL/ShopConnector/Shopware.pm +++ b/SL/ShopConnector/Shopware.pm @@ -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)){ diff --git a/templates/webpages/shops/form.html b/templates/webpages/shops/form.html index aae9d8a8b..cda1e0bb1 100644 --- a/templates/webpages/shops/form.html +++ b/templates/webpages/shops/form.html @@ -73,7 +73,7 @@ [% 'Default part for shipping costs' | $T8 %] - [%- P.part.picker('shop.shipping_costs_parts_id', 'SELF.shop.shipping_costs_parts_id', style="width: 300px") %] + [%- P.part.picker('shop.shipping_costs_parts_id', SELF.shop.shipping_costs_parts_id, style="width: 300px") %] [% 'Obsolete' | $T8 %] -- 2.20.1