The shopper can also enter the SKU code manually.

If a string is found through barcode scanning or manual input, the ATGScanAndGoViewController uses the ATGProductManager to get an ATGProduct the SKU string using the method getProductFromSKU:delegate where delegate is the instance of ATGScanAndGoViewController. If the product is successfully found, didGetProduct is called.

On failure, didErrorGettingProduct: is called and the error message, as shown in the illustration that follows.

Adding to the cart from the scan

ATGScanAndGoViewController leverages ATGCommerceManager to add items to the shopping cart. When Add to cart is touched, the method addItemToShoppingCartWithSkuId:productID:quantity:delegate is called. On a successful scan, the SKU and product ID have been found and quantity defaults to 1, and the delegate is set to ATGScanAndGoViewController. If the item is successfully added to the cart, the delegate method didAddItemToShoppingCart is called back on in the delegate, which displays the Added to cart pop up for two seconds. Failure to successfully add the item calls back didErrorAddingItemToShoppingCart and an error message displays.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices