Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    125
    Plugin Contributions
    0

    Default Few lines code translation from osc to zencart - please help

    Hi

    Can you help me "translate" this instruction from osc to zencart.
    This is some lines I can add in OSC to use a danish site service at my shop - and I would like to use that in Zencart instead
    Seems to be almost the same, so one of you genies can maybe fast edit that :)

    Instruction for OSC:
    ----------------------------------------------------
    In the file checkout_process.php you will have to add some code after this line
    // load the after_process function from the payment modules

    Code to add:
    $orders_total=$cart->show_total()- $total_tax;
    tep_session_register('orders_total');
    $orders_id=$insert_id;
    tep_session_register('orders_id');

    --------------------------

    In the file checkout_success.php you will have to add some code after this line
    <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>

    Code to add:
    <?php
    echo '<img height=1 width=1 border=0 src="http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $orders_total . '&orderid=' . $orders_id . '" />';
    tep_session_unregister('orders_total');
    tep_session_unregister('orders_id');
    ?>

    ----------------------------------------------------



    Hope someone can help me "translate" the code from OSC to Zencart. I have tried using it as it is, but that dosent work (found files, and find out where to put it, but the code was the problem)

    I use Zencart 1.3.6, but I think it will be the same in 1.3.8 - so I really hope you will help me anyway

    Thanks a lot if you will help me :)
    That would be a great help

    Kind regards
    Kim

  2. #2
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: Few lines code translation from osc to zencart - please help

    Hi
    Code:
    $orders_total=$cart->show_total()- $total_tax; 
    tep_session_register('orders_total'); 
    $orders_id=$insert_id;
    tep_session_register('orders_id');
    ===>
    Code:
    $_SESSION['orders_total'] = $cart->show_total()- $total_tax; 
    $_SESSION['orders_id'] = $insert_id;
    Code:
    <?php
    echo '<img height=1 width=1 border=0 src="http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $orders_total . '&orderid=' . $orders_id . '" />';
    tep_session_unregister('orders_total'); 
    tep_session_unregister('orders_id'); 
    ?>
    ===>
    Code:
    <?php
    echo '<img height=1 width=1 border=0 src="http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $_SESSION['orders_total'] . '&orderid=' . $_SESSION['orders_id'] . '" />';
    unset($_SESSION['orders_total']); 
    unset($_SESSION['orders_id']); 
    ?>

  3. #3
    Join Date
    Jan 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: Few lines code translation from osc to zencart - please help

    Hi

    Thanks a lot for using your time helping me :)

    I have tried the code but got an error on this sentense:
    $_SESSION['orders_total'] = $cart->show_total()- $total_tax;

    Fatal error: Call to a member function on a non-object in /var/www/vhosts/hudplejeshoppen.dk/httpdocs/includes/modules/pages/checkout_process/header_php.php on line 20

    Do you know why that can be?

  4. #4
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: Few lines code translation from osc to zencart - please help

    Sorry, my error
    Code:
    $orders_total=$cart->show_total()- $total_tax; 
    tep_session_register('orders_total'); 
    $orders_id=$insert_id;
    tep_session_register('orders_id');
    Replace by
    Code:
    $_SESSION['order_summary']['total_tax'] = $order->total_tax;
    Don't change header.php, use magic Notify system, event 'NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES'.

    Code:
    <?php
    echo '<img height=1 width=1 border=0 src="http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $orders_total . '&orderid=' . $orders_id . '" />';
    tep_session_unregister('orders_total'); 
    tep_session_unregister('orders_id'); 
    ?>
    Replace by
    Code:
    <?php
    $total_without_tax = $_SESSION['order_summary']['order_total'] - $_SESSION['order_summary']['total_tax'];
    echo '<img height=1 width=1 border=0 src="http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $total_without_tax . '&orderid=' . $_SESSION['order_summary']['order_number'] . '" />';
    ?>

  5. #5
    Join Date
    Jan 2006
    Posts
    125
    Plugin Contributions
    0

    Default Re: Few lines code translation from osc to zencart - please help

    Once more thank you :)

    Now it almost work. No errors and the link is recieved.

    But still one more problem:
    Code:
    http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $orders_total . '&orderid=' . $orders_id . '" />';
    tep_session_unregister('orders_total')
    In this line orderamount is equal to 0, and orderid is empty

    I really hope you will help me this too. Thanks a lot for alle the help you providing me. Im very thankfull :)

    Kind regards
    Kim

  6. #6
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: Few lines code translation from osc to zencart - please help

    Quote Originally Posted by Backstage View Post
    Code:
    http://www.engodsag.dk/affiliate/salestracking.php?shopnetworkid=XXXXX&orderamount=' . $orders_total . '&orderid=' . $orders_id . '" />';
    tep_session_unregister('orders_total')
    In this line orderamount is equal to 0, and orderid is empty
    Sure. See previous post

 

 

Similar Threads

  1. From OSC to ZenCart
    By bibletag in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 Feb 2012, 04:15 PM
  2. Help converting OSC SQL code to Zencart
    By ozetrade in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 4 Feb 2008, 09:27 PM
  3. OSC mod porting - more help please - another code problem
    By strelitzia in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 31 Oct 2007, 07:34 PM
  4. Code on OSC port not working...Help please
    By strelitzia in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 30 Oct 2007, 01:05 AM
  5. migrating from Osc to zencart
    By gschep in forum Managing Customers and Orders
    Replies: 2
    Last Post: 13 Mar 2007, 05:04 PM

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