Skip to content

Commit

Permalink
Merge pull request #895 from webinmd/delivery_price_change
Browse files Browse the repository at this point in the history
Управление стоимостью доставки оформленного заказа
  • Loading branch information
biz87 authored Aug 4, 2024
2 parents 229d943 + 5043087 commit 1f92ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/components/minishop2/js/mgr/orders/orders.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Ext.extend(miniShop2.window.UpdateOrder, miniShop2.window.Default, {
layout: 'form',
items: [
{xtype: 'displayfield', name: 'createdon', fieldLabel: _('ms2_createdon'), anchor: '100%'},
{xtype: 'displayfield', name: 'delivery_cost', fieldLabel: _('ms2_delivery_cost'), anchor: '100%'}
{xtype: 'numberfield', name: 'delivery_cost', fieldLabel: _('ms2_delivery_cost'), anchor: '50%'}
]
}, {
columnWidth: .33,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public function beforeSave()
$this->object->addOne($address, 'Address');
}

if ($this->object->get('delivery_cost') !== $this->delivery_cost) {
$delivery_cost = $this->object->get('delivery_cost');
$cart_cost = $this->object->get('cart_cost');
$this->object->set('cost', $delivery_cost + $cart_cost);
}

return parent::beforeSave();
}

Expand Down

0 comments on commit 1f92ce4

Please sign in to comment.