diff --git a/core/app/helpers/spree/base_helper.rb b/core/app/helpers/spree/base_helper.rb index 0c8bf5c011b..f3974d1e080 100644 --- a/core/app/helpers/spree/base_helper.rb +++ b/core/app/helpers/spree/base_helper.rb @@ -79,16 +79,16 @@ def taxon_breadcrumbs(taxon, separator = ' » ', breadcrumb_class crumbs << [t('spree.products'), products_path] if taxon - crumbs += taxon.ancestors.collect { |a| [a.name, spree.nested_taxons_path(a.permalink)] } unless taxon.ancestors.empty? + crumbs += taxon.ancestors.collect { |ancestor| [ancestor.name, spree.nested_taxons_path(ancestor.permalink)] } unless taxon.ancestors.empty? crumbs << [taxon.name, spree.nested_taxons_path(taxon.permalink)] end separator = raw(separator) - items = crumbs.each_with_index.collect do |crumb, i| + items = crumbs.each_with_index.collect do |crumb, index| content_tag(:li, itemprop: 'itemListElement', itemscope: '', itemtype: 'https://schema.org/ListItem') do link_to(crumb.last, itemprop: 'item') do - content_tag(:span, crumb.first, itemprop: 'name') + tag('meta', { itemprop: 'position', content: (i + 1).to_s }, false, false) + content_tag(:span, crumb.first, itemprop: 'name') + tag('meta', { itemprop: 'position', content: (index + 1).to_s }, false, false) end + (crumb == crumbs.last ? '' : separator) end end @@ -122,7 +122,7 @@ def available_countries(restrict_to_zone: Spree::Config[:checkout_zone]) countries.collect do |country| country.name = country_names.fetch(country.iso, country.name) country - end.sort_by { |c| c.name.parameterize } + end.sort_by { |country| country.name.parameterize } end def seo_url(taxon) diff --git a/core/app/helpers/spree/products_helper.rb b/core/app/helpers/spree/products_helper.rb index 5b8c78294d1..c5420e52833 100644 --- a/core/app/helpers/spree/products_helper.rb +++ b/core/app/helpers/spree/products_helper.rb @@ -36,7 +36,7 @@ def variant_price_diff(variant) def variant_full_price(variant) return if variant.product.variants .with_prices(current_pricing_options) - .all? { |v| v.price_same_as_master?(current_pricing_options) } + .all? { |variant_with_prices| variant_with_prices.price_same_as_master?(current_pricing_options) } variant.price_for(current_pricing_options).to_html end