GithubHelp home page GithubHelp logo

spree-contrib / spree_social_products Goto Github PK

View Code? Open in Web Editor NEW
28.0 9.0 83.0 414 KB

Add social sharing buttons for your Spree products

Home Page: http://guides.spreecommerce.org

License: BSD 3-Clause "New" or "Revised" License

Ruby 58.25% CoffeeScript 1.04% JavaScript 0.29% CSS 3.06% HTML 37.36%

spree_social_products's Introduction

Spree Social Products

Build Status Code Climate

A Spree extension that allows you to add social network sharing buttons (e.g. the Facebook like button) to your product pages.

There is some default styling that works well with the default spree theme, but this can be overrided.

Screenshot


Installation

Add this extension to your Gemfile:

gem 'spree_social_products', github: 'spree-contrib/spree_social_products', branch: 'master'

Then run:

bundle install

If you would like to use the default styles you can run:

bundle exec rails g spree_social_products:install

in order to copy over the required css files.


Usage

Enabled social networks will show up on product detail pages. In order to disable/enable social networks, head to Admin -> Configuration -> Social Sharing Settings.

NOTE: To enable the Facebook like button, you must update the Spree::Social::Config.facebook_app_id setting with your Facebook application ID. You can update this setting by running the following in the rails console:

Spree::Social::Config.facebook_app_id = 'YOUR_FACEBOOK_APP_ID'

Additionally, you may further customize the looks of the Facebook like button with the settings shown below with their default values and other possible values in comments:

Spree::Social::Config.facebook_layout = 'standard'      # button_count, box_count
Spree::Social::Config.facebook_show_faces = false       # true
Spree::Social::Config.facebook_verb_to_display = 'like' # recommend
Spree::Social::Config.facebook_color_scheme = 'light'   # dark
Spree::Social::Config.facebook_send_button = false      # true

You may refer to https://developers.facebook.com/docs/reference/plugins/like/ to preview the looks of different settings.


Contributing

See corresponding guidelines


Copyright (c) 2010-2015 John Dyer and other contributors. released under the New BSD License

spree_social_products's People

Contributors

aming avatar andreabeggiato avatar antoniojasr avatar braincomb avatar christoph-buente avatar clemens avatar futhr avatar gayathritulasi avatar jdutil avatar jhawthorn avatar josuedhg avatar kunalchaudhari avatar lbrapid avatar lucaferri avatar ospsuite avatar radar avatar tiagoamaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_social_products's Issues

Error if product has no image

I can't access the product's page if the product has no image. The problem is in _twitter.html.erb where it evals:

<meta property="twitter:image" content="<%= absolute_image_url(@product.images.first.attachment.url) %>" />

where @product.images.first is nil.

I fixed it in my project hardcoding a

<% unless @product.images.first.nil? %> <meta property="twitter:image" content="<%= absolute_image_url(@product.images.first.attachment.url) %>" /> <% end %>

Setting facebook FACEBOOK_APP_ID

I've got the extension spree_social_products installed in my spree 2.4.7 store on rails 4.1.8 and everything is working great.

I have an issue when trying to set my facebook app id.

The readme says run up a rails console and enter

Spree::Social::Config.facebook_app_id = 'YOUR_FACEBOOK_APP_ID'

When I run that command in the console I'm getting the following.

<main>'2.1.0 :011 > Spree::Social::Config.facebook_app_id = 'XXXXX123456' NameError: uninitialized constant Spree::Social from (irb):11 from /home/mspree/.rvm/gems/[email protected]/gems/railties-4.1.8/lib/rails/commands/console.rb:90:instart'
....

I'm not familiar with the rails console , am I running the command correctly ?
I've tried rails console and rails console development, both give the same error.

Thanks
Andy

Define parameter for "BOOKMARK OR SHARE THIS"

It would be useful if the title defined in the partial _social_buttons.html.erb <h6>BOOKMARK OR SHARE THIS</h6> could be defined as a parameter somewhere (configuration or admin section etc...) .

Great work!

Michael

