Plugin Directory

Changeset 1235446


Ignore:
Timestamp:
09/01/2015 01:59:19 PM (11 years ago)
Author:
d363f86b
Message:

Committing watermark fix and upload fix to Wordpress.org

Location:
bulk-photo-to-product-importer-extension-for-woocommerce/trunk
Files:
10 added
3 edited

Legend:

Unmodified
Added
Removed
  • bulk-photo-to-product-importer-extension-for-woocommerce/trunk/assets/js/basic.upload.js

    r1178647 r1235446  
    8282
    8383        uploaded: function (up, file, response) {
    84                 try{
    85                 var res = $.parseJSON(response.response);
     84            var res = $.parseJSON(response.response);
     85                try{
     86               
    8687            //$('#' + file.id).remove();
    8788            if(res.success) {
  • bulk-photo-to-product-importer-extension-for-woocommerce/trunk/bptpi.php

    r1178647 r1235446  
    66Author: The Portland Company, Designed by Spencer Hill, Coded by Redeye Adaya
    77Author URI: http://www.theportlandcompany.com
    8 Version: 2.3.16
    9 Copyright: 2013 The Portland Company
     8Version: 2.3.17
     9Copyright: 2015 The Portland Company
    1010License: GPL v3
    1111*/
  • bulk-photo-to-product-importer-extension-for-woocommerce/trunk/classes/ajax.php

    r1178647 r1235446  
    220220       
    221221 $product_id = array();
     222
    222223        global $woocommerce;
    223224        $found = false;
    224225        $posted = $_POST;
    225226
    226 
     227//print_r($posted); die("die here");
    227228        if ( !isset( $posted['ptp_grouped_products'] ) ) {
    228229
     
    234235            exit;
    235236        }
    236 
     237//print_r($posted['ptp_grouped_products']);
     238$variation_name = $posted['variation'];
    237239        foreach ( $posted['ptp_grouped_products'] as $grouped_product_id ) {
    238240
    239      $version_value = get_option( '_transient_product-transient-version');
     241     $version_value = get_option('_transient_product-transient-version');
    240242
    241243   $variations = get_option( '_transient_wc_product_children_ids_' . $grouped_product_id.$version_value  );
    242 
    243244            if ( sizeof( $variations ) == 0 ) { continue; }
    244245
    245             foreach ( $variations as $variation ) {
    246              
    247                     $product_id = $variation;
    248                   //  break;
    249            
    250             }
     246foreach($variations as $variationval) {
     247$varvalue = get_post_meta($variationval, '_downloadable', true);
     248
     249if($varvalue == 'yes' && ($variation_name == 'Downloadable' OR $variation_name == 'downloadable') ){
     250$product_id = $variationval;
     251
     252} else if($varvalue == 'no' && ($variation_name != 'Downloadable') ) {
     253$product_id = $variationval;
     254}
     255
     256}
     257
     258       //     foreach ( $variations as $variation ) {
     259          //       $product_id[] = $variation;
     260                 //   break;
     261//}
     262
    251263
    252264            // If no items in cart, add product directly
    253             if ( sizeof( $woocommerce->cart->get_cart() ) == 0 ) {
    254            foreach($product_id as $product_id) {
    255              $woocommerce->cart->add_to_cart( $product_id ); }
    256            //   continue;
     265            if ( sizeof( $woocommerce->cart->get_cart() ) == 0 ) {
     266    foreach($product_id as $product_id) {
     267             $woocommerce->cart->add_to_cart( $product_id );
     268}           
     269            //  continue;
    257270            }
    258271
    259272            // If there are items in cart, check if the product is added already
    260273            foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
    261           
     274         
    262275                if ( $_product->id == $product_id ) {
     276
    263277                    $found = true;
    264278                }
    265279            }
     280
    266281               
    267282            // if product not found, add it
     
    441456        $variations_migrate_obj = PTPImporter_Variation_Migrate::getInstance();
    442457        $result = $variations_migrate_obj->migrate();
    443 
     458//print_r($result); die("Die for variation group migrate");
    444459        if ( !$result ) {
    445460            echo json_encode( array(
     
    475490        $settings = $settings_obj->get();
    476491        $bptpi_category_naming_scheme_value = $settings['bptpi_category_naming_scheme'];
     492//die("Die Here for naming scheme");
    477493        if ( isset($bptpi_category_naming_scheme_value) ) {
    478494            $bptpi_category_naming_scheme = $settings['bptpi_category_naming_scheme'];
     
    493509
    494510        global $ptp_importer;
     511//print_r($_POST['parent']); die("Die in category");
    495512        if(isset($_POST['parent']))
    496513            $termx = get_term_by( 'id', $_POST['parent'], "product_cat" );
     
    537554        // Get mini cart
    538555        ob_start();
    539         woocommerce_mini_cart();
     556      // print_r( woocommerce_mini_cart() ); die("Atleast die any where");
    540557        $mini_cart = ob_get_clean();
     558       // print_r($mini_cart); die("Die before Cart");
    541559
    542560        if ( !$mini_cart ) {
     
    545563
    546564        // Fragments and mini cart are returned
    547         $data = array(
     565      //  $data = array(
     566       //     'fragments' => apply_filters( 'add_to_cart_fragments', array(
     567       //             'div.ptp-widget-cart-content' => '<div class="ptp-widget-cart-content">' . $mini_cart . '</div>'
     568       //         )
     569      //      ),
     570      //      'cart_hash' => md5( json_encode( $woocommerce->cart->get_cart() ) )
     571      //  );
     572        $data = array(
    548573            'fragments' => apply_filters( 'add_to_cart_fragments', array(
    549                     'div.ptp-widget-cart-content' => '<div class="ptp-widget-cart-content">' . $mini_cart . '</div>'
     574                    'div.ptp-widget-cart-content' => '<div class="ptp-widget-cart-content"></div>'
    550575                )
    551576            ),
    552577            'cart_hash' => md5( json_encode( $woocommerce->cart->get_cart() ) )
    553578        );
    554 
     579//print_r($data); die("Die Before Cart-2");
    555580        echo json_encode( $data );
    556581
    557         exit;
     582       exit;
    558583    }
    559584
Note: See TracChangeset for help on using the changeset viewer.