本文整理汇总了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.');
}
}