-
-
Save jonathandavis/4047322 to your computer and use it in GitHub Desktop.
Creating an actual Shopp account menu for the account pages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function account_menuitem ($result, $options, $O) { | |
$Storefront = ShoppStorefront(); | |
$page = current($Storefront->menus); | |
if (array_key_exists('url',$options)) return add_query_arg($page->request,'',shoppurl(false,'account')); | |
if (array_key_exists('action',$options)) return $page->request; | |
if (array_key_exists('classes',$options)) { | |
$classes = array($page->request); | |
if ($Storefront->account['request'] == $page->request) $classes[] = 'current'; | |
return join(' ',$classes); | |
} | |
if (array_key_exists('current',$options) && $Storefront->account['request'] == $page->request) | |
return true; | |
return $page->label; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment