first commit
This commit is contained in:
36
autoload/admin/controls/class.ShopTransport.php
Normal file
36
autoload/admin/controls/class.ShopTransport.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace admin\controls;
|
||||
class ShopTransport
|
||||
{
|
||||
public static function transport_save()
|
||||
{
|
||||
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania rodzaju transportu wystąpił błąd. Proszę spróbować ponownie.' ];
|
||||
$values = json_decode( \S::get( 'values' ), true );
|
||||
|
||||
if ( $id = \admin\factory\ShopTransport::transport_save(
|
||||
$values['id'], $values['name'], $values['name_visible'], $values['description'], $values['status'], $values['cost'], $values['payment_methods'], $values['max_wp'], $values['default'], $values['apilo_carrier_account_id'], $values['sellasist_shipment_method_id'], $values['delivery_free']
|
||||
) )
|
||||
$response = [ 'status' => 'ok', 'msg' => 'Rodzaj transportu został zapisany.', 'id' => $id ];
|
||||
|
||||
echo json_encode( $response );
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function transport_edit()
|
||||
{
|
||||
return \Tpl::view( 'shop-transport/transport-edit', [
|
||||
'transport_details' => \admin\factory\ShopTransport::transport_details( \S::get( 'id' ) ),
|
||||
'payments_list' => \admin\factory\ShopPaymentMethod::payments_list(),
|
||||
'apilo_carrier_account_list' => unserialize( \admin\factory\Integrations::apilo_settings( 'carrier-account-list' ) ),
|
||||
'sellasist_shipments_methods' => unserialize( \admin\factory\Integrations::sellasist_settings( 'shipments_methods' ) ),
|
||||
] );
|
||||
}
|
||||
|
||||
public static function view_list()
|
||||
{
|
||||
return \Tpl::view( 'shop-transport/view-list', [
|
||||
'apilo_carrier_account_list' => unserialize( \admin\factory\Integrations::apilo_settings( 'carrier-account-list' ) ),
|
||||
'sellasist_shipments_methods' => unserialize( \admin\factory\Integrations::sellasist_settings( 'shipments_methods' ) ),
|
||||
] );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user