From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh
---
inc/integrations/services/Square.php | 48 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/inc/integrations/services/Square.php b/inc/integrations/services/Square.php
index aeb001b..8b92d3f 100644
--- a/inc/integrations/services/Square.php
+++ b/inc/integrations/services/Square.php
@@ -4,7 +4,7 @@
use Exception;
use JVBase\integrations\Admin;
use JVBase\integrations\APIEndpoint;
-use JVBase\integrations\Instance;
+use JVBase\Instance;
use JVBase\integrations\Integrations;
use JVBase\integrations\OAuth;
use JVBase\integrations\OAuthCredentials;
@@ -18,6 +18,7 @@
use JVBase\managers\queue\TypeConfig;
use JVBase\meta\Sanitizer;
use JVBase\registrar\Registrar;
+use JVBase\ui\CRUDSkeleton;
use WP_Error;
if (!defined('ABSPATH')) {
@@ -163,6 +164,37 @@
add_action(BASE.'dashboard_page_orders', [$this, 'renderDashPage']);
}
+ public function addDashboardPages():void
+ {
+ $page = Dashboard::getInstance()->addPage('Your Orders', 'orders', 'receipt');
+ $page->setScripts(['jvb-crud']);
+ }
+
+ public function renderDashPage():void
+ {
+ $this->determineUser();
+
+ $crud = new CRUDSkeleton();
+ $crud->icon('receipt');
+ $crud->title('Your Orders','Here you can see your past orders, and reorder from there if you\'d like');
+ $crud->content($this->orderPostType, 'Order', 'Orders');
+ $crud->addSearch();
+ $crud->addCapabilities(['view']);
+ $crud->setEmptyState(sprintf(
+ '<div class="empty-state">
+ <h3>%sNothing here%s</h3>
+ <p>It doesn\'t look like you have any orders yet.</p>
+ <p>Head on over to <a href="%s">our menu</a> and make your first order!</p>
+ </div>',
+ jvbDashIcon($crud->getIcon()),
+ jvbDashIcon($crud->getIcon()),
+ get_post_type_archive_link(BASE.'menu_item')
+ ));
+
+
+ $crud->render();
+ }
+
protected function initialize(): void
{
$this->defineEndpoints();
@@ -718,7 +750,7 @@
********************************************************************/
protected function registerAdditionalQueueTypes(IntegrationExecutor $executor): void
{
- $queue = JVB()->queue();
+ $queue = Queue::getInstance();
$queue->registry()->register(
self::$syncCustomer,
new TypeConfig(
@@ -863,7 +895,7 @@
{
return $this->loadCredentials()['location_id']??false;
}
- protected function getLocations():array|false
+ public function getLocations():array|false
{
if (!$this->getAccessToken()) {
return false;
@@ -954,7 +986,17 @@
return $this->contentTypes[$content_type];
}
+ public function handleImportFromSquare():array
+ {
+ return $this->response(true, 'Did a thing');
+ }
+
+ public function handleSyncToSquare():array
+ {
+
+ return $this->response(true, 'Did a thing');
+ }
}
--
Gitblit v1.10.0