fixed access to product data structure in shop.pm


			
			
				2.0@2770
			
			
		
Daniel Tiefnig 17 years ago
parent 19870907f6
commit 32c1a1ba3a

@ -46,7 +46,7 @@ sub hardware : Local {
$self->_load_products($c) or return;
foreach my $product (@{$c->session->{shop}{dbprodarray}}) {
$c->stash->{product_hash}{$$product{handle}}{price} = sprintf "%.2f", $$product{price} / 100;
$c->stash->{product_hash}{$$product{handle}}{price} = sprintf "%.2f", $$product{data}{price} / 100;
}
if(ref $c->session->{shop}{cart} eq 'HASH' and keys %{$c->session->{shop}{cart}}) {
@ -294,7 +294,7 @@ sub system : Local {
foreach my $product (@{$c->session->{shop}{dbprodarray}}) {
next unless $$product{class} eq 'hardware';
$c->stash->{price}{$$product{handle}} = sprintf "%.2f", $$product{price} / 100;
$c->stash->{price}{$$product{handle}} = sprintf "%.2f", $$product{data}{price} / 100;
}
if(exists $c->session->{refill}{hardware}) {
@ -1344,7 +1344,8 @@ sub _load_products : Private {
$products = {};
for(@{$c->session->{shop}{dbprodarray}}) {
$$products{$$_{handle}} = $_;
$$_{data}{handle} = $$_{handle};
$$products{$$_{handle}} = $$_{data};
}
$c->session->{shop}{dbprodhash} = $products;
}

@ -99,7 +99,7 @@
<img src="/grafik_shop/SPA9000_U.gif" width="146" height="135" alt="SPA9000 upgrade" />
<h4>SPA9000 Upgrade<br/>
von 4 auf 16 Nebenst.<br />
<strong class="smallpreis">&euro; [% product_hash.SPA9000_U.price %]</strong></h4>
<strong class="smallpreis">&euro; [% product_hash.SPA9000_UPGRADE.price %]</strong></h4>
<form method="post" action="/shop/add_to_cart">
<p>
<input type="text" name="count" size="3" />
@ -107,7 +107,7 @@
<label for="add_SPA9000_upgrade" class="add_to_cart">Stk. in den</label>
<label for="add_SPA9000_upgrade" class="add_to_cart">Warenkorb</label>
</span>
<input type="hidden" name="product" value="SPA9000_U" />
<input type="hidden" name="product" value="SPA9000_UPGRADE" />
<input type="image" class="invisible" src="/grafik/dot_trans.gif" id="add_SPA9000_upgrade" />
</p>
</form>

Loading…
Cancel
Save