Skip to content

Commit

Permalink
Merge branch 'bc-checkout' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
macifell committed May 21, 2024
2 parents 6653c22 + b60167f commit 2aebecc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/recognizer_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ defmodule RecognizerWeb.Router do

defp add_bc_to_session(%{query_params: %{"bc" => "true", "checkout" => "true"}} = conn, _opts) do
if Recognizer.BigCommerce.enabled?() do
put_session(conn, :bc, true)
put_session(conn, :bc_checkout, true)
conn
|> put_session(:bc_checkout, true)
|> put_session(:bc, true)
else
conn
end
end

defp add_bc_to_session(%{query_params: %{"bc" => "true"}} = conn, _opts) do
if Recognizer.BigCommerce.enabled?() do
delete_session(conn, :bc_checkout)
put_session(conn, :bc, true)
conn
|> delete_session(:bc_checkout)
|> put_session(:bc, true)
else
conn
end
Expand Down

0 comments on commit 2aebecc

Please sign in to comment.