Alarm Grid will show you how to create canonical urls in Spree Commerce. This is only an example for products show. You must implement EVERYWHERE.
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
config.actions do | |
member :spam do | |
link_icon 'icon-ban-circle' | |
bulkable? { true } | |
controller do | |
Proc.new do | |
if params[:bulk_ids] | |
params[:bulk_ids].each {|id| @abstract_model.model.find(id).spam } | |
flash[:success] = "#{params[:bulk_ids].size} Spammed" | |
else |
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
web: bundle exec puma -p $PORT | |
worker: bundle exec rake jobs:work |
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
var mutex = false; | |
function load_ads() | |
{ | |
if (mutex) { | |
setTimeout("load_ads()", 100); // try again in 100 ms? | |
return; | |
} | |
mutex = true; | |
if (!$('#pushdown').html()) { |
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
module Spree | |
Taxon.class_eval do | |
def set_permalink # No longer add in parent | |
self.permalink = name.to_url if permalink.blank? | |
end | |
end | |
end |
Curious how Alarm Grid went full site-wide SSL using Spree? Just create the one decorator below and you're good to go!
Note: This gist will not redirect .xml files so that our feeds do not error out on iPhones which do not support RSS feeds in https.
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
<div class='video' itemscope itemtype='http://schema.org/VideoObject'> | |
<meta content='http://www.viddler.com/simple/8ab66a9e/' itemprop='embedUrl'> | |
<meta content='http://images.moviefanatic.com/iu/v1364992012/video/paperman-full-movie.jpg' itemprop='thumbnail'> | |
<meta content='429' itemprop='height'> | |
<meta content='741' itemprop='width'> | |
<h1 itemprop='name'>Paperman Full Movie</h1> | |
<iframe id="viddler-66183713" src="http://www.viddler.com/embed/8ab66a9e/?autoplay=1&player=simple" width="741" height="429" frameborder="0" mozallowfullscreen="true" webkitallowfullscreen="true" scrolling="no" style="overflow:hidden !important;"></iframe> | |
</div> | |
<div class='caption' itemprop='description'>The full short film Paperman. The beautiful black and white Disney short played ahead of Wreck-It Ralph.</div> | |
<div itemprop='aggregateRating' itemscope itemtype='http://schema.org/AggregateRating'> |
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
module RailsAdmin | |
module PostConfig | |
def self.extended(base) | |
base.class_eval do | |
rails_admin do | |
weight -10 | |
list(&base.rails_admin_list_fields) | |
edit(&base.rails_admin_edit_fields) |
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
class Spree::Calculator::TaxCloudCalculator < Spree::Calculator | |
NEXUS_STATES = ['FL'] | |
def self.description | |
"Tax Cloud Calculator" | |
end | |
def compute(object) | |
# given an order, we need to lookup the taxes from TaxCloud by using the hard-coded origin | |
return 0 unless object.is_a?(Spree::Order) and object.ship_address and object.line_items.size > 0 and NEXUS_STATES.include?(object.ship_address.state.abbr) |
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
ehoch |
OlderNewer