Advertisement
designerken

functions.php

Dec 23rd, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <?php
  2.  
  3. class SSi_WC_Swatch_Picker extends WC_Swatch_Picker {
  4.  
  5.     public function picker() {
  6.         ?>
  7.  
  8.         <div class="variations-table">
  9.  
  10.                 <?php
  11.                 echo '<p>Start the Loop</p>';
  12.                 $loop = 0;
  13.                 foreach ( $this->attributes as $name => $options ) : $loop++;
  14.                     $st_name = sanitize_title( $name );
  15.                     $hashed_name = md5( $st_name );
  16.                     $lookup_name = '';
  17.                     if ( isset( $this->swatch_type_options[$hashed_name] ) ) {
  18.                         $lookup_name = $hashed_name;
  19.                     } elseif ( isset( $this->swatch_type_options[$st_name] ) ) {
  20.                         $lookup_name = $st_name;
  21.                     }
  22.                     ?>
  23.                     <div>
  24.                         <div class="label"><label for="<?php echo $st_name; ?>"><?php echo WC_Swatches_Compatibility::wc_attribute_label( $name ); ?></label></div>
  25.                         <div>
  26.                             <?php
  27.                             if ( isset( $this->swatch_type_options[$lookup_name] ) ) {
  28.                                 $picker_type = $this->swatch_type_options[$lookup_name]['type'];
  29.                                 if ( $picker_type == 'default' ) {
  30.                                     $this->render_default( $st_name, $options );
  31.                                 } else {
  32.                                     $this->render_picker( $st_name, $options, $name );
  33.                                 }
  34.                             } else {
  35.                                 $this->render_default( $st_name, $options );
  36.                             }
  37.                             ?>
  38.                         </div>
  39.                     </div>
  40.                 <?php endforeach;
  41.                     echo '<p>End the Loop</p>';
  42.                 ?>
  43.         </div>
  44.                
  45.         <?php
  46.     }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement