From 8ae1471c8fd80ec2bd1de08a7d03334aba4f5eb5 Mon Sep 17 00:00:00 2001
From: Nathan Schmidt <91974372+nathan-schmidt-viget@users.noreply.github.com>
Date: Tue, 19 Dec 2023 14:58:44 -0700
Subject: [PATCH] [#37] Auction page (#87)
* [#37] setting up new block and pattern
* [#37] setting up test templates
* [#37] place holder stuff
* [#37] refactor and pulling in scripts
* [#37] pulling the auction info
* [#37] updating pattern adding bid-now block
* [#37] adding reward product info
* [#37] adding excerpt to action post
* [#37] refactor moving pattern to mu plugin
* [#37] Removing text if not custom values in Auction
* [#37] refactor PR
---
.../goodbids/blocks/authentication/block.json | 1 +
.../goodbids/blocks/bid-now/block.json | 1 +
.../blocks/reward-product-gallery/block.json | 15 +++++++
.../blocks/reward-product-gallery/block.php | 29 +++++++++++++
.../blocks/reward-product-gallery/render.php | 31 +++++++++++++
.../goodbids/blocks/reward-product/block.json | 15 +++++++
.../goodbids/blocks/reward-product/render.php | 43 +++++++++++++++++++
.../src/classes/Auctions/Auctions.php | 12 ++++--
.../src/classes/Frontend/Patterns.php | 13 ++++++
.../views/patterns/template-auction.php | 39 +++++++++++++++++
.../templates/single-gb-auction.html | 3 ++
11 files changed, 198 insertions(+), 4 deletions(-)
create mode 100644 client-mu-plugins/goodbids/blocks/reward-product-gallery/block.json
create mode 100644 client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php
create mode 100644 client-mu-plugins/goodbids/blocks/reward-product-gallery/render.php
create mode 100644 client-mu-plugins/goodbids/blocks/reward-product/block.json
create mode 100644 client-mu-plugins/goodbids/blocks/reward-product/render.php
create mode 100644 client-mu-plugins/goodbids/views/patterns/template-auction.php
create mode 100644 themes/goodbids-nonprofit/templates/single-gb-auction.html
diff --git a/client-mu-plugins/goodbids/blocks/authentication/block.json b/client-mu-plugins/goodbids/blocks/authentication/block.json
index 92f634df5..86eb7f047 100644
--- a/client-mu-plugins/goodbids/blocks/authentication/block.json
+++ b/client-mu-plugins/goodbids/blocks/authentication/block.json
@@ -4,6 +4,7 @@
"description": "Displays a user login and registration form for GoodBids.",
"icon": "feedback",
"category": "goodbids",
+ "textdomain": "goodbids",
"keywords": ["custom", "sign", "up", "register", "registration", "form", "users", "authentication"],
"acf": {
"mode": "preview"
diff --git a/client-mu-plugins/goodbids/blocks/bid-now/block.json b/client-mu-plugins/goodbids/blocks/bid-now/block.json
index 9d44c7053..737758dbe 100644
--- a/client-mu-plugins/goodbids/blocks/bid-now/block.json
+++ b/client-mu-plugins/goodbids/blocks/bid-now/block.json
@@ -4,6 +4,7 @@
"description": "Displays a bid now button for the current Auction.",
"icon": "money-alt",
"category": "goodbids",
+ "textdomain": "goodbids",
"keywords": ["bid", "purchase", "donate", "button", "submit", "cart"],
"acf": {
"mode": "preview"
diff --git a/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.json b/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.json
new file mode 100644
index 000000000..66b04e7fa
--- /dev/null
+++ b/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.json
@@ -0,0 +1,15 @@
+{
+ "name": "reward-product-gallery",
+ "title": "Reward Product Gallery",
+ "description": "Displays the reward product gallery images",
+ "icon": "format-gallery",
+ "category": "goodbids",
+ "textdomain": "goodbids",
+ "keywords": ["custom", "gallery", "product", "reward", "auction"],
+ "acf": {
+ "mode": "preview"
+ },
+ "supports": {
+ "jsx": false
+ }
+}
diff --git a/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php b/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php
new file mode 100644
index 000000000..c99c18131
--- /dev/null
+++ b/client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php
@@ -0,0 +1,29 @@
+auctions->get_reward_product_id( goodbids()->auctions->get_auction_id() );
+$reward = wc_get_product( $reward_id );
+if ( $reward ) {
+ $product = $reward;
+}
+?>
+
+
+
%s
', + esc_html__( $estimated_value, 'goodbids' ) + ); + } + + // Expected High Bid + if ( $expected_high_bid ) { + printf( + '%s
', + esc_html__( $expected_high_bid, 'goodbids' ) + ); + } + ?> +