Jump to content

Orik

Members
  • Content count

    18
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Oleg
  1. Hello! I use EP for add new products in my store. Now i need second manufacturer, i make it - work fine, but what need to add it in EP? How i make (easypopulate.php) 'v_instock', 'v_tax_class_title', 'v_manufacturers_name', 'v_manufacturers_id', //after it i add 'v_manufacturers2_name', 'v_manufacturers2_id', $row['v_froogle_color'] = ''; $row['v_froogle_size'] = ''; $row['v_froogle_quantitylevel'] = ''; $row['v_froogle_manufacturer_id'] = ''; //after $row['v_froogle_manufacturer2_id'] = ''; // if the filelayout says we need a manufacturers name, get it if (isset($filelayout['v_manufacturers_name'])){ if ($row['v_manufacturers_id'] != ''){ $sql2 = "SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = " . $row['v_manufacturers_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } } //after // if the filelayout says we need a manufacturers name, get it if (isset($filelayout['v_manufacturers2_name'])){ if ($row['v_manufacturers2_id'] != ''){ $sql2 = "SELECT manufacturers2_name FROM ".TABLE_MANUFACTURERS2." WHERE manufacturers2_id = " . $row['v_manufacturers2_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers2_name'] = $row2['manufacturers2_name']; } } $header_array['v_manufacturers_name'] = $iii++; //after $header_array['v_manufacturers2_name'] = $iii++; p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, //after p.manufacturers2_id as v_manufacturers2_id, 'v_froogle_instock' => $iii++, 'v_froogle_ shipping' => $iii++, 'v_manufacturers_name' => $iii++, //after 'v_manufacturers2_name' => $iii++, 'v_froogle_manufacturer_id' => $iii++, //after 'v_froogle_manufacturer_id' => $iii++, 'size' => $iii++, 'quantity' => $iii++, 'product_id' => $iii++, 'manufacturer_id' => $iii++, //after 'manufacturer2_id' => $iii++, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, //after p.manufacturers2_id as v_manufacturers2_id, p.products_tax_class_id as v_tax_class_id, p.products_quantity as v_products_quantity, p.manufacturers_id as v_manufacturers_id, //after p.manufacturers2_id as v_manufacturers2_id, // temprow has the old style low to high level categories. $newlevel = 1; // let's turn them into high to low level categories for( $categorylevel=EP_MAX_CAT+1; $categorylevel>0; $categorylevel--){ if ($temprow['v_categories_name_' . $categorylevel] != ''){ $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } if ($row['v_manufacturers_id'] != ''){ $sql2 = "SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = " . $row['v_manufacturers_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } //after // temprow has the old style low to high level categories. // let's turn them into high to low level categories for( $categorylevel=EP_MAX_CAT+1; $categorylevel>0; $categorylevel--){ if ($temprow['v_categories_name_' . $categorylevel] != ''){ $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } if ($row['v_manufacturers2_id'] != ''){ $sql2 = "SELECT manufacturers2_name FROM ".TABLE_MANUFACTURERS2." WHERE manufacturers2_id = " . $row['v_manufacturers2_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers2_name'] = $row2['manufacturers2_name']; } if ($v_manufacturer_id==''){ $v_manufacturer_id="NULL"; } //after if ($v_manufacturer2_id==''){ $v_manufacturer2_id="NULL"; } // OK, we need to convert the manufacturer's name into id's for the database if ( isset($v_manufacturers_name) && $v_manufacturers_name != '' ){ $sql = "SELECT man.manufacturers_id FROM ".TABLE_MANUFACTURERS." as man WHERE man.manufacturers_name = '" . $v_manufacturers_name . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ( $row != '' ){ foreach( $row as $item ){ $v_manufacturer_id = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( manufacturers_id) max FROM ".TABLE_MANUFACTURERS; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_mfg_id = $row['max']+1; // default the id if there are no manufacturers yet if (!is_numeric($max_mfg_id) ){ $max_mfg_id=1; } // Uncomment this query if you have an older 2.2 codebase /* $sql = "INSERT INTO ".TABLE_MANUFACTURERS."(manufacturers_id, manufacturers_name, manufacturers_image) VALUES ('".$max_mfg_id."','".$v_manufacturers_name."','".EP_MANF_IMAGE."')"; */ // Comment this query out if you have an older 2.2 codebase $sql = "INSERT INTO ".TABLE_MANUFACTURERS."(manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified) VALUES ('" . $max_mfg_id . "', '" . $v_manufacturers_name . "','" . EP_MANF_IMAGE . "', " . CURRENT_TIMESTAMP . "," . CURRENT_TIMESTAMP . ")"; $result = tep_db_query($sql); $v_manufacturer_id = $max_mfg_id; } } //after // OK, we need to convert the manufacturer's name into id's for the database if ( isset($v_manufacturers2_name) && $v_manufacturers2_name != '' ){ $sql = "SELECT man.manufacturers2_id FROM ".TABLE_MANUFACTURERS2." as man WHERE man.manufacturers2_name = '" . $v_manufacturers2_name . "'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); if ( $row != '' ){ foreach( $row as $item ){ $v_manufacturer2_id = $item; } } else { // to add, we need to put stuff in categories and categories_description $sql = "SELECT MAX( manufacturers2_id) max FROM ".TABLE_MANUFACTURERS2; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_mfg_id = $row['max']+1; // default the id if there are no manufacturers yet if (!is_numeric($max_mfg_id) ){ $max_mfg_id=1; } // Uncomment this query if you have an older 2.2 codebase /* $sql = "INSERT INTO ".TABLE_MANUFACTURERS."(manufacturers_id, manufacturers_name, manufacturers_image) VALUES ('".$max_mfg_id."','".$v_manufacturers_name."','".EP_MANF_IMAGE."')"; */ // Comment this query out if you have an older 2.2 codebase $sql = "INSERT INTO ".TABLE_MANUFACTURERS2."(manufacturers2_id, manufacturers2_name, manufacturers2_image, date_added, last_modified) VALUES ('" . $max_mfg_id . "', '" . $v_manufacturers2_name . "','" . EP_MANF_IMAGE . "', " . CURRENT_TIMESTAMP . "," . CURRENT_TIMESTAMP . ")"; $result = tep_db_query($sql); $v_manufacturer2_id = $max_mfg_id; } } products_weight, products_quantity, manufacturers_id, //after manufacturers2_id '$v_products_weight', '$v_products_quantity', '$v_manufacturer_id', //after '$v_manufacturer2_id' ', products_last_modified=CURRENT_TIMESTAMP , products_quantity="' . $v_products_quantity . '" ,manufacturers_id=' . $v_manufacturer_id . //after '" ,manufacturers2_id=' . $v_manufacturer2_id . in export xls i see new column - v_manufacturers2_name and i see allright manufacturers2 in his products, but if i change manufacturer2 and make upload and insert this file i have error - File uploaded. Temporary filename: /home/u50422/aquast.ru/tmp/php3qTlTD User filename: EP2007Apr03-140255.xls Size: 40064 | ванна MIAN | editorPics | | ванна MIAN | Описание т | | | | 2320 | 8.00 | | 0000-00-00 | 421 | 1 | Цвет | 14 | | Хром | 15 | | Серебро | 16 | | Золото | 17 | | хром/золот | 2 | | | 55 | Ванны | Прямоуголь | | | | | | --нет-- | Active Updated 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" ,manufacturers2_id=13 , products_status=1 ' at line 4 UPDATE products SET products_price="2320" ,products_image="editorPics/img42ca6b6ced90d.jpg" ,products_subimage1="" ,products_subimage2="" ,products_subimage3="" ,products_subimage4="" ,products_subimage5="" ,products_subimage6="", products_weight="8.00", products_tax_class_id="", products_date_available= NULL, products_date_added= "0000-00-00 00:00:00", products_last_modified=CURRENT_TIMESTAMP , products_quantity="421" ,manufacturers_id=NULL" ,manufacturers2_id=13 , products_status=1 WHERE (products_id = "282") [TEP STOP] PLEASE HELP!
  2. hi! respect to autors for this contribution! I have a little problem. Befor install them i modificated priduct_info.php for new java popup image. Now i need to make new popup for other pictures of more picture. But if i insert <?php echo, in code, page is stop loading! Look this more pictures 6 - <div id="showimage"></div> <script language="javascript"><!-- document.write(\'<a href="' . tep_href_link(DIR_WS_IMAGES . $mopics_images[$mo_item]) . '" target="_blank" onMouseOver="return enlarge(\\\''. DIR_WS_IMAGES . $product_info['products_image'].'\\\',event,\\\'center\\\','.$size[0].','.$size[1].')" onMouseOut="closepreview()">' . tep_image(DIR_WS_IMAGES . $mopics_images[$mo_item], $product_info['products_name'], $mopics_image_width, $mopics_image_height, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>\'); //--></script> old mod pictures - (place after 230 line) <div id="showimage"></div> <script language="javascript"><!-- document.write('<?php echo '<a href="'. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" onMouseOver="return enlarge(\\\''. DIR_WS_IMAGES . $product_info['products_image'].'\\\',event,\\\'center\\\','.$size[0].','.$size[1].')" onMouseOut="closepreview()" ><img src="'. DIR_WS_IMAGES . $product_info['products_image'].'" border="0" height="'. SMALL_IMAGE_HEIGHT .'"><br><br>Для увеличения картинки<br> наведите на неё курсор,<br> или кликните по ней </a>'; ?>'); //--></script> what wrong i do? thx!
×