Coder Social home page Coder Social logo

spree-google-base's Introduction

SpreeGoogleBase

This extension allows you to use Google Base to list products for free that will appear in Google Product Search (http://www.google.com/shopping).

Learn more about Google Base

For product feed field definitions, (consult http://support.google.com/merchants/bin/answer.py?hl=en&answer=188494#US)

INSTALLATION

  1. Create google base account. Create google base ftp account (if applicable). Create data feed in google base with a type "Products" and name "google_base.xml".

  2. Install the extension with one of the following commands

    Add gem "spree_google_base", :git => 'git://github.com/jumph4x/spree-google-base.git' to Gemfile Run bundle install Run rails g spree_google_base:install Run rake db:migrate

  3. Edit product_type, priorities in spree admin (/admin/taxon_map)

  4. Set preferences in spree admin panel (/admin/google_base_settings) for the feed title, public domain, feed description, ftp login and password. FTP login is not required - you may schedule upload from the public directory.

  5. Issue the command bundle exec rake spree_google_base:generate_and_transfer to generate and upload the feed.

If you receive an error 501 Syntax error in parameters or arguments, the FTP server is angry at you for not configuring your username\password correctly.

ADVANCED CONFIGURATION

You can modify fields set for export and list of 'g:' attributes. Just create\modify config/initializers/google_base.rb and override values of GOOGLE_BASE_ATTR_MAP and GOOGLE_BASE_FILTERED_ATTRS arrays with help of Array#delete, Array#delete_at, Array#<<, Array#+=, etc. Also you can override methods from product_decorator.rb in your site extension.

CRONJOBS

There are two options to regulate google base product update:

A) Setup cronjobs to run 'rake spree_google_base:generate' and 'rake spree_google_base:transfer'

Development of this extension is sponsored by End Point and by FCP Groton.

spree-google-base's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

spree-google-base's Issues

wrong number of arguments (1 for 0)

I get the following error when running locally with Spree 1.1.3, I am not sure what the error means?

Thanks
Sam

% rake spree_google_base:generate_and_transfer --trace
** Invoke spree_google_base:generate_and_transfer (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute spree_google_base:generate_and_transfer
rake aborted!
wrong number of arguments (1 for 0)
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:90:in build_xml' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:50:ingenerate_xml'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:37:in generate_and_transfer_store' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:19:inblock in generate_and_transfer'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:18:in each' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/spree_google_base/feed_builder.rb:18:ingenerate_and_transfer'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-google-base-3fb63506163c/lib/tasks/spree_google_base_extension_tasks.rake:5:in block (2 levels) in <top (required)>' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:incall'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in block in execute' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:ineach'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in execute' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:inblock in invoke_with_call_chain'
/Users/samhamilton/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:ininvoke_with_call_chain'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:ininvoke_task'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block (2 levels) in top_level' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:ineach'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in block in top_level' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:inblock in run'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:inrun'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in <top (required)>' /Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:inload'
/Users/samhamilton/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `

'
Tasks: TOP => spree_google_base:generate_and_transfer

FeedBuilder Initialization Design Flawed

scope should not be an instance variable and should instead be refactored to a method.

Reason being, in console upon FeedBuilder instantiation, Rails console performs #inspect on the instance eventually hitting @scope which ends up evaluating and running an insane DB query.

Don't depend on spree

Don't think you should have spree in the gemfile. Can't install on newer versions.

NoMethodError in Spree/admin/google_base_settings#show

When trying to go to http://localhost:3000/admin/google_base_settings I get the following error:

Rendered /Users/samhamilton/.rvm/gems/ruby-1.9.3-p125/bundler/gems/spree-google-base-0047fb622b2b/app/views/spree/admin/google_base_settings/show.html.erb within spree/layouts/admin (6.0ms)
Completed 500 Internal Server Error in 431ms

ActionView::Template::Error (title preference not defined):
4:
5:


6: <% [:title, :public_domain, :description, :ftp_username].each do |setting| %>
7: <%= setting_presentation_row(setting) %>
8: <% end %>
9: <%= setting_presentation_row(:ftp_password, true) %>
10: <%= setting_presentation_row(:enable_taxon_mapping) %>

Rendered /Users/samhamilton/.rvm/gems/ruby-1.9.3-p125/gems/actionpack-3.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms)

I am using Spree 1.0.4 & the lastest spree-google-base code from github.

Thanks

Memory Usage Problems

Large stores can bloat memory footprint way past half of a gigabyte.

Changing to write directly to a file instead of keeping in memory.

Trying to implement on Spree 1.1.X

First the readme is out of date the task to run is now: rake spree_google_base:generate_and_transfer

Also I am getting the following when I try to run the task:
Rosss-MacBook-Pro:tatp_store RossRankin$ rake --trace spree_google_base:generate_and_transfer
** Invoke spree_google_base:generate_and_transfer (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute spree_google_base:generate_and_transfer
rake aborted!
uninitialized constant Spree::Store
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/bundler/gems/spree-google-base-0d649f42a0a7/lib/spree_google_base/feed_builder.rb:10:in generate_and_transfer' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/bundler/gems/spree-google-base-0d649f42a0a7/lib/tasks/spree_google_base_extension_tasks.rake:5:inblock (2 levels) in <top (required)>'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /Volumes/MacintoshHD/Users/RossRankin/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/gems/rake-0.9.2.2/bin/rake:33:in<top (required)>'
/Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/bin/rake:19:in load' /Volumes/MacintoshHD/Users/RossRankin/.rvm/gems/ruby-1.9.2-p318@tatp_store/bin/rake:19:in

'
Tasks: TOP => spree_google_base:generate_and_transfer

Support for Spree 1.3 & Other Improvements

I've update my fork a bit to work with spree 1.3 and was wondering if you wanted pull from it directly, or create a new branch to pull into?

I've also added support for the google product categories (ex: Apparel > Jewelry > Necklaces), the feed no longer pulls deleted products in 1.3, and I added a test mode that appends _test to the xml filename uploaded to google for debugging purposes.

I'm in process of adding support for full google product attributes using the Spree product properties system.

Sorry for spamming an issue with this, but wasn't sure where else would be appropriate.

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.