Changeset 1235446
- Timestamp:
- 09/01/2015 01:59:19 PM (11 years ago)
- Location:
- bulk-photo-to-product-importer-extension-for-woocommerce/trunk
- Files:
-
- 10 added
- 3 edited
-
assets/images/plugin-directory-assets/banner-772x250.png (added)
-
assets/images/plugin-directory-assets/screenshot-1.png (added)
-
assets/images/plugin-directory-assets/screenshot-2.png (added)
-
assets/images/plugin-directory-assets/screenshot-3.png (added)
-
assets/images/plugin-directory-assets/screenshot-4.png (added)
-
assets/images/plugin-directory-assets/screenshot-5.png (added)
-
assets/images/plugin-directory-assets/screenshot-6.png (added)
-
assets/images/watermark.png (added)
-
assets/js/basic.upload.js (modified) (1 diff)
-
bptpi.php (modified) (1 diff)
-
classes/ajax.php (modified) (7 diffs)
-
deployment-scripts (added)
-
readme.md (added)
Legend:
- Unmodified
- Added
- Removed
-
bulk-photo-to-product-importer-extension-for-woocommerce/trunk/assets/js/basic.upload.js
r1178647 r1235446 82 82 83 83 uploaded: function (up, file, response) { 84 try{ 85 var res = $.parseJSON(response.response); 84 var res = $.parseJSON(response.response); 85 try{ 86 86 87 //$('#' + file.id).remove(); 87 88 if(res.success) { -
bulk-photo-to-product-importer-extension-for-woocommerce/trunk/bptpi.php
r1178647 r1235446 6 6 Author: The Portland Company, Designed by Spencer Hill, Coded by Redeye Adaya 7 7 Author URI: http://www.theportlandcompany.com 8 Version: 2.3.1 69 Copyright: 201 3The Portland Company8 Version: 2.3.17 9 Copyright: 2015 The Portland Company 10 10 License: GPL v3 11 11 */ -
bulk-photo-to-product-importer-extension-for-woocommerce/trunk/classes/ajax.php
r1178647 r1235446 220 220 221 221 $product_id = array(); 222 222 223 global $woocommerce; 223 224 $found = false; 224 225 $posted = $_POST; 225 226 226 227 //print_r($posted); die("die here"); 227 228 if ( !isset( $posted['ptp_grouped_products'] ) ) { 228 229 … … 234 235 exit; 235 236 } 236 237 //print_r($posted['ptp_grouped_products']); 238 $variation_name = $posted['variation']; 237 239 foreach ( $posted['ptp_grouped_products'] as $grouped_product_id ) { 238 240 239 $version_value = get_option( '_transient_product-transient-version');241 $version_value = get_option('_transient_product-transient-version'); 240 242 241 243 $variations = get_option( '_transient_wc_product_children_ids_' . $grouped_product_id.$version_value ); 242 243 244 if ( sizeof( $variations ) == 0 ) { continue; } 244 245 245 foreach ( $variations as $variation ) { 246 247 $product_id = $variation; 248 // break; 249 250 } 246 foreach($variations as $variationval) { 247 $varvalue = get_post_meta($variationval, '_downloadable', true); 248 249 if($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 251 263 252 264 // 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; 257 270 } 258 271 259 272 // If there are items in cart, check if the product is added already 260 273 foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) { 261 274 262 275 if ( $_product->id == $product_id ) { 276 263 277 $found = true; 264 278 } 265 279 } 280 266 281 267 282 // if product not found, add it … … 441 456 $variations_migrate_obj = PTPImporter_Variation_Migrate::getInstance(); 442 457 $result = $variations_migrate_obj->migrate(); 443 458 //print_r($result); die("Die for variation group migrate"); 444 459 if ( !$result ) { 445 460 echo json_encode( array( … … 475 490 $settings = $settings_obj->get(); 476 491 $bptpi_category_naming_scheme_value = $settings['bptpi_category_naming_scheme']; 492 //die("Die Here for naming scheme"); 477 493 if ( isset($bptpi_category_naming_scheme_value) ) { 478 494 $bptpi_category_naming_scheme = $settings['bptpi_category_naming_scheme']; … … 493 509 494 510 global $ptp_importer; 511 //print_r($_POST['parent']); die("Die in category"); 495 512 if(isset($_POST['parent'])) 496 513 $termx = get_term_by( 'id', $_POST['parent'], "product_cat" ); … … 537 554 // Get mini cart 538 555 ob_start(); 539 woocommerce_mini_cart();556 // print_r( woocommerce_mini_cart() ); die("Atleast die any where"); 540 557 $mini_cart = ob_get_clean(); 558 // print_r($mini_cart); die("Die before Cart"); 541 559 542 560 if ( !$mini_cart ) { … … 545 563 546 564 // 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( 548 573 '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>' 550 575 ) 551 576 ), 552 577 'cart_hash' => md5( json_encode( $woocommerce->cart->get_cart() ) ) 553 578 ); 554 579 //print_r($data); die("Die Before Cart-2"); 555 580 echo json_encode( $data ); 556 581 557 exit;582 exit; 558 583 } 559 584
Note: See TracChangeset
for help on using the changeset viewer.