Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2005
    Location
    Helsinki
    Posts
    570
    Plugin Contributions
    0

    Default transform oscommerce plugin for zen

    Ok I'm in a desperate need of a certain payment module and to be honest I'm completely lost with the code.. I do have similar payment mod already installed but still can't make sense how to make it work (all those MACs, authentications etc..)

    So I stumpled upon to a module for oscommerce.. and I thought what would be the process to transform oscommerce module to zen?

    Many thanks as always.

  2. #2
    Join Date
    Mar 2005
    Location
    Helsinki
    Posts
    570
    Plugin Contributions
    0

    Default Re: transform oscommerce plugin for zen

    some progress on this one. So I found a similar thread: http://www.zen-cart.com/forum/showthread.php?t=22494

    but there is one tricky part of the code I'm not able to handle or make complete sense out of it (see below) and includes at least this function tep_db_num_rows which is not compatible with zen...

    so here comes the tricky part (from the oscommerce file):

    ////

    function order_number() {
    // Luottokunta vaatii tilausnumeron joka ei ole heidän järjestelmässään. Tietenkään oscommercen omaa tilausnumeroa ei voi
    // laittaa koska tilausnumero määritellään vasta silloin kun tilaus on tehty. En halunnut luoda uutta taulua pelkästään luottokunnan takia
    // joten päädyin omaan tilausnumerokärjestelmään joka käyttää olemassa olevia tietoja kuten asiakasnumeroa ja kuinka monta tilausta asiakas
    // on tehnyt luottokunnan kautta. Luottokunnan tilausnumero ei saa alkaa nollalla ja saa olla max. 9 numeroa pitkä.

    // Esimerkki:
    // 1 00001 001
    // |___|____|##########_ Yhdistetty tilausnumero kyseiselle asiakkaalle. Rajoituksena on 8999 tilausta / asiakas luottokuntaa käyttäen
    // |
    // |- Asiakas ID: asiakkaita voi olla max. 99999. Hitto, jos teillä on noin monta asiakasta, mitä te vielä tätä p*skaa OSC:tä käytätte! ;)

    // Jos jollakulla on parempi idea, ilmoittakaa minulle :)
    // Tämä ratkaisu ei kuitenkaan vaadi tietokantamuutoksia ollenkaan joten sen puolesta ihan toimiva systeemi.


    $cid = str_pad($_SESSION['customer_id'], 5, "0", STR_PAD_LEFT);
    $query = tep_db_query("SELECT date_purchased FROM ".TABLE_ORDERS." WHERE customers_id='".$_SESSION['customer_id']."' AND payment_method LIKE '%".$this->title."%'");
    $numrows = strval(tep_db_num_rows($query)+1);
    if ($numrows>999) {
    $firstnum=1+$numrows{0};
    $numrows=intval(substr($numrows,1));
    } else {
    $firstnum=1;
    }


    $numrows = str_pad($numrows, 3, "0", STR_PAD_LEFT);
    $order_number = $firstnum.$cid.$numrows;
    return($order_number);
    }



    ////

    Explanation of the finnish part goes something like this:

    ////

    The credit processor needs a confirmation number which isn't registered in to their system. Ofcourse we can't use oscommerce order number because the number is defined after the order is made. I didnt want to create own table just for the credit processor so I decided to make own order number system which uses customer number and how many orders he has made through the system. Order number cannot begin with zero and can be 9 numbers long.
    fex:
    // Esimerkki:
    1 00001 001
    |___|____|##########_ Combined order number for customer in hand. Limit is 8999 orders by customer using this service
    |
    |- Customer ID: there can be max 99999 customers. If you have that many customers why do you still use *!#€** OSC for (!!!:))

    This solution doesn't need any database changes so it works

    ////


    Some zen guru please help. This mod would definitely come in need for the zen folks in Finland since it is one of the only and trusted payment option which we could use with the local bank. And I'm really dying for the module.

    Thank you all.

  3. #3
    Join Date
    Mar 2005
    Location
    Helsinki
    Posts
    570
    Plugin Contributions
    0

    Default Re: transform oscommerce plugin for zen

    and changing the tep_db_num_rows($query)+1); in to zen_db_num_rows($query)+1); didnt do the trick...

  4. #4
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: transform oscommerce plugin for zen

    Quote Originally Posted by poosk View Post
    there is one tricky part of the code I'm not able to handle or make complete sense out of it (see below) and includes at least this function tep_db_num_rows which is not compatible with zen...
    You can find some tips here (also about replacing tep_num_rows):
    http://www.zen-cart.com/forum/showthread.php?t=25287

  5. #5
    Join Date
    Mar 2005
    Location
    Helsinki
    Posts
    570
    Plugin Contributions
    0

    Default Re: transform oscommerce plugin for zen

    thanks Paul, That helps a lot.

    still I'm having problem with these lines...


    zen_draw_hidden_field('Order_Description','Tuotteet<br>--------<br>'.$tuotteet.'<br>Saaja:<br>------<br>'.zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>')) . "\n" .
    zen_draw_hidden_field('Success_Url',MODULE_PAYMENT_LUOTTOKUNTA_SUCCESS_URL .'?osCsid='.$_GET['osCsid']) . "\n" .
    zen_draw_hidden_field('Failure_Url',MODULE_PAYMENT_LUOTTOKUNTA_FAILURE_URL .'?osCsid='.$_GET['osCsid']) . "\n" .
    zen_draw_hidden_field('Cancel_Url',MODULE_PAYMENT_LUOTTOKUNTA_CANCEL_URL .'?osCsid='.$_GET['osCsid']) . "\n" .
    zen_draw_hidden_field('Transaction_Type','1') . "\n" .
    zen_draw_hidden_field('Authentication_Mac',$mac) . "\n";
    return $process_button_string;


    What should I do to the osCsid's?

  6. #6
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: transform oscommerce plugin for zen

    thats a simple replace

    zenid
    Zen cart PCI compliant Hosting

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: transform oscommerce plugin for zen

    Conversion tips for future reference:
    http://www.zen-cart.com/wiki/index.p...dules_from_osC
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Mar 2005
    Location
    Helsinki
    Posts
    570
    Plugin Contributions
    0

    Default Re: transform oscommerce plugin for zen

    hey merlin still need a bit help

    zen_draw_hidden_field('Success_Url',MODULE_PAYMENT_LUOTTOKUNTA_SUCCESS_URL .'?zenid='.$_GET['zenid']) . "\n" .
    zen_draw_hidden_field('Failure_Url',MODULE_PAYMENT_LUOTTOKUNTA_FAILURE_URL .'?zenid='.$_GET['zenid']) . "\n" .
    zen_draw_hidden_field('Cancel_Url',MODULE_PAYMENT_LUOTTOKUNTA_CANCEL_URL .'?zenid='.$_GET['zenid']) . "\n" .

    now it returns cancel and failure to (and probably the success as well)

    shop/index.php?main_page=checkout_payment?zenid=
    (which doesnt exist ofcourse...)

    when it should be

    shop/index.php?main_page=checkout_payment

    What should I remove and how since I'm not sure is it safe to remove whole zenid


    many many thanks!

 

 

Similar Threads

  1. v153 SEO plugin for zen v1.5.3?
    By sports guy in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Dec 2014, 02:25 AM
  2. Easy Populate for Zen Cart vs for Oscommerce
    By simondlh in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 27 May 2011, 10:07 AM
  3. Zen used as plugin for CMS?
    By jastanle84 in forum General Questions
    Replies: 3
    Last Post: 25 Mar 2007, 12:51 AM
  4. This oscommerce stock contrib also available for zen cart
    By pvdheijden in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Dec 2006, 10:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg