Skip to content

Instantly share code, notes, and snippets.

@grafikchaos
Last active December 22, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grafikchaos/6526015 to your computer and use it in GitHub Desktop.
Save grafikchaos/6526015 to your computer and use it in GitHub Desktop.
How to patch MageParts ReorderProduct module to correctly compare Magento versions

We've had to patch this module several times for different projects because it is a useful module, just doesn't do version comparison correctly which can cause bugs. We submitted our code changes to MageParts developers and documented the errors we were experiencing with their module on a Magento EE 1.12.0.2 installation, but they have yet to incorporate our bug fixes — that's why I feel the need to document what the necessary changes are to be made to the module so that it works as expected.

This code is pulled from production code, so local package names have been replaced with "MYMOD" (or mymod_ for short codes or XML configuration files)

Pre-requisites:

  • Already have a successfully installed MageParts ReorderProduct module in the app/code/community directory
  • Have some familiarity with PHP and Magento application structure

Get started:

Custom Module

Create your own custome module in app/code/local to extend/overwrite some MageParts functionality with the following tree structure (replace MYMOD with your own package name):

app/code/local/MYMOD
|
├── ReorderProduct
│   ├── Helper
│   │  └── Data.php
│   ├── controllers
│   │  └── IndexController.php
│   └── etc
│      └── config.xml

Layout/Template files

app/design/frontend/base/default/
|
├── layout
|   ├── MYMOD
│      └── reorderproduct.xml
├── template
|   ├── MYMOD
|      ├── reorderproduct
│         └── view.phtml
│         └── options_list.phtml

Configuration files

app/etc/modules/
|   └── MYMOD_ReorderProduct.xml

Copy the contents of the files listed below to their corresponding location in your custom module

  • app/code/local/MYMOD/ReorderProduct/controllers/IndexController.php
  • app/code/local/MYMOD/ReorderProduct/etc/config.xml
  • app/code/local/MYMOD/ReorderProduct/Helper/Data.php
  • app/etc/modules/MYMOD_ReorderProduct.xml
  • app/design/frontend/base/default/layout/MYMOD/reorderproduct.xml
  • app/design/frontend/base/default/template/MYMOD/reorderproduct/view.phtml
  • app/design/frontend/base/default/template/MYMOD/reorderproduct/options_list.phtml
