예제 #1
0
                     $variations_builder_element_start_args["tm_undo_button"] = '<span data-tm-for-variation="' . $att_id . '" class="tm-epo-reset-variation"><i class="tcfa tcfa-undo"></i></span>';
                 } else {
                     $variations_builder_element_start_args["tm_undo_button"] = "";
                 }
                 $variations_builder_element_start_args["tm_product_id"] = isset($tm_product_id) ? $tm_product_id : 0;
                 wc_get_template('tm-builder-element-start.php', $variations_builder_element_start_args, $tm__namespace, $tm_template_path);
                 $v_field_counter = 0;
                 $fake_element = array("default_value" => $default_value, "class" => $variations_class . " tm-epo-variation-element", "textbeforeprice" => "", "textafterprice" => "", "hide_amount" => "hidden", "use_images" => $variations_display_as == "image" || $variations_display_as == "color" ? "images" : "", "use_url" => "", "images" => $images, "imagesp" => $imagesp, "url" => array(), "limit" => "", "items_per_row" => $variations_items_per_row, "item_width" => $variations_item_width, "item_height" => $variations_item_height, "show_label" => $variations_show_name, "exactlimit" => "", "minimumlimit" => "", "swatchmode" => "", "changes_product_image" => $changes_product_image, "containter_css_id" => "variation-element-");
                 $element_display->display_field_pre($fake_element, array('element_counter' => $loop, 'tabindex' => $v_field_counter, 'form_prefix' => $form_prefix, 'field_counter' => $v_field_counter, 'product_id' => isset($tm_product_id) ? $tm_product_id : 0));
                 foreach ($options_array as $value => $label) {
                     if (isset($color[$v_field_counter])) {
                         $fake_element["color"] = $color[$v_field_counter];
                     } else {
                         unset($fake_element["color"]);
                     }
                     $display = $element_display->display_field($fake_element, array('name_inc' => 'tm_attribute_' . $att_id . "_" . $loop . $form_prefix, 'value' => $value, 'label' => $label, 'element_counter' => $loop, 'tabindex' => $v_field_counter, 'form_prefix' => $form_prefix, 'field_counter' => $v_field_counter));
                     if (is_array($display)) {
                         $field_args = array('tm_element_settings' => $fake_element, 'id' => 'tm_attribute_id_' . $att_id . "_" . $loop . "_" . $v_field_counter . "_" . intval($v_field_counter + $loop) . $form_prefix, 'name' => 'tm_attribute_' . $att_id . "_" . $loop . $form_prefix, 'class' => $variations_class . " tm-epo-variation-element", 'tabindex' => $v_field_counter, 'rules' => '', 'rules_type' => '', 'tabindex' => "", 'amount' => "", 'element_data_attr' => array("data-tm-for-variation" => $att_id), 'border_type' => TM_EPO()->tm_epo_css_selected_border);
                         $field_args = array_merge($field_args, $display);
                         wc_get_template('tm-radio.php', $field_args, $tm__namespace, $tm_template_path);
                     }
                     $v_field_counter++;
                 }
                 wc_get_template('tm-builder-element-end.php', $variations_builder_element_end_args, $tm__namespace, $tm_template_path);
             }
             break;
     }
 }
 if (sizeof($attributes) == $loop) {
     echo '<a class="reset_variations" href="#reset">' . (!empty(TM_EPO()->tm_epo_reset_variation_text) ? TM_EPO()->tm_epo_reset_variation_text : __('Reset options', TM_EPO_TRANSLATION)) . '</a>';
 }