Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  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

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

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

    Hi again

    Sry I am not sure I understand what you mean :)

    This line:
    &orderamount=' . $orders_total . '&orderid=' . $orders_id

    The variabel $orders_total should have the value of the order and the variabel $orders_id should have the id of the order.

    Can you tell me why they dont have that :)

    Sry it takes time to understand..... hope you still got time to help me.

    Thanks a lot

    Kind Regards
    Kim :)

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

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

    Are you still there :)

    Sorry if I am a newbee :)

    But why dosent it have the total and the id in the variables?
    ... and how can I put the total and id in the variables?

    Kindly regards
    Kim :)

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

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

    Seems like it i because I have 1.3.6 instead of 1.3.8

    Can you help me how to do in 1.3.6?

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

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

    MODERATOR NOTE: In the future, please don't start duplicate discussions of the same topic in different places, as it usually ends up leaving unfinished discussions and even conflicting answers from time to time.

    ref: http://www.zen-cart.com/forum/showthread.php?t=131900
    .

    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.

 

 
Page 1 of 2 12 LastLast

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