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>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Mage" not found in /in/1fQrc:2 Stack trace: #0 {main} thrown in /in/1fQrc on line 2
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.71 ms | 401 KiB | 8 Q