| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Variation Metabox. |
| 4 |
* |
| 5 |
* @package WCPOS\WooCommercePOS |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! \defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
// phpcs:disable Squiz.Commenting.FileComment.Missing -- Template file. |
| 13 |
/** |
| 14 |
* Variation metabox visibility select template. |
| 15 |
* |
| 16 |
* @var \WP_Post $variation |
| 17 |
* @var \WCPOS\WooCommercePOS\Admin\Products\Single_Product $this |
| 18 |
* @var string $selected |
| 19 |
*/ |
| 20 |
?> |
| 21 |
|
| 22 |
<div> |
| 23 |
<p class="form-row form-row-full"> |
| 24 |
<label |
| 25 |
for="variable_pos_visibility[<?php echo esc_attr( (string) $variation->ID ); ?>]"><?php /* translators: Product POS visibility label in WooCommerce admin. */ esc_html_e( 'POS visibility', 'woocommerce-pos' ); ?></label> |
| 26 |
<select name="variable_pos_visibility[<?php echo esc_attr( (string) $variation->ID ); ?>]"> |
| 27 |
<?php |
| 28 |
foreach ( $this->options as $wcpos_value => $wcpos_label ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variables. @phpstan-ignore-line |
| 29 |
$wcpos_select = $wcpos_value == $selected ? 'selected="selected"' : ''; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variable. |
| 30 |
?> |
| 31 |
<option value="<?php echo esc_attr( $wcpos_value ); ?>" <?php echo esc_attr( $wcpos_select ); ?>> <?php echo esc_html( $wcpos_label ); ?> </option> |
| 32 |
<?php } ?> |
| 33 |
</select> |
| 34 |
</p> |
| 35 |
</div> |
| 36 |
|