<?xml version="1.0"?>
<!--
app/code/local/MYMOD/ReorderProduct/etc/config.xml
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
-->
<config>
<modules>
<MYMOD_ReorderProduct>
<version>1.0.0</version>
</MYMOD_ReorderProduct>
</modules>
<global>
<helpers>
<mymod_reorderproduct>
<class>MYMOD_ReorderProduct_Helper</class>
</mymod_reorderproduct>
<reorderproduct>
<rewrite>
<data>MYMOD_ReorderProduct_Helper_Data</data>
</rewrite>
</reorderproduct>
</helpers>
</global>
<frontend>
<layout>
<updates>
<reorderproduct>
<file>MYMOD/reorderproduct.xml</file>
</reorderproduct>
</updates>
</layout>
<routers>
<reorderproduct>
<args>
<modules>
<MYMOD_ReorderProduct before="MageParts_ReorderProduct">MYMOD_ReorderProduct</MYMOD_ReorderProduct>
</modules>
</args>
</reorderproduct>
</routers>
</frontend>
</config>
<?php
# app/design/frontend/base/default/template/MYMOD/reorderproduct/view.phtml
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
?>
<?php
$products = $this->getOrderProductCollection();
$_catalogHelper = Mage::helper('catalog');
$helper = Mage::helper('mymod_reorderproduct');
$isOldMagento = $helper->currentVersionBelow('1.4');
?>
<div class="my-reorderable-products">
<?php if ($isOldMagento): ?>
<div class="page-head">
<h3><?php echo $this->__('Reorder Products') ?></h3>
</div>
<?php else: ?>
<div class="page-title title-buttons">
<h1><?php echo $this->__('Reorder Products') ?></h1>
</div>
<?php endif; ?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php if (count($products)): ?>
<form id="reorderproduct-view-form" action="<?php echo $this->getFormActionUrl() ?>" method="post">
<fieldset>
<div class="buttons-set buttons-set1<?php if ($isOldMagento): ?> button-set<?php endif; ?>">
<button title="<?php echo $this->__('Add All to Cart') ?>"
class="button btn-update <?php if ($isOldMagento): ?> form-button-alt <?php endif; ?>"
onclick="mpRpAddAlltoCart();">
<span>
<span><?php echo $this->__('Add All to Cart') ?></span>
</span>
</button>
<button type="submit" title="<?php echo $this->__('Add Selected to Cart') ?>"
class="button<?php if ($isOldMagento): ?> form-button<?php endif; ?>">
<span>
<span><?php echo $this->__('Add Selected to Cart') ?></span>
</span>
</button>
</div>
<?php echo $this->getBlockHtml('formkey')?>
<table class="data-table" id="reorderproduct-table"
<?php if ($isOldMagento): ?> style="border-collapse:collapse;"<?php endif; ?>>
<col width="1" />
<col />
<col />
<col width="1" />
<col width="1" />
<col width="1" />
<thead>
<tr>
<th>
<input type="checkbox" id="mp-rp-toggle-checkbox" onclick="mpRpToggleSelectAll(this, false);" />
</th>
<th>
<?php echo $_catalogHelper->__('Product Name'); ?>
</th>
<th>
<?php echo $_catalogHelper->__('Product Details'); ?>
</th>
<th>
<?php echo $_catalogHelper->__('Price'); ?>
</th>
<th>
<?php echo $_catalogHelper->__('Qty'); ?>
</th>
<th class="a-center">
<span class="nobr"><?php echo $_catalogHelper->__('Add to Cart') ?></span>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($products as $product): ?>
<tr>
<td>
<input type="checkbox" class="mp-rp-item-checkbox"
name="product[<?php echo $product->getUniqueItemId() ?>]" value="1" />
<input type="hidden" name="productPrevBuyInfo[<?php echo $product->getUniqueItemId() ?>]"
value="<?php echo htmlentities($product->getPrevBuyRequestInfo()) ?>" />
<input type="hidden" name="productId[<?php echo $product->getUniqueItemId() ?>]"
value="<?php echo $product->getId() ?>" />
</td>
<td>
<a href="<?php echo $product->getProductUrl() ?>">
<?php echo $this->htmlEscape($product->getName()) ?>
</a>
</td>
<td>
<?php echo $this->getDetailsHtml($product) ?>
</td>
<td>
<div class="price-box">
<span class="regular-price" id="product-price-<?php echo $product->getUniqueItemId() ?>">
<span class="price">
<?php echo Mage::helper('core')->currency($product->getPrevItemPrice(), true, false); ?>
</span>
</span>
</div>
</td>
<td class="a-center">
<p>
<input type="text" class="input-text qty"
name="qty[<?php echo $product->getUniqueItemId() ?>]"
value="<?php echo $product->getStockItem()->getMinSaleQty() * 1 ?>" />
</p>
</td>
<td class="a-center">
<?php if ($product->isSaleable()): ?>
<button type="button" title="<?php echo $_catalogHelper->__('Add to Cart') ?>"
onclick="addRpProductToCart(<?php echo $product->getUniqueItemId() ?>, <?php echo $product->getId(); ?>)"
class="button btn-cart<?php if ($isOldMagento): ?> form-button<?php endif; ?>">
<span>
<span>
<?php echo $_catalogHelper->__('Add to Cart') ?>
</span>
</span>
</button>
<?php else: ?>
<p class="availability out-of-stock">
<span><?php echo $_catalogHelper->__('Out of Stock') ?></span>
</p>
<?php endif; ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('reorderproduct-table')</script>
<div class="buttons-set buttons-set2<?php if ($isOldMagento): ?> button-set<?php endif; ?>">
<button title="<?php echo $this->__('Add All to Cart') ?>"
class="button btn-update<?php if ($isOldMagento): ?> form-button-alt<?php endif; ?>"
onclick="mpRpAddAlltoCart();">
<span>
<span><?php echo $this->__('Add All to Cart') ?></span>
</span>
</button>
<button type="submit" title="<?php echo $this->__('Add Selected to Cart') ?>"
class="button<?php if ($isOldMagento): ?> form-button<?php endif; ?>">
<span>
<span><?php echo $this->__('Add Selected to Cart') ?></span>
</span>
</button>
</div>
</fieldset>
</form>
<?php else: ?>
<p><?php echo $this->__('You have not ordered any items yet.') ?></p>
<?php endif ?>
<script type="text/javascript">
//<![CDATA[
function mpRpToggleSelectAll(obj, forceTrue) {
// check force true
if (forceTrue) {
obj.checked = true;
}
// get all checkboxes
var checkboxObjs = $$('.mp-rp-item-checkbox');
// change checked state of all checkboxes
if (checkboxObjs.length > 0) {
for (var i=0; i<checkboxObjs.length; i++) {
checkboxObjs[i].checked = obj.checked;
}
}
}
function addRpProductToCart(itemId, productId) {
var url = '<?php echo $helper->getAddToCartUrl('%product%') ?>';
url = url.gsub('%product%', productId);
var formObj = $('reorderproduct-view-form');
if (formObj) {
// add qty value
var input = formObj['qty[' + itemId + ']'];
if (input) {
var separator = (url.indexOf('?') >= 0) ? '&' : '?';
url += separator + 'qty=' + encodeURIComponent(input.value);
}
// add buy request info data
var buyReqInput = formObj['productPrevBuyInfo[' + itemId + ']'];
if (buyReqInput) {
separator = (url.indexOf('?') >= 0) ? '&' : '?';
url += separator + 'productPrevBuyInfo=' + encodeURIComponent(buyReqInput.value);
}
}
setLocation(url);
}
function mpRpAddAlltoCart() {
// get all checkboxes
var checkboxObjs = $$('.mp-rp-item-checkbox');
// change checked state of all checkboxes
if (checkboxObjs.length > 0) {
for (var i=0; i<checkboxObjs.length; i++) {
checkboxObjs[i].checked = true;
}
}
// submit form
var formObj = $('reorderproduct-view-form');
formObj.submit();
}
//]]>
</script>
<div class="buttons-set buttons-set3<?php if ($isOldMagento): ?> button-set<?php endif; ?>">
<p class="back-link">
<a href="<?php echo htmlspecialchars($this->getBackUrl()) ?>">
<small>&laquo; </small><?php echo $_catalogHelper->__('Back') ?>
</a>
</p>
</div>
</div>
<?xml version="1.0"?>
<!--
app/etc/modules/MYMOD_ReorderProduct.xml
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
-->
<config>
<modules>
<MYMOD_ReorderProduct>
<active>true</active>
<codePool>local</codePool>
<depends>
<MageParts_ReorderProduct/>
</depends>
</MYMOD_ReorderProduct>
</modules>
</config>
<?xml version="1.0"?>
<!--
app/design/frontend/base/default/layout/MYMOD/reorderproduct.xml
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
-->
<layout version="0.1.0">
<customer_account>
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="reorderproduct" ifconfig="reorderproduct/general/enabled"><name>reorderproduct</name><path>reorderproduct/</path><label>Reorder Products</label></action>
</reference>
</customer_account>
<reorderproduct_index_index translate="label">
<label>Reorder Products</label>
<update handle="customer_account"/>
<reference name="my.account.wrapper">
<block type="reorderproduct/customer_reorderproduct" name="customer.reorderproduct" template="MYMOD/reorderproduct/view.phtml">
<block type="reorderproduct/customer_reorderproduct_item_options" name="customer.reorderproduct.item.options" as="mp_rp_item_options"/>
</block>
</reference>
<reference name="head">
<action method="addCss"><stylesheet>mageparts/reorderproduct/css/style.css</stylesheet></action>
</reference>
</reorderproduct_index_index>
</layout>
<?php
# app/code/local/MYMOD/ReorderProduct/Helper/Data.php
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
class MYMOD_ReorderProduct_Helper_Data extends MageParts_ReorderProduct_Helper_Data
{
/**
* == currentVersionAbove
*
* Possible Operators:
* <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
*
* @param string $version
* @param string $operator
* @return boolean
*/
public function currentVersionAbove($version = '1.4', $operator = 'gt')
{
return $this->compareVersions(Mage::getVersion(), $version, $operator);
}
/**
* == currentVersionBelow
*
* Possible Operators:
* <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
*
* @param string $version
* @param string $operator
* @return boolean
*/
public function currentVersionBelow($version = '1.4', $operator = 'lt')
{
return $this->compareVersions(Mage::getVersion(), $version, $operator);
}
/**
* == compareMagentoVersions
*
* Simple wrapper to PHP's version_compare
*
* Possible Operators:
* <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
*
* @param string $version1
* @param string $version2
* @param string $operator
* @return boolean
*
* @see http://php.net/manual/en/function.version-compare.php
*/
public function compareVersions($version1 = null, $version2 = '1.4', $operator = 'lt')
{
$version1 = (is_null($version1)) ? Mage::getVersion() : $version1;
return version_compare($version1, $version2, $operator);
}
}
<?php
# app/code/local/MYMOD_ReorderProduct/controllers/IndexController.php
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
require_once('MageParts/ReorderProduct/controllers/IndexController.php');
class MYMOD_ReorderProduct_IndexController extends MageParts_ReorderProduct_IndexController
{
/**
* placeholder for our MYMOD_ReorderProduct_Helper_Data instance
*
* @var MYMOD_ReorderProduct_Helper_Data
*/
protected $_helper;
/**
* Actions to be dispatched before running this controller
*/
public function preDispatch()
{
parent::preDispatch();
$this->_helper = Mage::helper('mymod_reorderproduct');
}
/**
* == indexAction
*
* Display list of products available for reordering
*
* -------------------------------------------------------------------------
* OVER RIDES:
* + use our MYMOD_ReorderProduct_Helper methods for comparing magento
* versions
* -------------------------------------------------------------------------
* @return Zend_View
*/
public function indexAction()
{
$this->loadLayout();
$session = Mage::getSingleton('customer/session');
$block = $this->getLayout()->getBlock('customer.reorderproduct');
$referer = $session->getAddActionReferer(true);
if ($block) {
$block->setRefererUrl($this->_getRefererUrl());
if ($referer) {
$block->setRefererUrl($referer);
}
}
$this->_initLayoutMessages('customer/session');
$this->_initLayoutMessages('checkout/session');
$this->_initLayoutMessages('catalog/session');
/**
* if the Magento version is less than ('lt') 1.4 than do it the old way
*/
if ($this->_helper->currentVersionBelow('1.4')) {
$this->getLayout()->getBlock('content')->append(
$this->getLayout()->createBlock($block)
);
}
$this->renderLayout();
}
/**
* Add single product to shopping cart
*
* -------------------------------------------------------------------------
* OVER RIDES:
* + use our MYMOD_ReorderProduct_Helper methods for comparing magento
* versions
* -------------------------------------------------------------------------
* @return Zend_View
*/
public function addAction()
{
// get helper object (using our custom Hock_ReorderProduct_Helper)
$helper = $this->_helper;
// setup default redirect url
$redirectUrl = Mage::getUrl('*/*');
/* @var $session Mage_Customer_Model_Session */
$session = Mage::getSingleton('customer/session');
// make sure that the extension is enabled before we continue
if (!$helper->getIsEnabled()) {
return $this->_redirect('*/*');
}
// get Magento version (moved this logic to our helper methods)
// $magentoVersion = $helper->getMagentoVersion();
try {
// get product id from parameter
$productId = (int) $this->getRequest()->getParam('product');
/* @var $product Mage_Catalog_Model_Product */
$product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($productId);
// make sure that the requested product exists
if (!$product->getId()) {
return $this->_redirect('*/*');
}
// shopping cart parameters
$cartParams = array();
// get requested qty
$qty = $this->getRequest()->getParam('qty');
if ($helper->currentVersionBelow('1.4')) {
$cartParams['qty'] = (!is_null($qty) && !empty($qty))
? floatval($qty)
: ($product->getStockItem()->getMinSaleQty() * 1);
}
else {
$filter = new Zend_Filter_LocalizedToNormalized(
array('locale' => Mage::app()->getLocale()->getLocaleCode())
);
$cartParams['qty'] = (!is_null($qty) && !empty($qty))
? $filter->filter(floatval($qty))
: $filter->filter(($product->getStockItem()->getMinSaleQty() * 1));
}
// get previous buy request information
$prevBuyRequestInfo = $this->getRequest()->getParam('productPrevBuyInfo');
if (!is_null($prevBuyRequestInfo) && !empty($prevBuyRequestInfo)) {
$cartParams = array_merge($cartParams, unserialize($prevBuyRequestInfo));
}
/* @var $cart Mage_Checkout_Model_Cart */
$cart = Mage::getSingleton('checkout/cart');
// add product to cart
$cart->addProduct($product, $cartParams);
$cart->save();
// get correct redirect url
if (($helper->currentVersionBelow('1.4')) || Mage::helper('checkout/cart')->getShouldRedirectToCart()) {
$redirectUrl = Mage::helper('checkout/cart')->getCartUrl();
} else if ($this->_getRefererUrl()) {
$redirectUrl = $this->_getRefererUrl();
}
} catch (Mage_Core_Exception $e) {
// NOT SALEABLE
if ($e->getCode() == MageParts_ReorderProduct_Model_Product::EXCEPTION_CODE_NOT_SALABLE) {
$session->addError($helper->__('This product(s) is currently out of stock'));
} else {
$session->addError($helper->__('There was an error while adding the item(s) to the shopping cart: %s', $e->getMessage()));
}
} catch (Exception $e) {
if ($helper->currentVersionBelow('1.4')) {
$session->addError($helper->__('There was an error while adding the item(s) to the shopping cart.'));
}
else {
$session->addException($e, $helper->__('There was an error while adding the item(s) to the shopping cart.'));
}
}
return $this->_redirectUrl($redirectUrl);
}
/**
* Add multiple products to shopping cart
*
* -------------------------------------------------------------------------
* OVER RIDES:
* + use our MYMOD_ReorderProduct_Helper methods for comparing magento
* versions
* -------------------------------------------------------------------------
* @return Zend_View
*/
public function cartAction()
{
// get helper object
$helper = $this->_helper;
// setup default redirect url
$redirectUrl = Mage::getUrl('*/*');
/* @var $session Mage_Customer_Model_Session */
$session = Mage::getSingleton('customer/session');
// make sure that the extension is enabled before we continue
if (!$helper->getIsEnabled()) {
return $this->_redirect('*/*');
}
// get Magento version (moved this logic to our helper)
// $magentoVersion = $helper->getMagentoVersion();
try {
/* @var $cart Mage_Checkout_Model_Cart */
$cart = Mage::getSingleton('checkout/cart');
// get products to add to shopping cart
$products = $this->getRequest()->getParam('product');
// get product ids
$productIds = $this->getRequest()->getParam('productId');
// get previous buy request information
$prevBuyRequestInfo = $this->getRequest()->getParam('productPrevBuyInfo');
if (!count($products) || !count($productIds)) {
return $this->_redirect('*/*');
}
$filter = null;
if ($helper->currentVersionAbove('1.4', '>=')) {
$filter = new Zend_Filter_LocalizedToNormalized(
array('locale' => Mage::app()->getLocale()->getLocaleCode())
);
}
foreach (array_keys($products) as $itemId) {
$productId = isset($productIds[$itemId]) ? $productIds[$itemId] : null;
/* @var $product Mage_Catalog_Model_Product */
$product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($productId);
// make sure that the requested product exists
if (!$product->getId()) {
$session->addError($helper->__('Product with id %s no longer exist', $productId));
continue;
}
// make sure that the product is saleable
if (!$product->isSaleable()) {
$session->addError($helper->__('Product %s is currently out of stock', $product->getName()));
continue;
}
// shopping cart parameters
$cartParams = array();
// get requested qty
$qtys = $this->getRequest()->getParam('qty');
if (is_null($filter)) {
if (isset($qtys[$itemId])) {
$cartParams['qty'] = floatval($qtys[$itemId]);
}
else {
$cartParams['qty'] = ($product->getStockItem()->getMinSaleQty() * 1);
}
}
else {
if (isset($qtys[$itemId])) {
$cartParams['qty'] = $filter->filter(floatval($qtys[$itemId]));
}
else {
$cartParams['qty'] = $filter->filter(($product->getStockItem()->getMinSaleQty() * 1));
}
}
if (isset($prevBuyRequestInfo[$itemId])) {
$cartParams = array_merge($cartParams, unserialize($prevBuyRequestInfo[$itemId]));
}
// add product to cart
$cart->addProduct($product, $cartParams);
}
// save shopping cart
$cart->save();
// get correct redirect url
if (($helper->currentVersionBelow('1.4')) || Mage::helper('checkout/cart')->getShouldRedirectToCart()) {
$redirectUrl = Mage::helper('checkout/cart')->getCartUrl();
} else if ($this->_getRefererUrl()) {
$redirectUrl = $this->_getRefererUrl();
}
} catch (Mage_Core_Exception $e) {
$session->addError($helper->__('There was an error while adding the item(s) to the shopping cart: %s', $e->getMessage()));
} catch (Exception $e) {
if ($helper->currentVersionBelow('1.4')) {
$session->addError($helper->__('There was an error while adding the item(s) to the shopping cart.'));
}
else {
$session->addException($e, $helper->__('There was an error while adding the item(s) to the shopping cart.'));
}
}
return $this->_redirectUrl($redirectUrl);
}
}
<?php
# app/design/frontend/base/default/template/MYMOD/reorderproduct/options_list.phtml
/**
* Simple module to extend/customize the MageParts_ReorderProduct module
*
* @category MYMOD
* @package MYMOD_ReorderProduct
* @copyright Copyright (c) 2012 August Ash, Inc. (http://www.augustash.com)
* @author Josh Johnson (August Ash)
*/
?>
<?php
$options = $this->getOptionList();
$helper = Mage::helper('mymod_reorderproduct');
$isOldMagento = $helper->currentVersionBelow('1.4');
?>
<?php if ($options): ?>
<div class="truncated">
<div class="truncated_full_value">
<div class="item-options">
<p><?php echo $this->__('Options Details'); ?></p>
<dl>
<?php foreach ($options as $option): ?>
<dt>
<?php if ($isOldMagento): ?>
<?php echo $option['label']; ?>
<?php else: ?>
<?php echo $this->escapeHtml($option['label']); ?>
<?php endif; ?>
</dt>
<dd>
<?php if (is_array($option['value'])): ?>
<?php echo nl2br(implode("\n", $option['value'])); ?>
<?php else: ?>
<?php echo $option['value']; ?>
<?php endif; ?>
</dd>
<?php endforeach; ?>
</dl>
</div>
</div>
<a href="#" onclick="return false;" class="details">
<?php echo $this->__('View Details') ?>
</a>
</div>
<?php endif ?>
@MageParts
Copy link

Nice!

Actually you updates have been included but the current development version is in a beta stage, we had several requests for updates and new features, in the end it was decided that the extension should be reconstructed completely and incorporate its own tables for tracking orders etc.

I thought I had included this in the official release as well though but maybe I'm wrong, I will look it over and get it published right away, thank you and my apologies if this got neglected.

I will try to include as much of the above as possible in the upcoming version as well, as long as you are fine with me doing so? I've linked this on my todo list so I will come back here as soon as there is time to finish the beta version of the extension, which will most likely be during the second quarter of 2014.

@MageParts
Copy link

I forgot to thank you for the amazing work you put in here.

The code is properly structured and the commentary as well as the code itself is excellent, thank you very much for helping us improve our software! :-)

@grafikchaos
Copy link
Author

No problem at all. We use this module fairly often so I was just documenting it to make it repeatable for the other developers in our company or others who may benefit. Use as much or as little of it as you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment