/** * Fill options get price and add to cart * * @param CatalogProductSimple $product * @param array $actualPrices * @return array */ protected function addToCart(CatalogProductSimple $product, array $actualPrices) { $viewBlock = $this->catalogProductView->getViewBlock(); $priceBlock = $this->catalogProductView->getWeeeViewBlock()->getPriceBlock(); $viewBlock->fillOptions($product); $actualPrices['product_page_price'] = $priceBlock->getPrice(); $actualPrices['product_page_fpt'] = $priceBlock->getFptPrice(); $actualPrices['product_page_fpt_total'] = $priceBlock->getFinalPrice(); $viewBlock->clickAddToCart(); $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); return $actualPrices; }