spree_flexi_variants icon indicating copy to clipboard operation
spree_flexi_variants copied to clipboard

re: Update for Spree 2.0.0

Open ckw2013 opened this issue 11 years ago • 27 comments

Hi,

I am currently using Spree 2-0-0. I am wanting to have a custom text field option for the products. This extension caters for that issue except for earlier versions of Spree. Can you update the extension for Spree 2-0-0? Thanks.

Thanks,

K

ckw2013 avatar Sep 03 '13 20:09 ckw2013

@ckw2013 Are you able to work on a patch for this extension to bring it up to 2.0.0?

radar avatar Sep 04 '13 03:09 radar

@radar is there a guide on migrating extensions to work with 2.0? I'm just getting started with my first Spree app but I would be happy to work on this if I can get a little guidance.

ccschmitz avatar Sep 04 '13 16:09 ccschmitz

Actually, it looks like someone else has already worked on this: https://github.com/dointeractive/spree_flexi_variants/tree/2-0-stable

I don't see a pull request from them though...

ccschmitz avatar Sep 05 '13 16:09 ccschmitz

Hi @ccschmitz: there's no guide on upgrading extensions to 2.0, other than seeing if they have any tests. If they have tests, do the upgrade and see what tests are failing. If there are no tests failing (or there are simply no tests), then try out the extension for yourself. Once you've vetted that it's working, then submit a pull request for it.

I believe if you fork their extension, you may be able to make a pull request back to this repository with their changes.

radar avatar Sep 09 '13 01:09 radar

Thanks for the info @radar. I'm working on making it compatible for 2.0 over here: https://github.com/ccschmitz/spree_flexi_variants

Hopefully I'll have a pull request soon.

ccschmitz avatar Sep 11 '13 15:09 ccschmitz

Excellent :) Looking forward to it.

radar avatar Sep 12 '13 06:09 radar

I'm now working on this over in my fork as well https://github.com/charredUtensil/spree_flexi_variants I have some basic support working, but a good chunk of the features are still rather broken.

charredUtensil avatar Oct 21 '13 15:10 charredUtensil

I can't believe no one has upgraded this to 2, or 2.1 and sent a pull request :-)

So, looks like I finally am going to get around to it.

I am taking a look at @cristianbica 's 2-1 branch. I should have some indication mid-day tomorrow how that looks.

Is there a consensus of a somewhat working 2.0 or 2.1 version out there? I see a lot of activity, but no one has sent anything back upstream.

jsqu99 avatar Nov 08 '13 04:11 jsqu99

I don't know if there is any consensus. Go with what you feel is right :)

On Fri, Nov 8, 2013 at 3:45 PM, Jeff Squires [email protected] wrote:

I can't believe no one has upgraded this to 2, or 2.1 and sent a pull request :-) So, looks like I finally am going to get around to it. I am taking a look at @cristianbica 's 2-1 branch. I should have some indication mid-day tomorrow how that looks.

Is there a consensus of a somewhat working 2.0 or 2.1 version out there? I see a lot of activity, but no one has sent anything back upstream.

Reply to this email directly or view it on GitHub: https://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-28035685

radar avatar Nov 08 '13 04:11 radar

I quite literally just got something decent that appears to be working on Rails 4 / Spree 2.1 in mine, but I have very little experience with Spree extensions or Spree in general, so it's probably wrong and I haven't been able to run the tests. Still might be worth a peek, and I do have a project actively in development that uses it.

charredUtensil avatar Nov 08 '13 06:11 charredUtensil

Hi @charredUtensil - sorry for being vacant. I've been dealing w/ some personal issues in 2013.

I'm happy to work w/ you on moving forward. I just skimmed your commits and it looks like you are on the right track.

I didn't see any javascript changes, and that concerns me, since i'm thinking a lot changed there?

I don't know...I'm about to kick the tires of your version and another that i have just merged.

I need this working for 2.1, so I'll be all over it in the near future (starting now), so feel free to communicate w/ me

jsqu99 avatar Nov 08 '13 17:11 jsqu99

@jsqu99 I haven't tested it much with ad hoc options / customizations that have an additional cost, which would explain the lack of Javascript changes.

charredUtensil avatar Nov 08 '13 19:11 charredUtensil

Hello,

I've tried to use fork done by @charredUtensil. Looks like I've configured it connectly. However, whenever I try to add an item to card I get 'undefined method `+' for nil:NilClass' exception in line_item_decorator.rb.

Could anyone help me? Thanks a lot in advance.

BRZInc avatar Nov 09 '13 11:11 BRZInc

@BRZInc Toss up an issue in my fork with the line you're getting that error from and the rest of the stack trace and I can try to fix it.

charredUtensil avatar Nov 09 '13 15:11 charredUtensil

@charredUtensil Thanks a lot for assistance! However I can't figure out how to open a new issue in your fork - should I request a Pull permission for that?

BRZInc avatar Nov 09 '13 20:11 BRZInc

@charredUtensil BTW, here are some details of the exception:

Exception message: NoMethodError in Spree::OrdersController#populate undefined method `+' for nil:NilClass

