Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SSi_WC_Swatch_Picker extends WC_Swatch_Picker {
- public function picker() {
- ?>
- <div class="variations-table">
- <?php
- echo '<p>Start the Loop</p>';
- $loop = 0;
- foreach ( $this->attributes as $name => $options ) : $loop++;
- $st_name = sanitize_title( $name );
- $hashed_name = md5( $st_name );
- $lookup_name = '';
- if ( isset( $this->swatch_type_options[$hashed_name] ) ) {
- $lookup_name = $hashed_name;
- } elseif ( isset( $this->swatch_type_options[$st_name] ) ) {
- $lookup_name = $st_name;
- }
- ?>
- <div>
- <div class="label"><label for="<?php echo $st_name; ?>"><?php echo WC_Swatches_Compatibility::wc_attribute_label( $name ); ?></label></div>
- <div>
- <?php
- if ( isset( $this->swatch_type_options[$lookup_name] ) ) {
- $picker_type = $this->swatch_type_options[$lookup_name]['type'];
- if ( $picker_type == 'default' ) {
- $this->render_default( $st_name, $options );
- } else {
- $this->render_picker( $st_name, $options, $name );
- }
- } else {
- $this->render_default( $st_name, $options );
- }
- ?>
- </div>
- </div>
- <?php endforeach;
- echo '<p>End the Loop</p>';
- ?>
- </div>
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement