Skip to content

Commit

Permalink
Merge pull request #8 from Mertiozys/price-calculation
Browse files Browse the repository at this point in the history
Hide family prices if purchase price is null
  • Loading branch information
etiennePerriere committed May 2, 2016
2 parents c5991f2 + 57a79b3 commit cf3bbcf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<descriptive locale="fr_FR">
<title>Famille de clients</title>
</descriptive>
<version>1.3.2</version>
<version>1.3.3</version>
<author>
<name>Guillaume Barral</name>
<email>gbarral@openstudio.fr</email>
Expand Down
65 changes: 34 additions & 31 deletions templates/backOffice/default/product-edit-price.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,38 @@
<td colspan="7"></td>
{/form_field}
</tr>
{loop type='customer_family' name='customer_family_loop_prices'}
{loop type='customer_family_pse_calculated_prices' name='calculated_prices' pse_id=$pseId customer_family_id=$CUSTOMER_FAMILY_ID}
<tr></tr>
<tr class="purchase-price">
<!-- Customer family title -->
<td>
{intl l='Price for:' d='customerfamily.bo.default'} <a href="{url path="/admin/module/CustomerFamily"}">{$TITLE_CUSTOMER_FAMILY}</a>
</td>
<!-- Calculated standard price -->
<td colspan="2" class="text-right">
<span class="glyphicon glyphicon-arrow-right pull-left" aria-hidden="true"></span>
<b>{intl l='Calculated price' d='customerfamily.bo.default'}</b>
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PRICE}" disabled />
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PRICE}" disabled />
</td>
<!-- Calculated promo price -->
<td colspan="4" class="text-right">
<b>{intl l='Calculated promo price' d='customerfamily.bo.default'}</b>
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PROMO_PRICE}" disabled />
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PROMO_PRICE}" disabled />
</td>
</tr>

{if $purchasePrice !== ''}
{loop type='customer_family' name='customer_family_loop_prices'}
{loop type='customer_family_pse_calculated_prices' name='calculated_prices' pse_id=$pseId customer_family_id=$CUSTOMER_FAMILY_ID}
<tr></tr>
<tr class="purchase-price">
<!-- Customer family title -->
<td>
{intl l='Price for:' d='customerfamily.bo.default'} <a href="{url path="/admin/module/CustomerFamily"}">{$TITLE_CUSTOMER_FAMILY}</a>
</td>
<!-- Calculated standard price -->
<td colspan="2" class="text-right">
<span class="glyphicon glyphicon-arrow-right pull-left" aria-hidden="true"></span>
<b>{intl l='Calculated price' d='customerfamily.bo.default'}</b>
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PRICE}" disabled />
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PRICE}" disabled />
</td>
<!-- Calculated promo price -->
<td colspan="4" class="text-right">
<b>{intl l='Calculated promo price' d='customerfamily.bo.default'}</b>
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_PROMO_PRICE}" disabled />
</td>
<td>
<input class="input-sm text-right form-control" type="text" value="{$CALCULATED_TAXED_PROMO_PRICE}" disabled />
</td>
</tr>
{/loop}
{/loop}
{/loop}
{/if}

0 comments on commit cf3bbcf

Please sign in to comment.