Here is my stack trace: D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_flexi_variants-aa00ceb65840/app/models/spree/line_item_decorator.rb:37:in cost_price' spree_core (2.1.2) app/models/spree/line_item.rb:35:incopy_price' activesupport (4.0.0) lib/active_support/callbacks.rb:387:in _run__326002739__validation__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:inrun_callbacks' activemodel (4.0.0) lib/active_model/validations/callbacks.rb:106:in run_validations!' activemodel (4.0.0) lib/active_model/validations.rb:314:invalid?' activerecord (4.0.0) lib/active_record/validations.rb:70:in valid?' activerecord (4.0.0) lib/active_record/validations.rb:77:inperform_validations' activerecord (4.0.0) lib/active_record/validations.rb:51:in save' activerecord (4.0.0) lib/active_record/attribute_methods/dirty.rb:32:insave' activerecord (4.0.0) lib/active_record/transactions.rb:270:in block (2 levels) in save' activerecord (4.0.0) lib/active_record/transactions.rb:326:inblock in with_transaction_returning_status' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/database_statements.rb:200:in transaction' activerecord (4.0.0) lib/active_record/transactions.rb:209:intransaction' activerecord (4.0.0) lib/active_record/transactions.rb:323:in with_transaction_returning_status' activerecord (4.0.0) lib/active_record/transactions.rb:270:inblock in save' activerecord (4.0.0) lib/active_record/transactions.rb:281:in rollback_active_record_state!' activerecord (4.0.0) lib/active_record/transactions.rb:269:insave' activerecord (4.0.0) lib/active_record/associations/has_many_association.rb:39:in insert_record' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:523:inblock (2 levels) in concat_records' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:367:in add_to_target' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:522:inblock in concat_records' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:520:in each' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:520:inconcat_records' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:137:in block in concat' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:152:inblock in transaction' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/database_statements.rb:202:in block in transaction' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/database_statements.rb:210:inwithin_new_transaction' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/database_statements.rb:202:in transaction' activerecord (4.0.0) lib/active_record/transactions.rb:209:intransaction' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:151:in transaction' activerecord (4.0.0) lib/active_record/associations/collection_association.rb:137:inconcat' activerecord (4.0.0) lib/active_record/associations/collection_proxy.rb:945:in <<' D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_flexi_variants-aa00ceb65840/app/models/spree/order_decorator.rb:27:inadd_variant' D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_flexi_variants-aa00ceb65840/app/controllers/spree/orders_controller_decorator.rb:18:in block in populate' D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_flexi_variants-aa00ceb65840/app/controllers/spree/orders_controller_decorator.rb:15:ineach' D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/spree_flexi_variants-aa00ceb65840/app/controllers/spree/orders_controller_decorator.rb:15:in populate' actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:insend_action' actionpack (4.0.0) lib/abstract_controller/base.rb:189:in process_action' actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:inprocess_action' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in block in process_action' activesupport (4.0.0) lib/active_support/callbacks.rb:463:in_run__708318875__process_action__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in run_callbacks' actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:inprocess_action' actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:inblock in process_action' activesupport (4.0.0) lib/active_support/notifications.rb:159:in block in instrument' activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.0.0) lib/active_support/notifications.rb:159:in instrument' actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in process_action' activerecord (4.0.0) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (4.0.0) lib/abstract_controller/base.rb:136:in process' actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:inprocess' actionpack (4.0.0) lib/action_controller/metal.rb:195:in dispatch' actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:indispatch' actionpack (4.0.0) lib/action_controller/metal.rb:231:in block in action' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:incall' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in dispatch' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:incall' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in block in call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:ineach' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:incall' railties (4.0.0) lib/rails/engine.rb:511:in call' railties (4.0.0) lib/rails/railtie/configurable.rb:30:inmethod_missing' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in block in call' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:ineach' actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in call' actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:incall' warden (1.2.3) lib/warden/manager.rb:35:in block in call' warden (1.2.3) lib/warden/manager.rb:34:incatch' warden (1.2.3) lib/warden/manager.rb:34:in call' rack (1.5.2) lib/rack/etag.rb:23:incall' rack (1.5.2) lib/rack/conditionalget.rb:35:in call' rack (1.5.2) lib/rack/head.rb:11:incall' actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in call' actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:incall' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in context' rack (1.5.2) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in call' activerecord (4.0.0) lib/active_record/query_cache.rb:36:incall' activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in call' activerecord (4.0.0) lib/active_record/migration.rb:369:incall' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in block in call' activesupport (4.0.0) lib/active_support/callbacks.rb:373:in_run__32092491__call__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:in run_callbacks' actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in call' actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:incall' actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in call' actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.0.0) lib/rails/rack/logger.rb:38:in call_app' railties (4.0.0) lib/rails/rack/logger.rb:21:inblock in call' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in block in tagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:intagged' activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in tagged' railties (4.0.0) lib/rails/rack/logger.rb:21:incall' actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in call' rack (1.5.2) lib/rack/methodoverride.rb:21:incall' rack (1.5.2) lib/rack/runtime.rb:17:in call' activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:incall' rack (1.5.2) lib/rack/lock.rb:17:in call' actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:incall' railties (4.0.0) lib/rails/engine.rb:511:in call' railties (4.0.0) lib/rails/application.rb:97:incall' rack (1.5.2) lib/rack/lock.rb:17:in call' rack (1.5.2) lib/rack/content_length.rb:14:incall' rack (1.5.2) lib/rack/handler/webrick.rb:60:in service' D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:inservice' D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in run' D:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:inblock in start_thread'

