Skip to content

Commit 3901e03

Browse files
committed
fix bug add to cart
1 parent bf38107 commit 3901e03

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public function run()
418418
'data' => array(
419419
'id_attr_va' => $this->attributes_id,
420420
'id_product' => $this->id_attr,
421-
'price_p' => (!empty($this->price_p)) ? number_format(str_replace(",", ".", $this->price_p), 2, '.', '') : NULL
421+
'price_p' => (!empty($this->price_p)) ? number_format(str_replace(",", ".", $this->price_p), 4, '.', '') : NULL
422422
)
423423
)
424424
);

skin/public/attribute/add-to-cart.tpl

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
{if isset($attributes) && is_Array($attributes)}
2-
{foreach $attributes as $type => $options}
3-
<div class="form-group">
4-
<label for="param[attribute][{$type}]">{#ph_transport_city#|ucfirst}</label>
5-
<select name="param[attribute][{$type}]" id="param[attribute][{$type}]" class="form-control required" required>
6-
{*<option disabled selected>-- {#pn_transport_city#|ucfirst} --</option>*}
7-
{foreach $options as $value}
8-
<option value="{$value.id}">{$value.type} : {$value.name}</option>
9-
{/foreach}
10-
</select>
11-
</div>
12-
{/foreach}
1+
{vat_data id_product=$product.id}
2+
{if isset($attributes) && is_Array($attributes)}
3+
{foreach $attributes as $type => $options}
4+
<div class="form-group">
5+
{*<label for="param[attribute][{$type}]">{#ph_transport_city#|ucfirst}</label>*}
6+
<select name="param[attribute][{$type}]" id="param[attribute][{$type}]" data-price-replacer="true" class="form-control required" required>
7+
{*<option disabled selected>-- {#pn_transport_city#|ucfirst} --</option>*}
8+
{foreach $options as $value}
9+
{*{$price_attr = $value.price * (1 + ($vat/100))}*}
10+
<option value="{$value.id}"{if $value.price} data-price="{$value.price}" data-vat="{$vat}"{/if}>{$value.type} : {$value.name}</option>
11+
{/foreach}
12+
</select>
13+
</div>
14+
{/foreach}
1315
{/if}

0 commit comments

Comments
 (0)