Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Created October 31, 2014 13:31
Show Gist options
  • Save tristanlins/5764ee829c1254c9bbcb to your computer and use it in GitHub Desktop.
Save tristanlins/5764ee829c1254c9bbcb to your computer and use it in GitHub Desktop.
<?php
class Shipping
{
public function isAvailable()
{
// HOOK: allow to add custom logic
if (isset($GLOBALS['ISO_HOOKS']['shippingIsAvailable']) && is_array($GLOBALS['ISO_HOOKS']['shippingIsAvailable']))
{
foreach ($GLOBALS['ISO_HOOKS']['shippingIsAvailable'] as $callback)
{
$objCallback = \System::importStatic($callback[0]);
$available = $objCallback->$callback[1]($this);
if (true === $available || false === $available) {
return $available;
}
}
}
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment