custom script in site.php

Discussion in 'Customization & add-ons' started by csongor_simsay, Dec 29, 2013.

  1. csongor_simsay

    csongor_simsay aMember Pro Customer

    Joined:
    Dec 10, 2013
    Messages:
    26
    It took away days of my life and I can't get the invoice number, please help me someone!!!!

    <?php
    Am_Di::getInstance()->hook->add(Am_Event::ACCESS_AFTER_INSERT, 'myAccessHandler');

    function myAccessHandler(Am_Event $event) {
    $access = $event->getAccess();
    $user = $event->getUser();
    $invoice = $event->getInvoice();

    if ($access->product_id == 5) {
    $request = new Am_HttpRequest('http://www.flat-plan.com/teszt/test...>product_id.'&product_quantity='.$access->qty, Am_HttpRequest::METHOD_GET);
    $request->send();
    }
    }
    ?>

Share This Page