當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CheckoutCart::getAdvancedCheckoutCart方法代碼示例

本文整理匯總了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);
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:15,代碼來源:AbstractAssertRequestedQtyFailMessage.php

示例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);
     }
 }
開發者ID:QiuLihua83,項目名稱:magento-ee,代碼行數:15,代碼來源:AssertQtyIsNotEnoughFailMessage.php

示例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.');
         }
     }
 }
開發者ID:QiuLihua83,項目名稱:magento-ee,代碼行數:21,代碼來源:AssertProductTierPriceMessage.php

示例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));
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:13,代碼來源:AssertQtyIncrementsFailMessage.php

示例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));
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:13,代碼來源:AssertSkuNotFoundFailMessage.php

示例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.");
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:13,代碼來源:AssertSpecifyProductOptionsLink.php

示例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.');
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:13,代碼來源:AssertMsrpNotice.php

示例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.');
     }
 }
開發者ID:MikeTayC,項目名稱:magento.dev,代碼行數:13,代碼來源:AssertProductIsOutOfStockFailMessage.php


注:本文中的mage\checkout\test\page\CheckoutCart::getAdvancedCheckoutCart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。