Dodanie funkcji do ponownego wysyłania zamówienia do apilo.com oraz czyszczenia pamięci podręcznej w panelu administracyjnym

This commit is contained in:
2024-12-20 21:29:56 +01:00
parent d6270fe621
commit 2880d3e6fc
9 changed files with 160 additions and 4 deletions

View File

@@ -3,6 +3,19 @@ namespace admin\controls;
class Settings
{
static public function clear_cache()
{
\S::delete_dir( '../temp/' );
\S::delete_dir( '../thumbs/' );
$redis = \RedisConnection::getInstance() -> getConnection();
$redis -> flushAll();
\S::alert( 'Cache został wyczyszczony.' );
header( 'Location: /admin/dashboard/main_view/' );
exit;
}
public static function settings_save()
{
$values = json_decode( \S::get( 'values' ), true );

View File

@@ -2,6 +2,18 @@
namespace admin\controls;
class ShopOrder
{
static public function send_order_to_apilo()
{
$order_id = \S::get( 'order_id' );
if ( \admin\factory\ShopOrder::send_order_to_apilo( $order_id ) ) {
\S::alert( 'Zamówienie zostanie wysłane ponownie do apilo.com' );
} else {
\S::alert( 'Wystąpił błąd podczas wysyłania zamówienia do apilo.com' );
}
header( 'Location: /admin/shop_order/order_details/order_id=' . $order_id );
exit;
}
static public function order_resend_confirmation_email()
{
$order = new \shop\Order( (int)\S::get( 'order_id' ) );