Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URL generation error #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/solidus_sitemap/solidus_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ def default_url_options
end

def add_login(options = {})
add(login_path, options)
add(main_app.login_path, options)
end

def add_signup(options = {})
add(signup_path, options)
add(main_app.signup_path, options)
end

def add_account(options = {})
add(account_path, options)
add(main_app.account_path, options)
end

def add_password_reset(options = {})
add(new_spree_user_password_path, options)
add(main_app.new_spree_user_password_path, options)
end

def add_products(options = {})
available_products = Spree::Product.available.distinct

add(products_path, options.merge(lastmod: available_products.last_updated))
add(main_app.products_path, options.merge(lastmod: available_products.last_updated))
available_products.find_each do |product|
add_product(product, options)
end
Expand All @@ -45,7 +45,7 @@ def add_product(product, options = {})
opts[:video] = [video_options(primary_video.youtube_ref, product)]
end

add(product_path(product), opts)
add(main_app.product_path(product), opts)
end

def add_pages(options = {})
Expand Down Expand Up @@ -73,7 +73,7 @@ def add_taxons(options = {})
end

def add_taxon(taxon, options = {})
add(nested_taxons_path(taxon.permalink), options.merge(lastmod: taxon.products.last_updated)) if taxon.permalink.present?
add(main_app.nested_taxons_path(taxon.permalink), options.merge(lastmod: taxon.products.last_updated)) if taxon.permalink.present?
taxon.children.each { |child| add_taxon(child, options) }
end

Expand Down