Skip to content

Commit

Permalink
Auction Status & Auction Start Cron (#111)
Browse files Browse the repository at this point in the history
* [#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
bd-viget and nathan-schmidt-viget authored Dec 21, 2023
1 parent ce80115 commit 15f0c6b
Show file tree
Hide file tree
Showing 13 changed files with 447 additions and 135 deletions.
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
}
}
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 client-mu-plugins/goodbids/blocks/reward-product-gallery/block.php
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 client-mu-plugins/goodbids/blocks/reward-product/block.json

This file was deleted.

41 changes: 0 additions & 41 deletions client-mu-plugins/goodbids/blocks/reward-product/render.php

This file was deleted.

Loading

0 comments on commit 15f0c6b

Please sign in to comment.