Business-Cart-Generic
view release on metacpan or search on metacpan
lib/Business/Cart/Generic/View/Product.pm view on Meta::CPAN
package Business::Cart::Generic::View::Product;
use strict;
use warnings;
use JSON::XS;
use Moose;
use Text::Xslate 'mark_raw';
extends 'Business::Cart::Generic::View::Base';
use namespace::autoclean;
our $VERSION = '0.85';
# -----------------------------------------------
sub format_products
{
my($self, $product) = @_;
$self -> db -> logger -> log(debug => "format_products(...)");
my(@row);
push @row,
[
{td => 'Name'},
{td => 'Description'},
{td => 'Price'},
{td => 'Currency'},
];
for my $item (@$product)
{
push @row,
[
{td => $$item{name} },
{td => $$item{description} },
{td => $$item{price} },
{td => $$item{currency} },
];
}
push @row,
[
{td => 'Name'},
{td => 'Description'},
{td => 'Price'},
{td => 'Currency'},
];
return \@row;
} # End of format_products.
# -----------------------------------------------
__PACKAGE__ -> meta -> make_immutable;
1;
=pod
=head1 NAME
L<Business::Cart::Generic::View::Product> - Basic shopping cart
=head1 Synopsis
See L<Business::Cart::Generic>.
( run in 1.060 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )