Commit 6dcb2e05e9c16d127561c4e85d6f3800a2ad537e
1 parent
c635810b
Exists in
master
and in
28 other branches
Fix: price shouldn't appear when it's $0.00
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
app/views/catalog/index.rhtml
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | <span class="product-discount-by"><%= _('by ') %></span> |
| 26 | 26 | </span> |
| 27 | 27 | <% end %> |
| 28 | - <% unless product.price.blank? %> | |
| 28 | + <% unless product.price.blank? or product.price == 0 %> | |
| 29 | 29 | <span class="product-price"> |
| 30 | 30 | <%= price_span product.price_with_discount, :class => "product-price #{'with-discount' unless product.discount}" %> |
| 31 | 31 | <span class="product-unit"><%= _(' / ') + (product.unit ? product.unit.singular : _('unit')) %></span> | ... | ... |
features/browse_catalogs.feature
| ... | ... | @@ -60,6 +60,19 @@ Feature: browse catalogs |
| 60 | 60 | And I should not see "qualifiers" |
| 61 | 61 | And I should not see "price composition" |
| 62 | 62 | |
| 63 | + Scenario: don't display the price when it's $0.00 | |
| 64 | + Given the following products | |
| 65 | + | owner | category | name | price | | |
| 66 | + | artebonito | categ1 | Produto1 | 0.00 | | |
| 67 | + And I am on /catalog/artebonito | |
| 68 | + Then I should see "Produto1" within "li.product-link" | |
| 69 | + And I should not see "0.00" | |
| 70 | + And I should see "No image" within "li.product-big" | |
| 71 | + And I should not see "product unavailable" | |
| 72 | + And I should not see "description" | |
| 73 | + And I should not see "qualifiers" | |
| 74 | + And I should not see "price composition" | |
| 75 | + | |
| 63 | 76 | Scenario: product name links to product page |
| 64 | 77 | Given the following products |
| 65 | 78 | | owner | category | name | price | | ... | ... |