Skip to content

Partial only ever displays master variant pricing #59

Description

@jhirbour

Steps to repeat:

  • Install spree 2.1

  • load spree sample data

  • Install this gem (2.1)

  • Create examples in the admin interface (these examples from the README.md)

    Variant                Name               Range        Amount         Position
     -------------------------------------------------------------------------------
    Rails T-Shirt          1-5                (1..5)       19.99          1
    Rails T-Shirt          6-9                (6...10)     18.99          2
    Rails T-Shirt          10 or more         (10+)        17.99          3
    
  • Create your own product page (copy it from the spree gem): app/views/spree/products/show.html.erb

  • add the partial to you overridden product page

    <%= render :partial => 'spree/products/volume_pricing', :locals => { :product => @product } %>
    
  • start your webserver

  • Navigate to the product page

The problem:
Strictly a display issue only: clicking the different images of the product changes the product image, but the partial only ever displays the pricing from the master.

As far as I can tell the correct price is used when you click the variant and add to your cart, but it'd be confusing for a user if you had different volume prices per variant but they are only displayed the master one.

Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]


# spree stuff
gem 'spree', git: 'https://github.com/spree/spree.git', :branch => '2-1-stable'
gem 'spree_paypal_express', :git => 'https://github.com/radar/better_spree_paypal_express.git', :branch => '2-1-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-1-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable'
gem 'spree_volume_pricing', :git => 'https://github.com/spree/spree_volume_pricing.git', :branch => '2-1-stable'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions