forked from spree-contrib/spree_recently_viewed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
30 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
Recently Viewed | ||
=============== | ||
Spree Recently Viewed | ||
===================== | ||
|
||
This extension maintains and displays a list of the products a user has recently viewed. | ||
|
||
### Installation | ||
|
||
script/extension install git://github.com/romul/spree-recently-viewed.git | ||
|
||
### Usage | ||
Add the following to you Gemfile: | ||
|
||
gem 'spree_recently_viewed', :git => 'git://github.com/spree/spree_recently_viewed.git' | ||
|
||
And run bundler: | ||
|
||
bundle install | ||
|
||
<%= stylesheet_link_tag "/recently/viewed/products.css?product_id=#{@product.id}" %> | ||
|
||
NOTE: There's no migrations required for this extension. You're done, | ||
move along now. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
"0.70.x" => { :branch => "master" } | ||
"0.60.x" => { :branch => "0-60-stable" } | ||
"0.50.x" => { :branch => "0-50-stable" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
Spree::BaseHelper.class_eval do | ||
Spree::BaseHelper.module_eval do | ||
def get_recently_viewed_products_ids | ||
if session['recently_viewed_products'].nil? | ||
[] | ||
else | ||
session['recently_viewed_products'].split(', ') | ||
end | ||
end | ||
|
||
def get_recently_viewed_products | ||
Product.find_by_array_of_ids(get_recently_viewed_products_ids) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Deface::Override.new(:virtual_path => 'shared/_products', | ||
:name => 'add_recently_viewed_products_to_products_index', | ||
:insert_after => "#products[data-hook], [data-hook='products']", | ||
:partial => 'shared/recently_viewed_products') | ||
|
||
Deface::Override.new(:virtual_path => 'products/show', | ||
:name => 'add_recently_viewed_products_to_products_show', | ||
:insert_after => "#product_description[data-hook], [data-hook='product_description']", | ||
:partial => 'shared/recently_viewed_products') |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.