Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Loads a blank page and displays something like "Hello Jane Doe! Your store credit balance is $150.25"
- // If you don't already have the Magecredit Magento extension you can get it at www.magecredit.com
- require_once('app/Mage.php'); //Path to Magento
- umask(0);
- Mage::app();
- // Now you can run ANY Magento code you want
- // Change 12 to the ID of the product you want to load
- $_customer = Mage::getModel('customer/customer')
- ->setWebsiteId(1) // website ID
- // The next line loads the magecredit customer balance model
- $_balance = Mage::getModel('wf_customerbalance/balance')->setCustomer($_customer)->loadByCustomer();
- // This line formats the amount using the currently loaded store's currency
- $_amount = Mage::app()->getStore()->formatPrice( $_balance->getAmount() );
- // Output it!
- echo Mage::helper('core')->__('Hello %1$s! Your store credit balance is %2$s', $_customer->getName(), $_amount);
- // Example Output: Hello Jane Doe! Your store credit balance is $150.25
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement