Adding & overwriting

In order to extend the functionality of the themes, it is important to be able to add or overwrite functions. that's why the getNgDependency() función exist, it's called the angular injector and thus inject the necessary dependencies as shown in the example below.

522

In this example, we want to modify the función onPlace() but also add an Alert popup. So the first step is to select the hook for this view, well the hook for Theme/views/order-checkout-popup.html which is 'enter_checkout_view'. Now with the function getNgDependency() we call for 'MyAlert' dependecy to be used which contains the alerts popups. The last step, you want to change what the function does, overwrite by placing the same name and changing its content.

It is important to know at what view you are adding or modifying a function or variable, for these, we use the sight hooks listed below:

Enter Hooks
'enter_root'
'enter_home_view'
'enter_profile_view'
'enter_orders_view'
'enter_cards_view'
'enter_keys_view'
'enter_settings_view'
'enter_search_view'
'enter_business_view'
'enter_category_view'
'enter_cart_view'
'enter_singup_view'
'enter_login_view'
'enter_checkout_view'
'enter_confirm_view'
'enter_notfount_view'
'enter_forgot_password_view'
'enter_reset_password_view'
'enter_businesses_editor_view'
'enter_business_editor_view'
'enter_orders_editor_view'
'enter_settings_editor_view'
'enter_webhooks_editor_view'
'enter_reviews_editor_view'
'enter_plugins_editor_view'
'enter_general_editor_view'
'enter_languages_editor_view'
'enter_integrations_editor_view'
'enter_users_editor_view'
'enter_users_create_editor_view'
'enter_users_update_editor_view'
'enter_drivermanager_create_editor_view'
'enter_drivermanager_update_editor_view'
'enter_driver_create_editor_view'
'enter_driver_update_editor_view'
'enter_dropdown_options_editor_view'
'enter_places_editor_view'
'enter_channels_editor_view'
'enter_drivers_editor_view'
Hooks
"after_show_loading"
"after_hide_loading"
"before_profile_view"
"after_profile_view"
"before_search_view"
"after_search_view"
"before_business_view"
"after_business_view"
"after_business_close_product"
"after_business_open_category"
"before_login_view"
"after_login_view"
"before_signup_view"
"after_signup_view"
"after_forgot_password_view"
"after_reset_password_view"
"after_business_editor_view"
"after_business_editor_open_category_view"
"after_business_editor_add_category_view"
"after_business_editor_open_gallery_view"
"after_listing_editor_view"
"after_show_alert"
"after_hide_alert"
"after_show_confirm"
"after_hide_confirm"
"after_orders_editor_view"
"product_option_radio_changed"
"product_option_checkbox_changed"
"product_option_errors"
"checkout_form_errors"