Skip to main content
Version: 5.0

Store Configuration

Set Price Book

To set the price book, you can use this code:

import mealzcore

Mealz.shared.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.

public class MealzManager: ObservableObject {
public static let sharedInstance = MealzManager()

private init() {
// set the redirection when the user has not selected a store
Mealz.shared.user.setStoreLocatorRedirection { yourFunctionToChangeStore() }

Mealz.shared.Core(init: { coreBuilder in
coreBuilder.sdkRequirement(init: { requirementBuilder in
requirementBuilder.key = key
})
})
}
}