Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Winning badge template modification to show "Outbidded!" badge in loop for users that have participated in auction but have been outbidded.
- Template location: plugin_dir\templates\loop\winning-bage.php
- Copy this modification to your_child_theme\woocommerce\loop\winning-bage.php
- */
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
- global $product;
- if ( method_exists( $product, 'get_type') && $product->get_type() == 'auction' ) :
- $user_id = get_current_user_id();
- $prodid = $product->get_id();
- if ($user_id == $product->get_auction_current_bider() && !$product->get_auction_closed() && !$product->is_sealed()) :
- echo apply_filters('woocommerce_simple_auction_winning_bage', '<span class="winning" data-auction_id="'.$prodid.'" data-user_id="'.get_current_user_id().'">'.__( 'Winning!', 'wc_simple_auctions' ).'</span>', $product);
- else:
- if ( $product -> is_user_biding($prodid, $user_id) && !$product->get_auction_closed() && !$product->is_sealed() ):
- echo apply_filters('woocommerce_simple_auction_winning_bage', '<span class="winning" style="background: red" data-auction_id="'.$prodid.'" data-user_id="'.get_current_user_id().'">'.__( 'Outbidded!', 'wc_simple_auctions' ).'</span>', $product);
- endif;
- endif;
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement