1

How is possible in magento 2.0? I successfully active in magento 1.9 for bellow thing. I am trying to create a product with two custom text fields: Length and Width. When the user types, both a length and width, the price needs to calculate via custom formula.

I'm trying to find the correct event to connect an observer. Anybody know what that might be?

Here's what I know and have tried:

  1. The custom field text box in the product view has an onChange event that I haven't figured out how to tap into yet via an observer event opConfig.reloadPrice()
  2. If I build an observer on the event sales_quote_add_item, then I can change the price via formula when it's added to the cart. With this method I still need a way to change it in the product view before it's added to cart.
  3. I've also tried the event catalog_product_get_final_price but this seem to only fire when the product page is loaded, so after a product length or width is added, it doesn't re-fire.

    Any ideas would be greatly appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.