Skip to content

Commit cf3bbcf

Browse files
Merge pull request #8 from Mertiozys/price-calculation
Hide family prices if purchase price is null
2 parents c5991f2 + 57a79b3 commit cf3bbcf

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

Config/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<descriptive locale="fr_FR">
88
<title>Famille de clients</title>
99
</descriptive>
10-
<version>1.3.2</version>
10+
<version>1.3.3</version>
1111
<author>
1212
<name>Guillaume Barral</name>
1313
<email>gbarral@openstudio.fr</email>

templates/backOffice/default/product-edit-price.html

+34-31
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,38 @@
1616
<td colspan="7"></td>
1717
{/form_field}
1818
</tr>
19-
{loop type='customer_family' name='customer_family_loop_prices'}
20-
{loop type='customer_family_pse_calculated_prices' name='calculated_prices' pse_id=$pseId customer_family_id=$CUSTOMER_FAMILY_ID}
21-
<tr></tr>
22-
<tr class="purchase-price">
23-
<!-- Customer family title -->
24-
<td>
25-
{intl l='Price for:' d='customerfamily.bo.default'} <a href="{url path="/admin/module/CustomerFamily"}">{$TITLE_CUSTOMER_FAMILY}</a>
26-
</td>
27-
<!-- Calculated standard price -->
28-
<td colspan="2" class="text-right">
29-
<span class="glyphicon glyphicon-arrow-right pull-left" aria-hidden="true"></span>
30-
<b>{intl l='Calculated price' d='customerfamily.bo.default'}</b>
31-
</td>
32-
<td>
33-
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PRICE}" disabled />
34-
</td>
35-
<td>
36-
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PRICE}" disabled />
37-
</td>
38-
<!-- Calculated promo price -->
39-
<td colspan="4" class="text-right">
40-
<b>{intl l='Calculated promo price' d='customerfamily.bo.default'}</b>
41-
</td>
42-
<td>
43-
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PROMO_PRICE}" disabled />
44-
</td>
45-
<td>
46-
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PROMO_PRICE}" disabled />
47-
</td>
48-
</tr>
19+
20+
{if $purchasePrice !== ''}
21+
{loop type='customer_family' name='customer_family_loop_prices'}
22+
{loop type='customer_family_pse_calculated_prices' name='calculated_prices' pse_id=$pseId customer_family_id=$CUSTOMER_FAMILY_ID}
23+
<tr></tr>
24+
<tr class="purchase-price">
25+
<!-- Customer family title -->
26+
<td>
27+
{intl l='Price for:' d='customerfamily.bo.default'} <a href="{url path="/admin/module/CustomerFamily"}">{$TITLE_CUSTOMER_FAMILY}</a>
28+
</td>
29+
<!-- Calculated standard price -->
30+
<td colspan="2" class="text-right">
31+
<span class="glyphicon glyphicon-arrow-right pull-left" aria-hidden="true"></span>
32+
<b>{intl l='Calculated price' d='customerfamily.bo.default'}</b>
33+
</td>
34+
<td>
35+
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PRICE}" disabled />
36+
</td>
37+
<td>
38+
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PRICE}" disabled />
39+
</td>
40+
<!-- Calculated promo price -->
41+
<td colspan="4" class="text-right">
42+
<b>{intl l='Calculated promo price' d='customerfamily.bo.default'}</b>
43+
</td>
44+
<td>
45+
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PROMO_PRICE}" disabled />
46+
</td>
47+
<td>
48+
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PROMO_PRICE}" disabled />
49+
</td>
50+
</tr>
51+
{/loop}
4952
{/loop}
50-
{/loop}
53+
{/if}

0 commit comments

Comments
 (0)