3v4l.org

run code in 300+ PHP versions simultaneously
<?php $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId()); $items = $order->getAllVisibleItems(); //do not use getAllItems...you get bad results if you have configurable products $orderId = $order->getIncrementId(); $currency = $order->getCurrencyCode(); $subtotal = $order->getSubtotal(); $quote = $order->getQuote(); $customerFlag = ($quote->getCheckoutMethod() == Mage_Sales_Model_Quote::CHECKOUT_METHOD_LOGIN_IN) ? 'old' : 'new'; $itemsCount = count($items); $productIds = array(); $productNames = array(); $productPrices = array(); $productQtys = array(); foreach ($items as $item) { $productIds[] = $item->getSku(); //I would advice in using $item->getSku(); $productNames[] = $item->getName(); $productPrices[] = number_format($item->getPrice(), 2); $productQtys[] = $item->getOrderedQty(); } ?> <!-- Become Sales Tracking Script V 1.0.0 - All rights reserved --> <script language="JavaScript"> var pg_pangora_merchant_id='69761'; var pg_order_id='<?php echo $orderId?>'; var pg_cart_size='<?php echo $itemsCount?>'; var pg_cart_value='<?php echo $subtotal?>'; var pg_currency='<?php echo $currency; ?>'; var pg_customer_flag='<?php echo $customerFlag; ?>'; var pg_product_id='<?php echo implode(',', $productIds); ?>'; var pg_product_name='<?php echo Mage::helper('core')->jsQuoteEscape(implode(',', $productNames)); ?>'; var pg_product_price='<?php echo implode(',', $productPrices); ?>'; var pg_product_units='<?php echo implode(',', $productQtys); ?>'; </script> <script language="JavaScript" src="https://clicks.pangora.com/sales-tracking/salesTracker.js"></script> <noscript><img src="https://clicks.pangora.com/sales-tracking/69761/salesPixel.do"/></noscript>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 65
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 65
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
Branch analysis from position: 34
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 65
Branch analysis from position: 43
Branch analysis from position: 65
filename:       /in/1fQrc
function name:  (null)
number of ops:  108
compiled vars:  !0 = $order, !1 = $items, !2 = $orderId, !3 = $currency, !4 = $subtotal, !5 = $quote, !6 = $customerFlag, !7 = $itemsCount, !8 = $productIds, !9 = $productNames, !10 = $productPrices, !11 = $productQtys, !12 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_STATIC_METHOD_CALL                                  'Mage', 'getModel'
          1        SEND_VAL_EX                                              'sales%2Forder'
          2        DO_FCALL                                      0  $13     
          3        INIT_METHOD_CALL                                         $13, 'load'
          4        INIT_STATIC_METHOD_CALL                                  'Mage', 'getSingleton'
          5        SEND_VAL_EX                                              'checkout%2Fsession'
          6        DO_FCALL                                      0  $14     
          7        INIT_METHOD_CALL                                         $14, 'getLastOrderId'
          8        DO_FCALL                                      0  $15     
          9        SEND_VAR_NO_REF_EX                                       $15
         10        DO_FCALL                                      0  $16     
         11        ASSIGN                                                   !0, $16
    3    12        INIT_METHOD_CALL                                         !0, 'getAllVisibleItems'
         13        DO_FCALL                                      0  $18     
         14        ASSIGN                                                   !1, $18
    4    15        INIT_METHOD_CALL                                         !0, 'getIncrementId'
         16        DO_FCALL                                      0  $20     
         17        ASSIGN                                                   !2, $20
    5    18        INIT_METHOD_CALL                                         !0, 'getCurrencyCode'
         19        DO_FCALL                                      0  $22     
         20        ASSIGN                                                   !3, $22
    6    21        INIT_METHOD_CALL                                         !0, 'getSubtotal'
         22        DO_FCALL                                      0  $24     
         23        ASSIGN                                                   !4, $24
    7    24        INIT_METHOD_CALL                                         !0, 'getQuote'
         25        DO_FCALL                                      0  $26     
         26        ASSIGN                                                   !5, $26
    8    27        INIT_METHOD_CALL                                         !5, 'getCheckoutMethod'
         28        DO_FCALL                                      0  $28     
         29        FETCH_CLASS_CONSTANT                             ~29     'Mage_Sales_Model_Quote', 'CHECKOUT_METHOD_LOGIN_IN'
         30        IS_EQUAL                                                 $28, ~29
         31      > JMPZ                                                     ~30, ->34
         32    >   QM_ASSIGN                                        ~31     'old'
         33      > JMP                                                      ->35
         34    >   QM_ASSIGN                                        ~31     'new'
         35    >   ASSIGN                                                   !6, ~31
    9    36        COUNT                                            ~33     !1
         37        ASSIGN                                                   !7, ~33
   10    38        ASSIGN                                                   !8, <array>
   11    39        ASSIGN                                                   !9, <array>
   12    40        ASSIGN                                                   !10, <array>
   13    41        ASSIGN                                                   !11, <array>
   14    42      > FE_RESET_R                                       $39     !1, ->65
         43    > > FE_FETCH_R                                               $39, !12, ->65
   15    44    >   INIT_METHOD_CALL                                         !12, 'getSku'
         45        DO_FCALL                                      0  $41     
         46        ASSIGN_DIM                                               !8
         47        OP_DATA                                                  $41
   16    48        INIT_METHOD_CALL                                         !12, 'getName'
         49        DO_FCALL                                      0  $43     
         50        ASSIGN_DIM                                               !9
         51        OP_DATA                                                  $43
   17    52        INIT_FCALL                                               'number_format'
         53        INIT_METHOD_CALL                                         !12, 'getPrice'
         54        DO_FCALL                                      0  $45     
         55        SEND_VAR                                                 $45
         56        SEND_VAL                                                 2
         57        DO_ICALL                                         $46     
         58        ASSIGN_DIM                                               !10
         59        OP_DATA                                                  $46
   18    60        INIT_METHOD_CALL                                         !12, 'getOrderedQty'
         61        DO_FCALL                                      0  $48     
         62        ASSIGN_DIM                                               !11
         63        OP_DATA                                                  $48
   14    64      > JMP                                                      ->43
         65    >   FE_FREE                                                  $39
   21    66        ECHO                                                     '%0A%3C%21--+Become+Sales+Tracking+Script+V+1.0.0+-+All+rights+reserved+--%3E%0A%3Cscript+language%3D%22JavaScript%22%3E%0A++++var+pg_pangora_merchant_id%3D%2769761%27%3B%0A++++var+pg_order_id%3D%27'
   25    67        ECHO                                                     !2
         68        ECHO                                                     '%27%3B%0A++++var+pg_cart_size%3D%27'
   26    69        ECHO                                                     !7
         70        ECHO                                                     '%27%3B%0A++++var+pg_cart_value%3D%27'
   27    71        ECHO                                                     !4
         72        ECHO                                                     '%27%3B%0A++++var+pg_currency%3D%27'
   28    73        ECHO                                                     !3
         74        ECHO                                                     '%27%3B%0A++++var+pg_customer_flag%3D%27'
   29    75        ECHO                                                     !6
         76        ECHO                                                     '%27%3B%0A++++var+pg_product_id%3D%27'
   30    77        INIT_FCALL                                               'implode'
         78        SEND_VAL                                                 '%2C'
         79        SEND_VAR                                                 !8
         80        DO_ICALL                                         $49     
         81        ECHO                                                     $49
         82        ECHO                                                     '%27%3B%0A++++var+pg_product_name%3D%27'
   31    83        INIT_STATIC_METHOD_CALL                                  'Mage', 'helper'
         84        SEND_VAL_EX                                              'core'
         85        DO_FCALL                                      0  $50     
         86        INIT_METHOD_CALL                                         $50, 'jsQuoteEscape'
         87        INIT_FCALL                                               'implode'
         88        SEND_VAL                                                 '%2C'
         89        SEND_VAR                                                 !9
         90        DO_ICALL                                         $51     
         91        SEND_VAR_NO_REF_EX                                       $51
         92        DO_FCALL                                      0  $52     
         93        ECHO                                                     $52
         94        ECHO                                                     '%27%3B%0A++++var+pg_product_price%3D%27'
   32    95        INIT_FCALL                                               'implode'
         96        SEND_VAL                                                 '%2C'
         97        SEND_VAR                                                 !10
         98        DO_ICALL                                         $53     
         99        ECHO                                                     $53
        100        ECHO                                                     '%27%3B%0A++++var+pg_product_units%3D%27'
   33   101        INIT_FCALL                                               'implode'
        102        SEND_VAL                                                 '%2C'
        103        SEND_VAR                                                 !11
        104        DO_ICALL                                         $54     
        105        ECHO                                                     $54
        106        ECHO                                                     '%27%3B%0A%3C%2Fscript%3E%0A%3Cscript+language%3D%22JavaScript%22+src%3D%22https%3A%2F%2Fclicks.pangora.com%2Fsales-tracking%2FsalesTracker.js%22%3E%3C%2Fscript%3E%0A%3Cnoscript%3E%3Cimg+src%3D%22https%3A%2F%2Fclicks.pangora.com%2Fsales-tracking%2F69761%2FsalesPixel.do%22%2F%3E%3C%2Fnoscript%3E'
   36   107      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.63 ms | 1404 KiB | 17 Q