Jump to content


  • Content count

  • Joined

  • Last visited

Profile Information

  • Real Name
    Ole Anton Løvik
  • Gender
  • Location
  • Website
  1. It would be nice if you coluld post information about how you solved the problem.
  2. oleanl

    Proteria EDI Frakt and FTP setup

    Solved. I worked my way around the problem, the script now makes a file on the server, send the file content to a new file on the FTPserver and then deletes the generated file on the server. Propably not the best way to solve the problem, but as long as it works I am happy... New file:
  3. oleanl

    [Contribution] Multi Pickup

    Did you get the pulldown menu you were asking about? How did you do that? There is a description of how you get delivery adress in the email on the previous page.
  4. I have installed the Proteria EDI Frakt contribution. The contribution exports order data into Proteria, Proteria will then print shipping labels. When using the download mode everything works at it should, the downloaded file works with Proteria. The contribution altso have a feature that will write the order data into a file that is uploaded via FTP to the computer that runs Proteria. I have set up the contribution and the ftpserver. The FTP-transfer and everything seems to be working fine, but the file i get on my FTP-server contains the wrong data. It seems to contain the filenames from my adminfolder: µ_ . «_ .. ¶_ assign_families.php ·_ attributeManager Ô_ backup.php Õ_ backups Ú_ banner_manager.php Û_ bann.... and so on. Can anyone help me find the bug? The script is obviously working as it can make the correct file for download...But it just enters the wrong data in the file when using FTP. Code: <? /* $Id: Porteria import/export,v 0.1b 2006/03/28 17:43:49$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com (c) Martin Gråtrud martin@wifidal.tk Disse linjene skal ikke fjernes, om du ikke snur helt opp ned på hele greia!! Føl deg fri til å endre på hva du vil, og kom gjerne med forslag til forbedringer! Intil noen forklarer TEP kommandoene for meg, så går det i basic php!! Released under the GNU General Public License */ require('includes/application_top.php'); if ($id == NULL){ echo "Du må velge en ordre først!"; } else { //Modus $modesql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_MODE'") or die (mysql_error()); $mode1 = mysql_fetch_array($modesql); $mode = $mode1['configuration_value']; //Av og på bryter $switchsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_SWITCH'") or die (mysql_error()); $switch1 = mysql_fetch_array($switchsql); $enable = $switch1['configuration_value']; //echo $enable; //ftp server $serversql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_FTP_SERVER'") or die (mysql_error()); $server1 = mysql_fetch_array($serversql); $ftp_server = $server1['configuration_value']; //ftp bruker $usersql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_FTP_USER'") or die (mysql_error()); $user1 = mysql_fetch_array($usersql); $ftp_user_name = $user1['configuration_value']; //ftp passord $passsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_FTP_PASSWORD'") or die (mysql_error()); $pass1 = mysql_fetch_array($passsql); $ftp_user_pass = $pass1['configuration_value']; //ftp mappe $foldersql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_FTP_FOLDER'") or die (mysql_error()); $folder1 = mysql_fetch_array($foldersql); $destination_dir = $folder1['configuration_value']; //Pakke form: //sp $spsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_SP'") or die (mysql_error()); $sp1 = mysql_fetch_array($spsql); $sp = $sp1['configuration_value']; //bp $bpsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_BP'") or die (mysql_error()); $bp1 = mysql_fetch_array($bpsql); $bp = $bp1['configuration_value']; //bpp $bppsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_BPP'") or die (mysql_error()); $bpp1 = mysql_fetch_array($bppsql); $bpp = $bpp1['configuration_value']; //på døren $pdsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_PD'") or die (mysql_error()); $pd1 = mysql_fetch_array($pdsql); $pd = $pd1['configuration_value']; //COD Tekst $codsql = mysql_query("SELECT * FROM configuration WHERE configuration_key='PROTERIA_CODDD'") or die (mysql_error()); $cod1 = mysql_fetch_array($codsql); $coddd = $cod1['configuration_value']; //hente ut ordre nr $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); //$id = $oID; //Skille tegn, proteria vil ha tabulator delt. $fieldseparator = ' '; //velger alle linjene som har "order_id=$id" i tabellen "orders" som den har fått fra urlen ?=20 for ordre nr 20 $query1 = mysql_query("SELECT * FROM orders WHERE orders_id=$id") or die (mysql_error()); $tabel1 = mysql_fetch_array($query1); //henter ut leveringsadresse fra 'orders' $cid = $tabel1['customers_id']; $ordernr = $tabel1['orders_id']; $delivery_name = $tabel1['delivery_name']; $company = $tabel1['delivery_company']; $address = $tabel1['delivery_street_address']; $city = $tabel1['delivery_city']; $zipcode = $tabel1['delivery_postcode']; $order_date = $tabel1['date_purchased']; $codd = $tabel1['payment_method']; $date = strftime("%D",strtotime($order_date)); $dname='ERROR'; if ($company == NULL){ $dname = $delivery_name; } else { $dname = $company; $att = $delivery_name; } //henter ut mere info om kunde fra "customers" og bruker $cid som kundenr i spørringen $query15 = mysql_query("SELECT * FROM customers WHERE customers_id=$cid") or die (mysql_error()); $table15 = mysql_fetch_array($query15); $phone = $table15['customers_telephone']; $faxx = $table15['customers_fax']; //Skal det sendes sms?? $query41 = mysql_query("SELECT * FROM smsoid WHERE oid='$id'") or die (mysql_error()); $table41 = mysql_fetch_array($query41); $sms = $table41['sms']; $smsnr = $table41['smsnr']; $email = $table41['email']; //hente ut total summen $query4 = mysql_query("SELECT * FROM orders_total WHERE class='ot_total' and orders_id=$id") or die (mysql_error()); $table4 = mysql_fetch_array($query4); $totalink = $table4['value']; //fraktform $query5 = mysql_query("SELECT * FROM orders_total WHERE class='ot_shipping' and orders_id=$id") or die (mysql_error()); $table5 = mysql_fetch_array($query5); $fraktform = $table5['title']; $frakt = "0"; //$coddd = "Cash on Delivery"; // Finne ut fraktform //servicepakke if ($fraktform == $sp){ // sjekke om det er cod if ($codd == $coddd){ $frakt = "2"; } else { $frakt = "1"; } } //bedriftspakke if ($fraktform == $bp){ // sjekke om det er cod if ($codd == $coddd){ $frakt = "4"; } else { $frakt = "3"; } } //bedriftspakke postkontor if ($fraktform == $bpp){ // sjekke om det er cod if ($codd == $coddd){ $frakt = "6"; } else { $frakt = "5"; } } // på døren if ($fraktform == $pd){ // sjekke om det er cod if ($codd == $coddd){ $frakt = "8"; } else { $frakt = "7"; } } $output= //1 ordre nr $ordernr.$fieldseparator. //2 total pris ink frakt $totalink.$fieldseparator. //3 frakt type: $frakt.$fieldseparator. //4 kunde nr $cid.$fieldseparator. //5 Mottaker navn (Hvis bedrift kommer den opp her! Navnet blir da ref.) $dname.$fieldseparator. //6 att $att.$fieldseparator. //7 Leverings adresse $address.$fieldseparator. //8 Leverings post nr $zipcode.$fieldseparator. //9 Leverings post sted $city.$fieldseparator. //10 Post adresse $address.$fieldseparator. //11 Post adresse post nr $zipcode.$fieldseparator. //12 Post adresse Post Sted $city.$fieldseparator. //13 epost $email.$fieldseparator. //14 telefonnr $phone.$fieldseparator. //15 fax $faxx.$fieldseparator. //16 send sms $sms.$fieldseparator. //17 send sms til nr $smsnr."\n"; //velger hvordan fila skal dumpes ut //picupfolder // ftp upload if ($mode == 2){ //echo $filnavn; $destination_file = $destination_dir.$id.".ptf"; // Open FTP connection $conn_id = ftp_connect($ftp_server); if ($conn_id == NULL){ echo "Noe er feil med enten ftp instillingene, eller ftp serveren!"; } // Login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); //ftp_pasv($conn_id, true); // Check the connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } // Upload the file $upload = ftp_put($conn_id, $destination_file, $filnavn, FTP_BINARY); // Check upload status if (!$upload) { echo "FTP upload has failed!"; } // Close the FTP connection ftp_close($conn_id); echo "Ordre nr: " . $id . "Til " . $dname . " ble overført"; } //download modus if ($mode == 1) { $filnavn = $id . ".ptf"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"$filnavn\""); echo $output; } } ?>
  5. oleanl

    Ship In Cart

    Yes there are several ways to make this work for customers not logged in... Find this code near line 30: if (($cart->count_contents() > 0) && (tep_session_is_registered('customer_id'))) { To show the estimated shipping cost to users NOT LOGGED IN ONLY, replace with: if (($cart->count_contents() > 0) && (!tep_session_is_registered('customer_id'))) { To show the estimated shipping cost to BOTH LOGGED IN AND NOT LOGGED IN customers, replace with: if ($cart->count_contents() > 0) {