Plugin Directory

Changeset 1917009


Ignore:
Timestamp:
07/30/2018 05:37:04 PM (8 years ago)
Author:
alexwing
Message:

Include Bootstrap tabs and forms

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

Legend:

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

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

    r1914783 r1917009  
    55  Description: Import products, categories, customers and orders from osCommerce to Woocommerce
    66  Author: Alejandro Aranda
    7   Version: 2.0.6
     7  Version: 2.0.7
    88  Author URI: http://www.aaranda.es
    99  Original Author: David Barnes
     
    115115                                    $url = rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image']);
    116116                                }
    117                                 otw_log("importCategories", "Image: " .$url);
     117                                otw_log("importCategories", "Image: " . $url);
    118118                                $attach_id = otw_import_image($url);
    119119                            }
     
    126126                        $import_cat_counter ++;
    127127                    } else {
    128                         otw_log("importCategories", "Edit Categorie: ".$term['term_id'] .".-." . json_encode($category));
    129                        
     128                        otw_log("importCategories", "Edit Categorie: " . $term['term_id'] . ".-." . json_encode($category));
     129
    130130                        delete_option('product_cat_children'); // clear the cache
    131131
     
    140140                                    $url = rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image']);
    141141                                }
    142                                  otw_log("importCategories", "Image: " .$url);
     142                                otw_log("importCategories", "Image: " . $url);
    143143                                $attach_id = otw_import_image($url);
    144144                            }
     
    175175            if ($oscdb->ready) {
    176176                ob_start();
    177                 // echo '<p>Starting...<em>(If the page stops loading or shows a timeout error, then just refresh the page and the importer will continue where it left off.  If you are using a shared server and are importing a lot of products you may need to refresh several times)</p>';
     177                // echo '<div class="form-group">Starting...<em>(If the page stops loading or shows a timeout error, then just refresh the page and the importer will continue where it left off.  If you are using a shared server and are importing a lot of products you may need to refresh several times)</div>';
    178178                // Do customer import
    179179
     
    290290                    //Import the taxes
    291291                    if ($taxes = $oscdb->get_results($sql, ARRAY_A)) {
    292                         otw_log("importtaxes", "taxes origin total: " . count($taxes));
     292                        otw_log("importtaxes", " taxes origin total: " . count($taxes));
    293293                        foreach ($taxes as $tax) {
    294                              otw_log("importtaxes", json_encode($tax));
    295                              
     294                            otw_log("importtaxes", json_encode($tax));
     295
    296296                            $sql = "
    297                                 ";                             
    298                              $import_tax_counter++;
     297                                ";
     298                            $import_tax_counter++;
    299299                        }
    300300                    }
    301                    
     301
    302302                    otw_log("importtaxes", "End Import");
    303303                }
     
    577577                                        if (!empty($_POST['images_url'])) {
    578578                                            $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST['images_url'], '/') . '/' . ($product['image']);
    579                                         } else {                                                                                 
     579                                        } else {
    580580                                            $url = rtrim($_POST['store_url'], '/') . '/images/' . ($product['image']);
    581581                                        }
     
    762762                        }
    763763                    } else {
    764                         echo '<p class="notice">The information (pages) table does not exist in this osCommerce installation.</p>';
     764                        echo '<p class="notice">The information (pages) table does not exist in this osCommerce installation.</div>';
    765765                    }
    766766                }
     
    769769                $success = true;
    770770            } else {
    771                 echo '<p class="notice">Could not connect to the osCommerce database</p>';
     771                echo '<p class="notice">Could not connect to the osCommerce database</div>';
    772772            }
    773773        }
    774774        ?>
    775         <form method="post" action="">
     775        <form method="post" action="" style="margin: 10px 15px;">
    776776
    777777            <?php
     
    785785                            <?php
    786786                            if ((int) $_POST['dtype']['customers'] == 1) {
    787                                 echo '<p>Customers Imported: ' . $import_customer_counter . '</p>';
     787                                echo '<div class="form-group">Customers Imported: ' . $import_customer_counter . '</div>';
    788788                            }
    789789                            if ((int) $_POST['dtype']['orders'] == 1) {
    790                                 echo '<p>Orders Imported: ' . $order_import_counter . '</p>';
     790                                echo '<div class="form-group">Orders Imported: ' . $order_import_counter . '</div>';
    791791                            }
    792792                            if ((int) $_POST['dtype']['categories'] == 1) {
    793                                 echo '<p>Categories Imported: ' . $import_cat_counter . '</p>';
     793                                echo '<div class="form-group">Categories Imported: ' . $import_cat_counter . '</div>';
    794794                            }
    795795                            if ((int) $_POST['dtype']['taxes'] == 1) {
    796                                 echo '<p>Taxes Imported: ' . $import_tax_counter . '</p>';
     796                                echo '<div class="form-group">Taxes Imported: ' . $import_tax_counter . '</div>';
    797797                            }
    798798                            if ((int) $_POST['dtype']['products'] == 1) {
    799                                 echo '<p>Products Imported: ' . $import_prod_counter . '</p>';
     799                                echo '<div class="form-group">Products Imported: ' . $import_prod_counter . '</div>';
    800800                            }
    801801                            if ((int) $_POST['dtype']['image'] == 1) {
    802                                 echo '<p>Images Imported: ' . $import_img_counter . '</p>';
     802                                echo '<div class="form-group">Images Imported: ' . $import_img_counter . '</div>';
    803803                            }
    804804                            if ((int) $_POST['dtype']['gallery'] == 1) {
    805                                 echo '<p>Images gallery Imported: ' . $import_gallery_counter . '</p>';
     805                                echo '<div class="form-group">Images gallery Imported: ' . $import_gallery_counter . '</div>';
    806806                            }
    807807                            if ((int) $_POST['dtype']['pages'] == 1) {
    808                                 echo '<p>Pages Imported: ' . $page_import_counter . '</p>';
     808                                echo '<div class="form-group">Pages Imported: ' . $page_import_counter . '</div>';
    809809                            }
    810810                            ?>
     
    815815            }
    816816            ?>
    817             <div class="row">
    818                 <div class="col-md-6 form-control" style="background-color: #f1f1f1">
     817            <ul class="nav nav-tabs" id="myTab" role="tablist">
     818                <li class="nav-item">
     819                    <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">OsCommerce Database Conection</a>
     820                </li>
     821                <li class="nav-item">
     822                    <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Products Configuration</a>
     823                </li>
     824                <li class="nav-item">
     825                    <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Select Imports</a>
     826                </li>
     827            </ul>
     828            <div class="tab-content" id="myTabContent">
     829                <div class="tab-pane fade show active modal-body bg-light" id="home" role="tabpanel" aria-labelledby="home-tab">
     830                    <h4>Enter your oscommerce database information </h4>
     831                    <div class="alert alert-warning" role="alert">
     832                        You will need remote access to your oscommerce database
     833                    </div>                   
     834                    <div class="row">
     835                        <div class="col-md-6">
     836                            <div class="form-group">
     837                                <label >osCommerce store URL: </label>
     838                                <input class="form-control" type="text" name="store_url" value="<?php echo sanitize_text_field($_POST['store_url']); ?>">
     839                                <small>Example: https://www.[your site].com/</small>   
     840                                </label>
     841                            </div>
     842                            <div class="form-group"><label >osCommerce Database Host: </label><input class="form-control" type="text" name="store_host" value="localhost"></div>
     843                            <div class="form-group"><label >osCommerce Database Name: </label><input class="form-control" type="text" name="store_dbname" value="<?php echo sanitize_text_field($_POST['store_dbname']); ?>"></div>
     844                        </div>
     845                        <div class="col-md-6">
     846                            <div class="form-group">
     847                                <label >Images directory: </label>
     848                                <input class="form-control" type="text" name="images_url" value="<?php echo sanitize_text_field($_POST['images_url']); ?>">
     849                                <small>Empty directory as default "image"</small>                               
     850                            </div>
     851                            <div class="form-group"><label >osCommerce Database User: </label><input class="form-control" type="text" name="store_user" value="<?php echo sanitize_text_field($_POST['store_user']); ?>"></div>
     852                            <div class="form-group"><label >osCommerce Database Password: </label><input class="form-control" type="text" name="store_pass" value="<?php echo sanitize_text_field($_POST['store_pass']); ?>"></div>                           
     853                        </div>
     854                    </div>
     855                </div>
     856                <div class="tab-pane fade  modal-body bg-light" id="profile" role="tabpanel" aria-labelledby="profile-tab">
    819857                    <h3>Import data from osCommerce</h3>
    820                     <p>For big products database can import in steps</p>       
    821                     <p><label class="control-label">Debug: <input type="checkbox" name="debug" value="1"  <?php
    822                             if ($_POST['debug']) {
     858                    <div class="alert alert-info" role="alert">
     859                       For big products database can import in steps (use fields Offset & Limit)
     860                    </div>                                       
     861                    <div class="col-md-12">
     862                        <div class="form-group"><label >Language: </label><input class="form-control" type="text" name="lang" value="<?php echo sanitize_text_field($_POST['lang']); ?>"><small>Id from osCommerce lang table</small></div>
     863                        <div class="form-group"><label >Offset: </label><input class="form-control" type="text" name="offset" value="<?php echo sanitize_text_field($_POST['offset']); ?>"><small>Last product imported</small></div>
     864                        <div class="form-group"><label >Limit: </label><input class="form-control" type="text" name="limit" value="<?php echo sanitize_text_field($_POST['limit']); ?>"><small>how many products imported</small></div>       
     865                    </div>
     866
     867                </div>
     868                <div class="tab-pane fade  modal-body bg-light" id="contact" role="tabpanel" aria-labelledby="contact-tab">
     869                    <h3>Data to Import:</h3>
     870                    <div class="alert alert-warning" role="alert">
     871                       It is recommended to follow the order of the list
     872                    </div>                     
     873                    <div class="row">
     874                        <div class="col-md-12">
     875                            <label ><input class="form-control" type="checkbox" name="dtype[customers]" value="1" <?php
     876                                if ((int) $_POST['dtype']['customers']) {
     877                                    echo " checked ";
     878                                }
     879                                ?>>Customers (passwords will not be transferred)</label><br>
     880
     881                            <label ><input class="form-control" type="checkbox" name="dtype[categories]" value="1" <?php
     882                                if ((int) $_POST['dtype']['categories']) {
     883                                    echo " checked ";
     884                                }
     885                                ?>>Categories</label><br>
     886                           <!-- <label ><input class="form-control" type="checkbox" name="dtype[taxes]" value="1" <?php
     887                            if ((int) $_POST['dtype']['taxes']) {
    823888                                echo " checked ";
    824889                            }
    825                             ?>></label><small>(Display and save a log file in WordPress root folder)</small></p>
    826                     <p><label class="control-label">Language (Id from osCommerce lang table): <input type="text" name="lang" value="<?php echo sanitize_text_field($_POST['lang']); ?>"></label></p>
    827                     <p><label class="control-label">Offset (Last product imported): <input type="text" name="offset" value="<?php echo sanitize_text_field($_POST['offset']); ?>"></label></p>
    828                     <p><label class="control-label">Limit (how many produts imported): <input type="text" name="limit" value="<?php echo sanitize_text_field($_POST['limit']); ?>"></label></p>
    829                     <p>Enter your oscommerce database information (you will need remote access to your oscommerce database)</p>
    830                     <p><label class="control-label">osCommerce store URL: <input type="text" name="store_url" value="<?php echo sanitize_text_field($_POST['store_url']); ?>"></label><label class="control-label">&nbsp;&nbsp;&nbsp;Images directory: <small>(empty directory "image") </small><input type="text" name="images_url" value="<?php echo sanitize_text_field($_POST['images_url']); ?>"></label></p>
    831                     <p><label class="control-label">osCommerce Database Host: <input type="text" name="store_host" value="localhost"></label></p>
    832                     <p><label class="control-label">osCommerce Database User: <input type="text" name="store_user" value="<?php echo sanitize_text_field($_POST['store_user']); ?>"></label></p>
    833                     <p><label class="control-label">osCommerce Database Password: <input type="text" name="store_pass" value="<?php echo sanitize_text_field($_POST['store_pass']); ?>"></label></p>
    834                     <p><label class="control-label">osCommerce Database Name: <input type="text" name="store_dbname" value="<?php echo sanitize_text_field($_POST['store_dbname']); ?>"></label></p>
     890                            ?>>Taxes</label><br>-->
     891                            <label ><input class="form-control" type="checkbox" name="dtype[products]" value="1"  <?php
     892                                if ((int) $_POST['dtype']['products']) {
     893                                    echo " checked ";
     894                                }
     895                                ?>>Products</label><br>
     896                            <label ><input class="form-control" type="checkbox" name="dtype[delete]" value="1"  <?php
     897                                if ((int) $_POST['dtype']['delete']) {
     898                                    echo " checked ";
     899                                }
     900                                ?>>Products delete images </label><br>
     901                            <label ><input class="form-control" type="checkbox" name="dtype[image]" value="1"  <?php
     902                                if ((int) $_POST['dtype']['image']) {
     903                                    echo " checked ";
     904                                }
     905                                ?>>Products Prefered image</label><br>
     906                            <label ><input class="form-control" type="checkbox" name="dtype[gallery]" value="1"  <?php
     907                                if ((int) $_POST['dtype']['gallery']) {
     908                                    echo " checked ";
     909                                }
     910                                ?>>Products gallery</label><br>
     911                            <label ><input class="form-control" type="checkbox" name="dtype[orders]" value="1" <?php
     912                                if ((int) $_POST['dtype']['orders']) {
     913                                    echo " checked ";
     914                                }
     915                                ?>>Orders</label><br>
     916                            <label ><input class="form-control" type="checkbox" name="dtype[pages]" value="1"  <?php
     917                                if ((int) $_POST['dtype']['pages']) {
     918                                    echo " checked ";
     919                                }
     920                                ?>>Information Pages</label>
     921
     922
     923                        </div>
     924                    </div>                   
     925
    835926                </div>
    836                 <div class="col-md-6 form-control" style="background-color: #f1f1f1">
    837                     <h3>Data to Import:</h3>
    838                     <h5>It is recommended to follow the order of the list</h5>
    839                     <label class="control-label"><input type="checkbox" name="dtype[customers]" value="1" <?php
    840                         if ((int) $_POST['dtype']['customers']) {
    841                             echo " checked ";
    842                         }
    843                         ?>>Customers (passwords will not be transferred)</label><br>
    844 
    845                     <label class="control-label"><input type="checkbox" name="dtype[categories]" value="1" <?php
    846                         if ((int) $_POST['dtype']['categories']) {
    847                             echo " checked ";
    848                         }
    849                         ?>>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>-->
    855                     <label class="control-label"><input type="checkbox" name="dtype[products]" value="1"  <?php
    856                         if ((int) $_POST['dtype']['products']) {
    857                             echo " checked ";
    858                         }
    859                         ?>>Products</label><br>
    860                     <label class="control-label"><input type="checkbox" name="dtype[delete]" value="1"  <?php
    861                         if ((int) $_POST['dtype']['delete']) {
    862                             echo " checked ";
    863                         }
    864                         ?>>Products delete images </label><br>
    865                     <label class="control-label"><input type="checkbox" name="dtype[image]" value="1"  <?php
    866                         if ((int) $_POST['dtype']['image']) {
    867                             echo " checked ";
    868                         }
    869                         ?>>Products Prefered image</label><br>
    870                     <label class="control-label"><input type="checkbox" name="dtype[gallery]" value="1"  <?php
    871                         if ((int) $_POST['dtype']['gallery']) {
    872                             echo " checked ";
    873                         }
    874                         ?>>Products gallery</label><br>
    875                     <label class="control-label"><input type="checkbox" name="dtype[orders]" value="1" <?php
    876                         if ((int) $_POST['dtype']['orders']) {
    877                             echo " checked ";
    878                         }
    879                         ?>>Orders</label><br>
    880                     <label class="control-label"><input type="checkbox" name="dtype[pages]" value="1"  <?php
    881                         if ((int) $_POST['dtype']['pages']) {
    882                             echo " checked ";
    883                         }
    884                         ?>>Information Pages</label>
    885 
    886                     <p><input type="submit" value="Import Data" class="button button-primary button-large"></p>
    887                 </div>
    888             </div>
     927            </div> 
     928            <div class="form-group"><label >Debug: <input class="form-control" type="checkbox" name="debug" value="1"  <?php
     929                    if ($_POST['debug']) {
     930                        echo " checked ";
     931                    }
     932                    ?>></label>
     933                <small>(Display and save a log file in WordPress root folder)</small>
     934                <div class="form-group"><input type="submit" value="Import Data"  class="btn btn-primary btn-lg"></div>               
     935            </div>           
     936
    889937        </form>
    890938        <?php
Note: See TracChangeset for help on using the changeset viewer.