Store Configuration
Set Price Book
To set the price book, you can use this code:
import ai.mealz.core.Mealz
Mealz.basket.setPriceBook(priceBookId: pricebook.rawValue)
Set Store
For Mealz to work properly, a store is mandatory. Without a store, we cannot generate a Recipe price, see the products, or purchase anything.
However, Recipe Cards, & our catalog, CAN be shown without a store. When the user clicks on a Recipe Card, we prompt the user to select a store. You must pass in a function for us to navigate to your Store Selector.
import ai.mealz.core.Mealz
object MealzManager {
private var isInitialized = false
public fun initialize(applicationContext: Context) {
Mealz.user.setStoreLocatorRedirection { /** Your select store navigation method */ }
Mealz.Core {
sdkRequirement {
key = supplierKey
context = applicationContext
}
}
isInitialized = true
}
}