本文整理匯總了PHP中mage\checkout\test\page\CheckoutCart::getAdvancedCheckoutCart方法的典型用法代碼示例。如果您正苦於以下問題:PHP CheckoutCart::getAdvancedCheckoutCart方法的具體用法?PHP CheckoutCart::getAdvancedCheckoutCart怎麽用?PHP CheckoutCart::getAdvancedCheckoutCart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mage\checkout\test\page\CheckoutCart
的用法示例。
在下文中一共展示了CheckoutCart::getAdvancedCheckoutCart方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processAssert
/**
* Assert that after adding products by sku, wrong requested quantity error message appears.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
$currentMessage = $checkoutCart->getAdvancedCheckoutCart()->getFailedItemErrorMessage($product);
\PHPUnit_Framework_Assert::assertContains(self::ERROR_QUANTITY_MESSAGE, $currentMessage);
\PHPUnit_Framework_Assert::assertContains(sprintf($this->allowedQtyMessage, $product->getStockData()[$this->saleQtyType]), $currentMessage);
}
}
示例2: processAssert
/**
* Assert that requested quantity is not available error message is displayed after adding products to cart by sku.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
$currentMessage = $checkoutCart->getAdvancedCheckoutCart()->getFailedItemErrorMessage($product);
\PHPUnit_Framework_Assert::assertContains(self::ERROR_QUANTITY_MESSAGE, $currentMessage);
\PHPUnit_Framework_Assert::assertContains(sprintf(self::LEFT_IN_STOCK_ERROR_MESSAGE, $product->getStockData()['qty']), $currentMessage);
}
}
示例3: processAssert
/**
* Assert that product has tier price message appears after adding products by sku to shopping cart.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
$messages = $checkoutCart->getAdvancedCheckoutCart()->getTierPriceMessages($product);
$tierPrices = $product->getTierPrice();
\PHPUnit_Framework_Assert::assertTrue(count($messages) === count($tierPrices), 'Wrong qty messages is displayed.');
foreach ($tierPrices as $key => $tierPrice) {
$price = (bool) strpos($messages[$key], (string) $tierPrice['price']);
$priceQty = (bool) strpos($messages[$key], (string) $tierPrice['price_qty']);
$savePercent = (bool) strpos($messages[$key], $this->getSavePercent($product->getPrice(), $tierPrice));
\PHPUnit_Framework_Assert::assertTrue($price and $priceQty and $savePercent, 'Wrong tier price message is displayed.');
}
}
}
示例4: processAssert
/**
* Assert that requested qty does not meet the increments error message is displayed after adding products by sku.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
\PHPUnit_Framework_Assert::assertEquals(sprintf(self::QTY_INCREMENTS_ERROR_MESSAGE, $product->getStockData()['qty_increments']), $checkoutCart->getAdvancedCheckoutCart()->getFailedItemErrorMessage($product));
}
}
示例5: processAssert
/**
* Assert that sku not found error message is displayed after adding products to shopping cart by sku.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
\PHPUnit_Framework_Assert::assertEquals(self::ERROR_MESSAGE, $checkoutCart->getAdvancedCheckoutCart()->getFailedItemErrorMessage($product));
}
}
示例6: processAssert
/**
* Assert that specify products options link is displayed after adding products to cart by sku.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
\PHPUnit_Framework_Assert::assertTrue($checkoutCart->getAdvancedCheckoutCart()->specifyProductOptionsLinkIsVisible($product), "Specify the product's options link is not visible.");
}
}
示例7: processAssert
/**
* Assert that notice is present that product with enabled MAP.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
\PHPUnit_Framework_Assert::assertTrue($checkoutCart->getAdvancedCheckoutCart()->isMsrpNoticeDisplayed($product), 'Notice that product with enabled MAP is absent.');
}
}
示例8: processAssert
/**
* Assert that out of stock error message is displayed after adding out of stock products to cart by sku.
*
* @param CheckoutCart $checkoutCart
* @param array $requiredAttentionProducts
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $requiredAttentionProducts)
{
foreach ($requiredAttentionProducts as $product) {
\PHPUnit_Framework_Assert::assertContains(self::ERROR_MESSAGE, $checkoutCart->getAdvancedCheckoutCart()->getFailedItemErrorMessage($product), 'Wrong error message is displayed.');
}
}