html-admin-notification-create.php
1 month ago
html-admin-notification-edit.php
10 months ago
html-admin-notifications.php
10 months ago
html-product-data-admin.php
10 months ago
html-product-data-admin.php
50 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Stock Notifications selected product |
| 4 | * |
| 5 | * @since 10.2.0 |
| 6 | */ |
| 7 | |
| 8 | declare( strict_types = 1 ); |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | $image = wp_get_attachment_image_src( $product->get_image_id(), 'woocommerce_thumbnail' ); |
| 15 | $image_src = is_array( $image ) && isset( $image[0] ) ? $image[0] : ''; |
| 16 | $stock_availability = $product->get_availability(); |
| 17 | $identifier = '#' . $product->get_id(); |
| 18 | if ( ! empty( $product->get_sku() ) ) { |
| 19 | $identifier = $product->get_sku(); |
| 20 | } |
| 21 | ?> |
| 22 | |
| 23 | <img src="<?php echo esc_attr( $image_src ? $image_src : wc_placeholder_img_src() ); ?>" alt="<?php echo esc_attr( $product->get_name() ); ?>"> |
| 24 | |
| 25 | <div class="product-details"> |
| 26 | |
| 27 | <p class="product-details__title"> |
| 28 | <?php echo esc_html( $product->get_name() ); ?> |
| 29 | <span> |
| 30 | <?php printf( '(%s)', esc_html( $identifier ) ); ?> |
| 31 | </span> |
| 32 | <a target="_blank" href="<?php echo esc_url( admin_url( sprintf( 'post.php?post=%d&action=edit', $product->get_parent_id() ? $product->get_parent_id() : $product->get_id() ) ) ); ?>"><span class="dashicons dashicons-external"></span></a> |
| 33 | </p> |
| 34 | |
| 35 | <span class="product-details__price"> |
| 36 | <?php echo wp_kses_post( $product->get_price_html( 'edit' ) ); ?> |
| 37 | </span> |
| 38 | |
| 39 | <span class="product-details__stock-status <?php echo esc_attr( $stock_availability['class'] ); ?>"> |
| 40 | <?php |
| 41 | if ( empty( $stock_availability['availability'] ) && 'in-stock' === $stock_availability['class'] ) { |
| 42 | echo esc_html__( 'In stock', 'woocommerce' ); |
| 43 | } else { |
| 44 | echo esc_html( $stock_availability['availability'] ); |
| 45 | } |
| 46 | ?> |
| 47 | </span> |
| 48 | |
| 49 | </div> |
| 50 |