2-3-stable

Spree 2-3-stable is released.

Could you please update the master to Spree 2-3-stable and create the branch of 2-3

Thanks

Improper cropping of the image

On liking the product the product is getting shared but the image of the product is not getting cropped properly.
screenshot from 2013-07-11 13 26 31

The sides of the shoes is getting cut.
I am sending an image of 707px*500px.

Suport for spree 3.0

hi,
Can you please upgrade this gem to work in the current spree 3.0 version?

[WARNING] You no longer need to manually require overrides, remove require for....

Using 'deface', '1.0.0.rc2' I get [WARNING] You no longer need to manually require overrides, remove require for 'add_social_products_to_configurations_menu'..

This is because https://github.com/spree/spree_social_products/blob/master/lib/spree_social_products/engine.rb#L13 is requiring filenames with *_decorator*.rb and it's requiring https://github.com/spree/spree_social_products/blob/master/app/overrides/admin_configuration_decorator.rb

With the latest deface version it's not the correct way to add an override. Any particular reason why that override has the _decorator.rb suffix?

2 0 stable

Spree 2-0-stable is released.

Could you please update the master to Spree 2-0-stable and create the branch of 1-3-stable and 2-0-stable so that people can choose the version by corresponding branches

Thanks

ActiveRecord::StatementInvalid in Spree/products#show

Brand new store using
*1.3 Stable of spree

  • master of spree_social_products
  • no custom extensions

I am getting the following error in development when facebook social is enabled.
If I disable facebook social in the admin section, everything works fine.
It seems that the query generates a wrong sql "spree_products"."permalink" = 1 which is clearly not what it should be...

Any Idea what might be going on?

PG::Error: ERROR:  operator does not exist: character varying = integer
LINE 1: ...urrency" = 'CAD' AND "spree_products"."permalink" = 1 AND ("...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT  "spree_products".* FROM "spree_products" INNER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants"."is_master" = 't' INNER JOIN "spree_prices" ON "spree_prices"."variant_id" = "spree_variants"."id" WHERE "spree_prices"."currency" = 'CAD' AND "spree_products"."permalink" = 1 AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2013-04-23 21:09:07.050516') AND ("spree_products".available_on <= '2013-04-23 21:09:07.050852') AND (spree_prices.amount IS NOT NULL) LIMIT 1
Extracted source (around line #5):
2:   <% content_for :head do %>
3:     <meta property="og:title" content="<%= @product.name %>" />
4:     <meta property="og:type" content="product" />
5:     <meta property="og:url" content="<%= product_url(@product) %>" />
6:     <meta property="og:description" content="<%= @product.description %>" />
7:     <% @product.images.each do |img| %>
8:     <meta property="og:image" content="<%= absolute_image_url(img.attachment.url) %>" />

not getting product images

Hi,
I'm using Spree 3 and this gem and on a product detail page, when sharing I keep getting a default spree image not the product image or reference.
Am I missing something ?
Any settings that have to be made other than adding the App key ?

Open Graph tag image is missing for products

Since we are publishing the social "like" for a product, it would be much better to also add a picture to the graph using the tag
<meta property="og:image" content="<HERE_PATH_TO_SMALL_PRODUCT_IMAGE">
in the _facebook.html.erb

Is there a reason why this has not been done? If not, I could submit a PR

Configure the way Facebook displays the like

I'd like to submit a PR allowing the user of this extension to define how the facebook like button will appear
For now the layout always display the sign in blurb. But one of my customer would like to use the count box instead. All of that can be configure using the facebook attributes defined here
http://developers.facebook.com/docs/reference/plugins/like/

The line to change is this one
https://github.com/spree/spree_social_products/blob/master/app/views/spree/social/_facebook.html.erb#L35

I would like to define a few preferences such as 'facebook_layout' that should be one of the three 'standard', 'button_count' or 'box_count'. Maybe add more options as well.

How would you like me to proceed? Do you have a better idea how to define this parameters or is the usage of preferences ok?

Let me know,
Cheers,
Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.