Extending PO2GO PunchOut Catalog Extension for Magento
This is a basic outline for the most common tasks for adding in additional controls and logic to the
punchout session in Magento. This resource is related to Punchout Catalog with Magento.
Detecting an active PunchOut session
Within the source code, you can test for an active punchout session with the following code.
if (Mage::getSingleton('vbw_punchout/session')->isPunchoutSession()) {
// yes this is a punchout session
} else {
// no it is not a punchout session
} ?>
Applying layout changes only while in a PunchOut session
There two primary layout handles that get loaded with a punchout out session.
<layout version="0.1.0">
<in_punchout_session>
<!-- instructions to execute on all pages when in a punchout session -->
</in_punchout_session>
<punchout_checkout_cart_index>
<!-- instructions to execute when in a punchout session and on the checkout page -->
</punchout_checkout_cart_index>
</layout>
Utilizing PunchOut events
We have made efforts to add events in at specific points to allow easy extension and customization.
Some of the objects transferred in these events are:
- customer: Mage_Customer_Model_Customer
- session: Vbw_Punchout_Model_Session
- request: \Vbw\Procurement\Punchout\Request
- po_order: \Vbw\Procurement\Punchout\Order
- po_item: \Vbw\Procurement\Punchout\Order\Item
Not all catalogs are alike, and some catalogs contain more complexity than others. In order to simplify the customization process, we have utilized Magento's events to simplify customization without having to wade through lines of code and business logic.
When the Punchout Catalog with Magento Punchout Extension is purchased, clients will get documentation about these events, the objects they send, and how they are intended to be used.
Testing your extending of PunchOut with Magento
It's important to test any changes you make to review for desired behaviors. The Punchout Catalog Emulator Test Suite that each client gets access to will provide your team the ability to test accordingly. We are also here to review and test with your team to make sure everything works as intended. Feel free to contact your PunchOut2Go representative as you see fit or contact us directly.