Skip to content

merchant.mvc#


In the realm of Miva Merchant development, one area that often raises questions pertains to Miva Merchant’s default URL structure, notably the presence of “merchant.mvc” within the URL. This documentation aims to shed light on the functionality and significance of the “merchant.mvc” component within Miva Merchant’s architecture.

“merchant.mvc” serves as Miva’s equivalent of an index page, akin to “index.php” in WordPress or “index.html” in traditional web development. It operates as a controller page, responsible for processing incoming requests, executing corresponding functions, and orchestrating various operations within the Miva Merchant environment.

Functions:#

  1. Initialization and Configuration:

    • Establishes database connections.
    • Loads essential configurations required for store functionality.
    • Handles store selection in multi-store or mall setups.
  2. Request Processing:

    • Validates requests, ensuring the existence of the requested store and correct store codes.
    • Executes actions based on incoming requests, such as adding products to the cart, updating quantities, or managing user authentication.
  3. Screen Rendering:

    • Renders requested screens/pages (e.g., storefront) and delivers them to the browser for display.
  4. Maintenance Mode and UI Exceptions:

    • Manages maintenance mode settings to restrict access during maintenance periods.
    • Handles user interface errors and exceptions, ensuring seamless user experiences.

Source Code#

  • The complete source code of “merchant.mvc” is available in Miva Merchant’s limited source kit.
  • Key functions within the source code include:
    • Loading configurations from “config.mvc”.
    • Main processing in the “Merchant” function.
    • Action execution in the “Merchant Actions” function.
    • Screen rendering in the “Merchant Screens” function.
    • Maintenance mode handling and error management functions.

Summary#

“merchant.mvc” serves as the central processing hub of Miva Merchant, orchestrating various tasks crucial for store functionality. Its role encompasses initialization, request processing, screen rendering, and maintenance management. Understanding the functionality and significance of “merchant.mvc” is pivotal for developers navigating Miva Merchant’s development landscape.

For developers seeking deeper insights, exploring the source code of “merchant.mvc” offers valuable insights into its inner workings and facilitates a comprehensive understanding of Miva Merchant’s core functionalities.