-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auction Status & Auction Start Cron (#111)
* [#81] Set and Get the GUID for Auctions * [#81] Added Auction End Date/Time field * [#81] API access method + documentation * Fix a PHP bug. * VS Code settings and extensions recommendations * Update Auction Meta Box, Determine Auction Status * Just some PR feedback that got left off. * [#26] Data validation, restructure, & Status Column * [#26] Added Time Until info * Styling tweaks * [#26] Update Auction meta when auction has started. * [#26] Cron hook documentation * [#26] Last minute tweaks. * [#26] Better method name. * [#26] Removed a space * [#26] Swap API for $this * [#26] More last second fixes. * [N/A] Modified Auction Metrics block. * [N/A] Last change to Pattern --------- Co-authored-by: Nathan Schmidt <[email protected]>
- Loading branch information
1 parent
ce80115
commit 15f0c6b
Showing
13 changed files
with
447 additions
and
135 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
client-mu-plugins/goodbids/blocks/auction-metrics-general/block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "auction-metrics-general", | ||
"title": "Auction Metrics (General)", | ||
"description": "Displays the general Auction metrics.", | ||
"icon": "awards", | ||
"category": "goodbids", | ||
"textdomain": "goodbids", | ||
"keywords": ["custom", "details", "stats", "auction"], | ||
"acf": { | ||
"mode": "preview" | ||
}, | ||
"supports": { | ||
"jsx": false | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
client-mu-plugins/goodbids/blocks/auction-metrics-general/render.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Block: Auction Metrics (General) | ||
* | ||
* @global array $block | ||
* | ||
* @since 1.0.0 | ||
* @package GoodBids | ||
*/ | ||
|
||
$goal = goodbids()->auctions->get_goal(); | ||
$estimated_value = goodbids()->auctions->get_estimated_value(); | ||
$expected_high_bid = goodbids()->auctions->get_expected_high_bid(); | ||
|
||
// Display an Admin message to make the block easier to find. | ||
if ( ! $goal && ! $estimated_value && ! $expected_high_bid && is_admin() ) : | ||
printf( | ||
'<p style="text-align:center;">%s</p>', | ||
esc_html__( 'No stats yet.', 'goodbids' ) | ||
); | ||
return; | ||
endif; | ||
?> | ||
<section <?php block_attr( $block ); ?>> | ||
<?php | ||
// Goal. | ||
if ( $goal ) : | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( wc_price( $goal ), 'goodbids' ) | ||
); | ||
endif; | ||
|
||
// Estimated Value. | ||
if ( $estimated_value ) : | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( wc_price( $estimated_value ), 'goodbids' ) | ||
); | ||
endif; | ||
|
||
// Expected High Bid. | ||
if ( $expected_high_bid ) : | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( wc_price( $expected_high_bid ), 'goodbids' ) | ||
); | ||
endif; | ||
?> | ||
</section> |
38 changes: 21 additions & 17 deletions
38
client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
<?php | ||
/** | ||
* Initialize the WooCommerce Gallery Script | ||
* Reward Product Gallery Block | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return void | ||
* @package GoodBids | ||
*/ | ||
|
||
|
||
/** | ||
* Initialize the WooCommerce Gallery Assets | ||
*/ | ||
add_action( | ||
'wp_enqueue_scripts', | ||
function () { | ||
if ( is_singular( 'gb-auction' ) ) { | ||
if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) { | ||
wp_enqueue_script( 'zoom' ); | ||
} | ||
if ( current_theme_supports( 'wc-product-gallery-slider' ) ) { | ||
wp_enqueue_script( 'flexslider' ); | ||
} | ||
if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) { | ||
wp_enqueue_script( 'photoswipe-ui-default' ); | ||
wp_enqueue_style( 'photoswipe-default-skin' ); | ||
add_action( 'wp_footer', 'woocommerce_photoswipe' ); | ||
} | ||
wp_enqueue_script( 'wc-single-product' ); | ||
// TODO: Change this to a check to see if this block is currently being used. | ||
if ( ! is_singular( goodbids()->auctions->get_post_type() ) ) { | ||
return; | ||
} | ||
|
||
if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) { | ||
wp_enqueue_script( 'zoom' ); | ||
} | ||
if ( current_theme_supports( 'wc-product-gallery-slider' ) ) { | ||
wp_enqueue_script( 'flexslider' ); | ||
} | ||
if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) { | ||
wp_enqueue_script( 'photoswipe-ui-default' ); | ||
wp_enqueue_style( 'photoswipe-default-skin' ); | ||
add_action( 'wp_footer', 'woocommerce_photoswipe' ); | ||
} | ||
wp_enqueue_script( 'wc-single-product' ); | ||
} | ||
); |
15 changes: 0 additions & 15 deletions
15
client-mu-plugins/goodbids/blocks/reward-product/block.json
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
client-mu-plugins/goodbids/blocks/reward-product/render.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.