diff --git a/app/views/admin/products_v3/_sort.html.haml b/app/views/admin/products_v3/_sort.html.haml index 4cb5f29ee9..2b25644639 100644 --- a/app/views/admin/products_v3/_sort.html.haml +++ b/app/views/admin/products_v3/_sort.html.haml @@ -1,7 +1,7 @@ #sort %div.pagination-description - if pagy.present? - = t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to) + = t(".pagination.products_total_html", count: pagy.count, from: pagy.from, to: pagy.to) - if search_term.present? || producer_id.present? || category_id.present? %a{ href: url_for(page: 1), class: "button disruptive", data: { 'turbo-frame': "_self", 'turbo-action': "advance" } } diff --git a/config/locales/en.yml b/config/locales/en.yml index 5e27e2efca..c4de413118 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -895,7 +895,9 @@ en: search: Search sort: pagination: - total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." + products_total_html: + one: "%{count} product found for your search criteria. Showing %{from} to %{to}." + other: "%{count} products found for your search criteria. Showing %{from} to %{to}." per_page: show: Show per_page: "%{num} per page" diff --git a/spec/system/admin/products_v3/index_spec.rb b/spec/system/admin/products_v3/index_spec.rb index f19172894a..3d5f30c03f 100644 --- a/spec/system/admin/products_v3/index_spec.rb +++ b/spec/system/admin/products_v3/index_spec.rb @@ -197,7 +197,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do search_for "searchable product" expect(page).to have_field "search_term", with: "searchable product" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect_products_count_to_be 1 end @@ -216,7 +216,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do search_for "searchable product" expect(page).to have_field "search_term", with: "searchable product" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect_products_count_to_be 1 end @@ -229,7 +229,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do search_for "Big box" expect(page).to have_field "search_term", with: "Big box" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect_products_count_to_be 1 end @@ -246,7 +246,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do expect_per_page_to_be 15 expect_products_count_to_be 1 search_for "searchable product" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect_products_count_to_be 1 end @@ -256,7 +256,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do search_for "searchable product" expect(page).to have_field "search_term", with: "searchable product" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect_products_count_to_be 1 expect(page).to have_field "Name", with: product_by_name.name @@ -348,7 +348,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do search_by_category "Category 1" - expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1." + expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1." expect(page).to have_select "category_id", selected: "Category 1" expect_products_count_to_be 1 expect(page).to have_field "Name", with: product_by_category.name