is_visible() ) { return; } $product_id = $product->get_id(); $permalink = get_permalink( $product_id ); $is_simple = $product->is_type( 'simple' ); $is_purchasable = $product->is_purchasable(); // Build Buy Now target: add to cart + go to checkout. $buy_now_url = add_query_arg( array( 'add-to-cart' => $product_id, 'buy-now' => 1, // Checkout redirect hook can look for this. ), wc_get_checkout_url() ); ?>
  • >
    Sale! $sale_html = trim( ob_get_clean() ); if ( $sale_html ) { // Add extra class so CSS can style it like quick-view icon and center it properly. $sale_html = str_replace( 'class="onsale"', 'class="onsale bt-badge bt-badge-sale"', $sale_html ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
    ' . $sale_html . '
    '; } // Thumbnail. woocommerce_template_loop_product_thumbnail(); ?>

    %s', esc_url( $buy_now_url ), esc_attr__( 'Buy now', 'bongoto-shop' ), esc_html__( 'Buy Now', 'bongoto-shop' ) ); } else { // Only ONE read more/details link. printf( '%s', esc_url( $permalink ), esc_attr__( 'View details', 'bongoto-shop' ), esc_html__( 'Read more', 'bongoto-shop' ) ); } ?>