Plugin Directory

Changeset 1914783


Ignore:
Timestamp:
07/25/2018 12:42:41 PM (8 years ago)
Author:
alexwing
Message:

Include products weight

Location:
woo-oscommerce-sync/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woo-oscommerce-sync/trunk/readme.txt

    r1912165 r1914783  
    55Requires at least: 3.5.1
    66Tested up to: 4.9.4–es_ES
    7 Stable tag: 2.0.5
     7Stable tag: 2.0.6
    88License: AGPLv3.0 or later
    99License URI: http://opensource.org/licenses/AGPL-3.0
     
    7070
    7171== Changelog ==
     72= 2.0.6 =
     73* Include products weight
     74
    7275= 2.0.5 =
    7376* Fix reimport categories images
  • woo-oscommerce-sync/trunk/woocommerce-osc-sync.php

    r1912165 r1914783  
    55  Description: Import products, categories, customers and orders from osCommerce to Woocommerce
    66  Author: Alejandro Aranda
    7   Version: 2.0.5
     7  Version: 2.0.6
    88  Author URI: http://www.aaranda.es
    99  Original Author: David Barnes
     
    262262                if ((int) $_POST['dtype']['categories'] == 1) {
    263263                    otw_log_delete("importCategories");
     264                    $import_cat_counter = 0;
    264265                    otw_log("importCategories", "Start Import");
    265266                    otw_run_cats();
    266267                    otw_log("importCategories", "End Import");
     268                }
     269                if ((int) $_POST['dtype']['taxes'] == 1) {
     270                    otw_log_delete("importtaxes");
     271                    $import_tax_counter = 0;
     272                    otw_log("importtaxes", "Start Import");
     273                    $sql = "SELECT
     274                        tr.tax_rates_id,
     275                        tr.tax_rate,                                               
     276                        tc.tax_class_title,
     277                        tc.tax_class_description,
     278                        tr.tax_priority,
     279                        tr.tax_rate,
     280                        tr.tax_description,
     281                        z.*,
     282                        c.*
     283                       
     284                      FROM
     285                        tax_rates as tr
     286                        INNER JOIN tax_class as tc ON tr.tax_class_id = tc.tax_class_id
     287                        INNER JOIN zones as z ON z.zone_id = tr.tax_zone_id
     288                        INNER JOIN countries as c ON c.countries_id = z.zone_country_id
     289                    ";
     290                    //Import the taxes
     291                    if ($taxes = $oscdb->get_results($sql, ARRAY_A)) {
     292                        otw_log("importtaxes", "taxes origin total: " . count($taxes));
     293                        foreach ($taxes as $tax) {
     294                             otw_log("importtaxes", json_encode($tax));
     295                             
     296                            $sql = "
     297                                ";                             
     298                             $import_tax_counter++;
     299                        }
     300                    }
     301                   
     302                    otw_log("importtaxes", "End Import");
    267303                }
    268304                if ((int) $_POST['dtype']['products'] == 1) {
     
    339375                                update_post_meta($product_id, '_manage_stock', '1');
    340376                                update_post_meta($product_id, '_stock', $product['products_quantity']);
     377                                update_post_meta($product_id, '_weight', $product['products_weight']);
    341378                                $import_prod_counter++;
    342379
     
    756793                                echo '<p>Categories Imported: ' . $import_cat_counter . '</p>';
    757794                            }
     795                            if ((int) $_POST['dtype']['taxes'] == 1) {
     796                                echo '<p>Taxes Imported: ' . $import_tax_counter . '</p>';
     797                            }
    758798                            if ((int) $_POST['dtype']['products'] == 1) {
    759799                                echo '<p>Products Imported: ' . $import_prod_counter . '</p>';
     
    808848                        }
    809849                        ?>>Categories</label><br>
     850                   <!-- <label class="control-label"><input type="checkbox" name="dtype[taxes]" value="1" <?php
     851                        if ((int) $_POST['dtype']['taxes']) {
     852                            echo " checked ";
     853                        }
     854                        ?>>Taxes</label><br>-->
    810855                    <label class="control-label"><input type="checkbox" name="dtype[products]" value="1"  <?php
    811856                        if ((int) $_POST['dtype']['products']) {
Note: See TracChangeset for help on using the changeset viewer.