-
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.
Merge branch 'main' into bd/25-dynamic-bid-pricing
- Loading branch information
Showing
17 changed files
with
496 additions
and
54 deletions.
There are no files selected for viewing
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
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
15 changes: 15 additions & 0 deletions
15
client-mu-plugins/goodbids/blocks/reward-product-gallery/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": "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 | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Initialize the WooCommerce Gallery Script | ||
* | ||
* @since 1.0.0 | ||
* | ||
* @return void | ||
*/ | ||
|
||
|
||
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' ); | ||
} | ||
} | ||
); |
31 changes: 31 additions & 0 deletions
31
client-mu-plugins/goodbids/blocks/reward-product-gallery/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,31 @@ | ||
<?php | ||
/** | ||
* Block: Reward Product Gallery | ||
* | ||
* @global array $block | ||
* | ||
* @since 1.0.0 | ||
* @package GoodBids | ||
*/ | ||
|
||
global $product; | ||
$reward_id = goodbids()->auctions->get_reward_product_id( goodbids()->auctions->get_auction_id() ); | ||
$reward = wc_get_product( $reward_id ); | ||
if ( $reward ) { | ||
$product = $reward; | ||
} | ||
?> | ||
|
||
|
||
<section <?php block_attr( $block ); ?>> | ||
<?php | ||
if ( $product ) { | ||
wc_get_template( 'single-product/product-image.php' ); | ||
} else { | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( 'No Auction Product selected', 'goodbids' ) | ||
); | ||
} | ||
?> | ||
</section> |
15 changes: 15 additions & 0 deletions
15
client-mu-plugins/goodbids/blocks/reward-product/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": "reward-product", | ||
"title": "Reward Product", | ||
"description": "Displays the reward product information", | ||
"icon": "awards", | ||
"category": "goodbids", | ||
"textdomain": "goodbids", | ||
"keywords": ["custom", "product", "reward", "auction"], | ||
"acf": { | ||
"mode": "preview" | ||
}, | ||
"supports": { | ||
"jsx": false | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
client-mu-plugins/goodbids/blocks/reward-product/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,43 @@ | ||
<?php | ||
/** | ||
* Block: Reward Product | ||
* | ||
* @global array $block | ||
* | ||
* @since 1.0.0 | ||
* @package GoodBids | ||
*/ | ||
|
||
$goal = goodbids()->auctions->get_goal( goodbids()->auctions->get_auction_id() ); | ||
$estimated_value = goodbids()->auctions->get_estimated_value( $auction_id ); | ||
$expected_high_bid = goodbids()->auctions->get_expected_high_bid( $auction_id ); | ||
?> | ||
|
||
|
||
<section <?php block_attr( $block ); ?>> | ||
<?php | ||
// Goal | ||
if ( $goal ) { | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( $goal, 'goodbids' ) | ||
); | ||
} | ||
|
||
// Estimated Value | ||
if ( $estimated_value ) { | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( $estimated_value, 'goodbids' ) | ||
); | ||
} | ||
|
||
// Expected High Bid | ||
if ( $expected_high_bid ) { | ||
printf( | ||
'<p style="text-align: center;">%s</p>', | ||
esc_html__( $expected_high_bid, 'goodbids' ) | ||
); | ||
} | ||
?> | ||
</section> |
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
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
Oops, something went wrong.