Spree version: 2.2.0.beta Rails version: 4.0.0

Steps to reproduce:

  1. Configure customization types for product with Engraving calculator
  2. Open page of the product with customized type
  3. Fill in all the values including engraving
  4. Click Add to Cart button

Expected result: You are addressed to Cart page, new line item is added to order Actual result: An exception occurs after clicking to Add to Cart button

BRZInc avatar Nov 09 '13 20:11 BRZInc

@maxtavanti thanks a lot for the fix! Working like a charm!:)

BRZInc avatar Nov 12 '13 19:11 BRZInc

Hi,

I am currently working on a version for Spree 2-0-stable. It seems to be working for Ad Hoc Options and it saves all the information in the database. There seems to be errors with Product Customizations when you are adding to cart. Can someone have a look at working on a version for Spree 2-0-stable? Thanks.

Thanks,

K

ckw2013 avatar Nov 21 '13 23:11 ckw2013

Take a look at my 2.1 WIP branch for some tips.

On Thu, Nov 21, 2013 at 6:28 PM, ckw2013 [email protected] wrote:

Hi,

I am currently working on a version for Spree 2-0-stable. It seems to be working for Ad Hoc Options and it saves all the information in the database. There seems to be errors with Product Customizations when you are adding to cart. Can someone have a look at working on a version for Spree 2-0-stable? Thanks.

Thanks,

K

— Reply to this email directly or view it on GitHubhttps://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-29035139 .

jsqu99 avatar Nov 22 '13 01:11 jsqu99

This is a very useful project, thanks. Are you working on the 2.1 branch?

anujmiddha avatar Jan 27 '14 10:01 anujmiddha

thank you.

is there a 2-1-wip branch? i thought there was...if so, it should be usable, if not perfect. If not, look at the 2-0-wip branch and that should be a good starting point

On Mon, Jan 27, 2014 at 5:16 AM, anujmiddha [email protected]:

This is a very useful project, thanks. Are you working on the 2.1 branch?

— Reply to this email directly or view it on GitHubhttps://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-33355337 .

jsqu99 avatar Jan 27 '14 12:01 jsqu99

The 2-1-wip branch worked perfectly. There was a hiccup with using the sample data, but when I created the products from scratch after installing flexi_variants, everything worked fine. Thanks again.

anujmiddha avatar Jan 27 '14 14:01 anujmiddha

awesome.

i think there is an outstadning issue or two in the admin for 2-0 and 2-1. feel free to send pull requests :-)

On Mon, Jan 27, 2014 at 9:11 AM, anujmiddha [email protected]:

The 2-1-wip branch worked perfectly. There was a hiccup with using the sample data, but when I created the products from scratch after installing flexi_variants, everything worked fine. Thanks again.

— Reply to this email directly or view it on GitHubhttps://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-33370223 .

jsqu99 avatar Jan 27 '14 14:01 jsqu99

This seems to be a very nice extention. Any plan to bring it up to work with Spree 2.2 and 2.3?

IrvinFan avatar Aug 20 '14 22:08 IrvinFan

Thanks Irvin. take a look at my other WIP extension 'product_customizations' for a glimpse at how things will look going forward.

It is doubtful i'll do any real work on this extension in the near future, but there are like 100 forks, so check the network graph. someone has probably made some updates

On Wed, Aug 20, 2014 at 6:23 PM, Irvin Fan [email protected] wrote:

This seems to be a very nice extention. Any plan to bring it up to work with Spree 2.2 and 2.3?

— Reply to this email directly or view it on GitHub https://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-52853686 .

jsqu99 avatar Aug 21 '14 13:08 jsqu99

Yeah. I noticed that extention too. Is it working now? or how close is it to be ready? Also do you plan to make that extension to work with Spree 2.2 and 2.3? right now only master, right?

IrvinFan avatar Aug 21 '14 15:08 IrvinFan

I''ll only be working on that extension when my day job calls for it. I should probably look for a maintainer as I have no interest any longer in working on it. I won't be backporting the new extension (it relies on some changes in spree i just got accepted). i'm not sure if it's state...it's probably not far from working. take a look at my spree_vouchers extension ( github.com/spree-contrib/spree_vouchers). that uses the same ideas (to hook into the latest spree hooks that were added)

On Thu, Aug 21, 2014 at 11:46 AM, Irvin Fan [email protected] wrote:

Yeah. I noticed that extention too. Is it working now? or how close is it to be ready? Also do you plan to make that extension to work with Spree 2.2 and 2.3? right now only master, right?

— Reply to this email directly or view it on GitHub https://github.com/jsqu99/spree_flexi_variants/issues/80#issuecomment-52939274 .

jsqu99 avatar Aug 21 '14 15:08 jsqu99