Editor - More product option settings

In this view, the extra options of a product are managed if it is opened with the function showMoreProductOptionsSettings(curProduct, extra) in the view theme/views/editor/more-product-settings.html

Main Models

  • extra.options:
  • curNewOption: field reserved for a new option
  • curNewSubOption: field reserved for a new suboption

Utility Functions

  • hideMoreProductOptionsSettings(): this function closes this modal
  • updateExtraOption(option, extra): Update an option for an extra business
  • removeExtraOption(extra, option): Eliminate an option of an extra business
  • updateExtraOptionChoice(extra, option, suboption): update a suboption of an extra business
  • removeSuboption(extra, option, suboption): Eliminate a suboption of an extra from a business
  • addExtraOptionSuboption(extra, option, option.curNewSuboption): Add a suboption to an extra in a business
  • addExtraOption(extra, curNewOption, curNewSuboption): Add an option to an extra to the business

Example of base theme

594
  1. hideMoreProductOptionsSettings()
  2. extra.options
  3. An option if something changes here, activate the function updateExtraOption()
  4. removeExtraOption()
  5. A suboption if something changes here, activate the function
  6. removeSuboption(extra, option, suboption)
  7. curNewOption
  8. curNewSubOption
  9. addExtraOption(extra, curNewOption, curNewSuboption)