X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FWeb%2FOof.pm;h=f9f34f312c139d38f3da2f4eb8f9183b22de9533;hb=f4b12048a1d8d0e67a8e06748b52763efb6f518c;hp=23fd09ae37ac92a72ca77e0efa9ce220f2f879ff;hpb=80e9b2b1a3d52794bc82283ccb30be2cd556d444;p=app-web-oof.git diff --git a/lib/App/Web/Oof.pm b/lib/App/Web/Oof.pm index 23fd09a..f9f34f3 100644 --- a/lib/App/Web/Oof.pm +++ b/lib/App/Web/Oof.pm @@ -6,7 +6,7 @@ use warnings; use utf8; use parent qw/Plack::Component/; -our $VERSION = '0.000_007'; +our $VERSION = '0.000_008'; use DBIx::Simple; use Email::Sender::Simple 'sendmail'; @@ -226,7 +226,7 @@ sub order_app { header => [ From => $ENV{OOF_EMAIL_FROM}, To => $ENV{OOF_EMAIL_TO}, - Subject => "Order $id placed", + Subject => "Order $id placed for ".stringify_money($parms{total}), ], body => 'A new order was placed.', )) if $ENV{OOF_EMAIL_TO}; @@ -282,6 +282,17 @@ sub details_app { $tree->fid('pictures')->find('li')->iter3(\@pics, \&details_list_element); $tree->fid('jsonld')->replace_content(encode_json product_to_schemaorg '', %data); + $tree->fid('dd_stock')->replace_content($data{stock}); + $tree->fid('dd_price')->replace_content(stringify_money $data{price}); + for (qw/brand model/) { + if ($data{$_}) { + $tree->fid("dd_$_")->replace_content($data{$_}); + } else { + $tree->fid("dt_$_")->detach; + $tree->fid("dd_$_")->detach; + } + } + for my $ahref ($tree->find('a')) { $ahref->attr(href => "/form?highlight=$id") if $ahref->attr('href') eq '/'; }