Tag Archives: PHP

PHP $_POST Empty After Setting post_max_size & upload_max_filesize

$_POST was empty! Firebug showed that the web browser was submitting the form’s data to the server. Yet, for some reason, PHP was not putting the data into the $_POST array. If I switched the form’s action from POST to … Continue reading

Posted in Programming | Tagged , | Leave a comment

Unit Testing & Magento’s Autoloader

If code written for Magento is executed outside of Magento—as occurs when running unit tests—Magento’s normal startup process (which registers its autoload functionality) is not run. Without the autoloader in place, the first time PHP encounters a request to initialize … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Programmatically Setting a Magento Item’s Price When Adding It to Cart

Using code, how would we give a Magento item a one-time special price then add that item to the shopping cart? The process is simple: Create an instance of the Magento product, give it a custom price by calling setSpecialPrice, … Continue reading

Posted in Programming | Tagged , | 4 Comments

Wiring Up a Custom Select Control Options List for the Magento Admin Interface

Yesterday, while building the admin interface for a Magento module, I wanted to populate a select control (a.k.a. combobox or drop-down list) with a custom list of options. Inserting the select control was simple. Building the custom options class also was easy. However, … Continue reading

Posted in Programming | Tagged , | 4 Comments

Zend Pdf Coordinates

Thought I would share a few things I recently learned about coordinates when using Zend Framework‘s Zend Pdf library. The typographical point is the unit of measurement used for all coordinates. 72 points equals 1 inch. An 8.5″ * 11″ page is 612 … Continue reading

Posted in Programming | Tagged , , | Leave a comment