From 0afb2c0046b55c123eafb4ab9ee77efa68d12463 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 06 Jun 2026 17:15:31 +0000
Subject: [PATCH] =Starting the Favourites.js setup, converting previous Northeh stuff to new Registrar, fixing up Square.php integration to match

---
 inc/blocks/MenuBlock.php |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/inc/blocks/MenuBlock.php b/inc/blocks/MenuBlock.php
index 88fd26a..02f2338 100644
--- a/inc/blocks/MenuBlock.php
+++ b/inc/blocks/MenuBlock.php
@@ -3,7 +3,9 @@
 
 use JVBase\managers\Cache;
 use JVBase\forms\TaxonomySelector;
-use JVBase\meta\MetaManager;
+use JVBase\meta\Form;
+use JVBase\meta\Meta;
+use JVBase\meta\Render;
 use WP_Block;
 use WP_Query;
 
@@ -27,7 +29,7 @@
 
     public function __construct()
     {
-        $this->cache = Cache::for('menu', WEEK_IN_SECONDS)->connectTo('post', 'menu_item');
+        $this->cache = Cache::for('menu', WEEK_IN_SECONDS)->connect('post');
         add_action('init', [ $this, 'registerBlock' ]);
     }
 
@@ -104,8 +106,8 @@
 	protected function getSections():array
 	{
 		if (!$this->sections) {
-			$options = new MetaManager(null, 'options');
-			$sections = $options->getValue('menu_section_order');
+			$options = Meta::forOptions('options');
+			$sections = $options->get('menu_section_order');
 			if (!is_array($sections)) {
 				$sections = [];
 			}
@@ -153,7 +155,7 @@
     }
 
 	protected function renderMenuItem(int $ID, string $slug, string $postType = 'menu_item') {
-		$meta = new MetaManager($ID, 'post');
+		$meta = Meta::forPost($ID);
 		$values = $meta->getAll([
 			'post_title',
 			'_square_catalog_id',
@@ -192,18 +194,17 @@
 
 		?>
 		<div class="menu-item<?= !empty($variations) ? ' variable' : '' ?>" data-section="<?=$slug?>">
-			<div class="header row btw">
+			<div class="header row x-btw">
 				<h3><?= $values['post_title']?></h3>
 				<p class="price"><?= $priceRange ?></p>
 			</div>
 			<div class="description">
-				<?php $meta->render('render', 'post_excerpt')?>
+				<?= Render::renderFrom($meta, 'post_excerpt')?>
 			</div>
-			<div class="info row end">
+			<div class="info row right">
 				<?php
 				if (empty($variations)) {
-					$meta->render(
-						'form',
+					Form::renderFrom($meta,
 						$ID.'|cart_quantity',
 						[
 							'type'	=> 'number',
@@ -227,8 +228,7 @@
 					foreach ($variations as $index =>$row) {
 						jvbDump($index, 'index');
 						jvbDump($row, 'row');
-						$meta->render(
-							'form',
+						Form::renderFrom($meta,
 							'quantity-'.$index,
 							[
 								'type'	=> 'number',

--
Gitblit v1.10.0