Plugin Directory

Changeset 357431

Timestamp:
03/08/2011 10:04:46 PM (13 years ago)
Author:
jghazally
Message:

I hope this does not blow up in my face

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-e-commerce/branches/3.8-development/wpsc-admin/includes/updating-functions.php

    r354335 r357431  
    372372        // select the variation set associations
    373373        $variation_set_associations = $wpdb->get_col("SELECT `variation_id` FROM ".WPSC_TABLE_VARIATION_ASSOC." WHERE `associated_id` = '{$original_id}'");
    374 
     374        //echo '$variation_set_associations<pre>'.print_r($variation_set_associations,1).'</pre>';
    375375        // select the variation associations if the count of variation sets is greater than zero
    376376        if(($original_id > 0) && (count($variation_set_associations) > 0)) {
     
    380380            continue;
    381381        }
    382        
     382   
    383383        foreach($variation_set_associations as $variation_set_id) {
    384384            $base_product_terms[] = wpsc_get_meta($variation_set_id, 'variation_set_id', 'wpsc_variation_set');
     
    415415           
    416416            // select all values this "product" is associated with, then loop through them, getting the term id of the variation using the value ID
    417             $variation_associations = $wpdb->get_results("SELECT * FROM ".WPSC_TABLE_VARIATION_COMBINATIONS." WHERE `priceandstock_id` = '{$variation_item->id}'");
    418             foreach((array)$variation_associations as $association) {
     417            $variation_associations = $wpdb->get_results("SELECT * FROM ".WPSC_TABLE_VARIATION_COMBINATIONS." WHERE `priceandstock_id` = '{$variation_item->id}'");
     418            foreach((array)$variation_associations as $association) {
    419419                $variation_id = (int)wpsc_get_meta($association->value_id, 'variation_id', 'wpsc_variation');
    420420                // discard any values that are null, as they break the selecting of the terms
    421                 if($variation_id > 0) {
     421                if($variation_id > 0) {
    422422                    $variation_ids[] = $variation_id;
    423423                }
     
    425425           
    426426            // if we have more than zero remaining terms, get the term data, then loop through it to convert it to a more useful set of arrays.
    427             if(count($variation_ids) > 0) {
     427            if(count($variation_ids) > 0) {
    428428                $combination_terms = get_terms('wpsc-variation', array(
    429429                    'hide_empty' => 0,
     
    431431                    'orderby' => 'parent',
    432432                ));
     433
    433434                foreach($combination_terms as $term) {
    434435                    $term_data['ids'][] = $term->term_id;
Note: See TracChangeset for help on using the changeset viewer.