-
-
Save zoffixznet/f83662c0cb22deb1607fbc8db8d2f409 to your computer and use it in GitHub Desktop.
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
sub product { | |
my $self = shift; | |
my $product = $self->products->get($self->stash('number')) | |
or return $self->reply->not_found; | |
my @crumbs; | |
my $cat_url = ''; | |
for my $subcat (split /\Q*::*\E/, $product->{category}) { | |
$cat_url .= "/$subcat"; | |
push @crumbs, +{ | |
url => $self->url_for('homecategory', category => $cat_url), | |
text => $subcat, | |
}; | |
} | |
@crumbs[-1]{last} = 1; | |
$self->stash( | |
product => $product, | |
crumbs => \@crumbs, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment