GithubHelp home page GithubHelp logo

Spree 4.2 about spree-product-assembly HOT 1 OPEN

jhovad avatar jhovad commented on August 17, 2024
Spree 4.2

from spree-product-assembly.

Comments (1)

jhovad avatar jhovad commented on August 17, 2024

I finally implemented my own solution, anyway for there are my points for necessary updates to Spree 4.2 compatibility:

https://github.com/spree/spree/blob/c47e591882d79e766847c627773d29186aa2224b/frontend/app/assets/javascripts/spree/frontend/views/spree/products/cart_form.js#L283
-> this pass empty param[:options]… JavaScript have to be customized for passing selected variant of the part (update of the part variant selector form to 4.2 style would be also nice)

===========

options[:selected_variants]['selected_variants'][part.part.id.to_s]

-> double of [:selected_variants]['selected_variants’] … should be only [:selected_variants]

===========

Maybe Spree issue, if not then create decorator …:
spree/spree#10986

===========

def build_inventory_unit(variant, line_item, quantity=nil)

-> outdated implementation that doubles InventoryUnits … should be maybe like

module Spree
  module Stock
    module InventoryUnitBuilderDecorator
      def units
        @order.line_items.flat_map do |line_item|
          line_item.quantity_by_variant.flat_map do |variant, quantity|
            byebug
            Spree::InventoryUnit.new(
              pending: true,
              line_item_id: line_item.id,
              variant_id: variant.id,
              quantity: quantity,
              order_id: @order.id,
            )
          end
        end
      end
    end
  end
end

… maybe another issues, but this was what I noticed

from spree-product-assembly.

Related Issues (20)

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.