Changeset 1912165
- Timestamp:
- 07/20/2018 11:45:16 AM (8 years ago)
- Location:
- woo-oscommerce-sync/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
woocommerce-osc-sync.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-oscommerce-sync/trunk/readme.txt
r1912126 r1912165 5 5 Requires at least: 3.5.1 6 6 Tested up to: 4.9.4–es_ES 7 Stable tag: 2.0. 47 Stable tag: 2.0.5 8 8 License: AGPLv3.0 or later 9 9 License URI: http://opensource.org/licenses/AGPL-3.0 … … 70 70 71 71 == Changelog == 72 = 2.0.5 = 73 * Fix reimport categories images 74 72 75 = 2.0.4 = 73 76 * Add field for custom images directory on osCommerce -
woo-oscommerce-sync/trunk/woocommerce-osc-sync.php
r1912130 r1912165 5 5 Description: Import products, categories, customers and orders from osCommerce to Woocommerce 6 6 Author: Alejandro Aranda 7 Version: 2.0. 47 Version: 2.0.5 8 8 Author URI: http://www.aaranda.es 9 9 Original Author: David Barnes … … 111 111 if (!empty($_POST['images_url'])) { 112 112 //otw_log("importCategories", "Image: " . rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image'])); 113 $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST[' store_url'], '/') . '/' . urlencode($category['categories_image']);113 $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST['images_url'], '/') . '/' . urlencode($category['categories_image']); 114 114 } else { //otw_log("importCategories", "Image: " . rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image'])); 115 115 $url = rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image']); 116 116 } 117 117 otw_log("importCategories", "Image: " .$url); 118 118 $attach_id = otw_import_image($url); 119 119 } … … 126 126 $import_cat_counter ++; 127 127 } else { 128 otw_log("importCategories", "Edit Categorie: " . json_encode($category)); 128 otw_log("importCategories", "Edit Categorie: ".$term['term_id'] .".-." . json_encode($category)); 129 130 delete_option('product_cat_children'); // clear the cache 131 132 $attach_id = 0; 133 if ($category['categories_image'] != '') { 134 if (esc_url($_POST['store_url'])) { 135 136 if (!empty($_POST['images_url'])) { 137 //otw_log("importCategories", "Image: " . rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image'])); 138 $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST['images_url'], '/') . '/' . urlencode($category['categories_image']); 139 } else { //otw_log("importCategories", "Image: " . rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image'])); 140 $url = rtrim($_POST['store_url'], '/') . '/image/' . urlencode($category['categories_image']); 141 } 142 otw_log("importCategories", "Image: " .$url); 143 $attach_id = otw_import_image($url); 144 } 145 } 146 delete_woocommerce_term_meta($term['term_id'], 'thumbnail_id'); 147 add_woocommerce_term_meta($term['term_id'], 'thumbnail_id', (int) $attach_id); 129 148 otw_run_cats($category['categories_id'], $term['term_id']); 130 149 } … … 520 539 521 540 if (!empty($_POST['images_url'])) { 522 $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST[' store_url'], '/') . '/' . ($product['image']);541 $url = rtrim($_POST['store_url'], '/') . '/' . rtrim($_POST['images_url'], '/') . '/' . ($product['image']); 523 542 } else { 524 543 $url = rtrim($_POST['store_url'], '/') . '/images/' . ($product['image']); … … 769 788 <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> 770 789 <p>Enter your oscommerce database information (you will need remote access to your oscommerce database)</p> 771 <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"> Images directory: <small>(empty directory " /image") </small><input type="text" name="images_url" value="<?php echo sanitize_text_field($_POST['images_url']); ?>"></label></p>790 <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"> Images directory: <small>(empty directory "image") </small><input type="text" name="images_url" value="<?php echo sanitize_text_field($_POST['images_url']); ?>"></label></p> 772 791 <p><label class="control-label">osCommerce Database Host: <input type="text" name="store_host" value="localhost"></label></p> 773 792 <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>
Note: See TracChangeset
for help on using the changeset viewer.