FALSE,
'attribute' => FALSE,
'product' => FALSE,
'selected' => FALSE,
'name' => '',
'id' => '',
'class' => '',
'show_option_none' => esc_html__( 'Choose an option', 'ayyash' )
) );
$options = $args[ 'options' ];
$product = $args[ 'product' ];
$attribute = $args[ 'attribute' ];
$name = $args[ 'name' ] ? $args[ 'name' ] : 'attribute_' . sanitize_title( $attribute );
$id = $args[ 'id' ] ? $args[ 'id' ] : sanitize_title( $attribute ) . $product->get_id();
$class = $args[ 'class' ];
if ( empty( $options ) && ! empty( $product ) && ! empty( $attribute ) ) {
$attributes = $product->get_variation_attributes();
$options = $attributes[ $attribute ];
}
echo '';
echo '
';
if ( ! empty( $options ) ) {
if ( $product && taxonomy_exists( $attribute ) ) {
$terms = wc_get_product_terms( $product->get_id(), $attribute, array( 'fields' => 'all' ) );
foreach ( $terms as $term ) {
if ( in_array( $term->slug, $options ) ) {
$get_term_meta = get_term_meta( $term->term_id, 'rox_taxonomy_color', TRUE );
$selected_class = ( sanitize_title( $args[ 'selected' ] ) == $term->slug ) ? 'selected' : '';
if (!empty($get_term_meta)){
?>
';
}
endif;
//-------------------------------------------------------------------------------
// Image Variation Attribute Options
//-------------------------------------------------------------------------------
if ( ! function_exists( 'rox_wc_size_variation_attribute_options' ) ) :
function rox_wc_size_variation_attribute_options( $args = array() ) {
$args = wp_parse_args( $args, array(
'options' => FALSE,
'attribute' => FALSE,
'product' => FALSE,
'selected' => FALSE,
'name' => '',
'id' => '',
'class' => '',
'show_option_none' => esc_html__( 'Choose an option','ayyash' )
) );
$options = $args[ 'options' ];
$product = $args[ 'product' ];
$attribute = $args[ 'attribute' ];
$name = $args[ 'name' ] ? $args[ 'name' ] : 'attribute_' . sanitize_title( $attribute );
$id = $args[ 'id' ] ? $args[ 'id' ] : sanitize_title( $attribute ) . $product->get_id();
$class = $args[ 'class' ];
if ( empty( $options ) && ! empty( $product ) && ! empty( $attribute ) ) {
$attributes = $product->get_variation_attributes();
$options = $attributes[ $attribute ];
}
echo '';
echo '';
if ( ! empty( $options ) ) {
if ( $product && taxonomy_exists( $attribute ) ) {
$terms = wc_get_product_terms( $product->get_id(), $attribute, array( 'fields' => 'all' ) );
foreach ( $terms as $term ) {
if ( in_array( $term->slug, $options ) ) {
$term_meta = get_term_meta( $term->term_id, 'rox_taxonomy_size', TRUE );
//$image = wp_get_attachment_image_src( $get_term_meta, 'full' );
$selected_class = ( sanitize_title( $args[ 'selected' ] ) == $term->slug ) ? 'selected' : '';
if(!empty($term_meta)){
?>
-
S
 ?>)
-
name ) ?>
';
}
endif;