Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    116
    Plugin Contributions
    0

    Default will this code converted from osc work?

    Hi,

    Can someone please advise me if the below coding from oscommerce to show on orders in admin and order slip sent to the customer will work in zencart? If not, how can i recode this to work in zencart?


    if($HTTP_GET_VARS['oID'] > 78)
    {
    $hold = ltrim($order->totals[0][text], "Kr.");
    $hold = str_replace(",", "", $hold);

    echo "The following Norweigan local Tax Rate of 25% on products total of " . $order->totals[0]['text'] . " is: " . $currencies->format($hold * .25, false, $order->info['currency'], $order->info['currency_value']) . " and is included .\nInternational customers are responsible for their local taxes and fees." ;
    ?>
    <br/><br/><?php

    echo "Lokale Moms 25% på produkt total " . $order->totals[0]['text'] . " er: " . $currencies->format($hold * .25, true, $order->info['currency'], $order->info['currency_value']) . " og er inkludert. Internasjonale kunder er selv ansvarlig for deres lokale Moms kostnader. \n\n" ;

    }

    else
    {

    $hold = ltrim($order->totals[0][text], "Kr.");
    $hold = str_replace(".", "", $hold);
    $subT = $currencies->format($hold, false, $order->info['currency'], $order->info['currency_value']);

    echo "The following Norweigan local Tax Rate of 25% on products total of " . $subT . " is: " . $currencies->format($hold * .25, true, $order->info['currency'], $order->info['currency_value']) . " and is included .\nInternational customers are responsible for their local taxes and fees." ;
    ?>
    <br/><br/><?php

    echo "Lokale Moms 25% på produkt total " . $subT . " er: " . $currencies->format($hold * .25, true, $order->info['currency'], $order->info['currency_value']) . " og er inkludert. Internasjonale kunder er selv ansvarlig for deres lokale Moms kostnader. \n\n" ;

    }

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: will this code converted from osc work?

    That code would likely fail for numerous reasons. It uses a construction ($HTTP_GET_VARS) which is not valid in recent version of PHP; it has code specific to the orders on the site from which it was taken; it has a syntax error (missing apostrophes on an array index); and it relies on variable ($hold and $subT) that don't exist in Zen Cart. That's aside from some sloppy coding that have tax rates hard-coded, rather than looked up from tax tables. There are probably other issues too which can't be seen from this code in isolation.

    How to make it work? Well that's not a question that can be answered for a snippet of code taken out of context. I recommend reposting, but stating what it is that you are trying to achieve and where.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2010
    Posts
    116
    Plugin Contributions
    0

    Default Re: will this code converted from osc work?

    Thank you for your advise...What i need to do is to have additional information on invoice and order confirmation email as of the below!

    EXAMPLE
    The following local Tax Rate of 25% on products total of Kr.1,098.00 is: Kr.274.50 and is included . International customers are responsible for their local taxes and fees.

    The above tax rate should calculate automatically on all customers order total?

    This is due to a local law even though products are included tax the tax rate must be on the invoice.

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

    Default Re: will this code converted from osc work?

    You've already got that topic started here: http://www.zen-cart.com/forum/showthread.php?t=146559

    Your 3 other duplicate threads on the same topic have been merged into that one as well. Please do not start the same discussion in multiple places.
    .

    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.

 

 

Similar Threads

  1. v151 will this work?? can this mod be updated
    By kitcorsa in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 2 Nov 2014, 01:02 PM
  2. how to change this two osc code into zc code?
    By sunrise99 in forum General Questions
    Replies: 3
    Last Post: 21 Nov 2011, 05:30 AM
  3. Help with a osc converted shipping module
    By FrilansReklam in forum Addon Shipping Modules
    Replies: 2
    Last Post: 3 Sep 2010, 02:32 AM
  4. Coupon Code will not work?
    By mooncavecrystals in forum General Questions
    Replies: 3
    Last Post: 6 Oct 2007, 08:48 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