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


PHP CheckoutCart::getShippingBlock方法代碼示例

本文整理匯總了PHP中mage\checkout\test\page\CheckoutCart::getShippingBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CheckoutCart::getShippingBlock方法的具體用法?PHP CheckoutCart::getShippingBlock怎麽用?PHP CheckoutCart::getShippingBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mage\checkout\test\page\CheckoutCart的用法示例。


在下文中一共展示了CheckoutCart::getShippingBlock方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processAssert

 /**
  * 1. Navigate to frontend
  * 2. If "Log Out" link is visible and "isLoggedIn" empty
  *    - makes logout
  * 3. If "isLoggedIn" not empty
  *    - login as customer
  * 4. Clear shopping cart
  * 5. Add test product(s) to shopping cart with specify quantity
  * 6. If "salesRule/data/coupon_code" not empty:
  *    - fill "Enter your code" input in Dіscount Codes
  *    - click "Apply Coupon" button
  * 7. If "address/data/country_id" not empty:
  *    On Estimate Shipping and Tax:
  *    - fill Country, State/Province, Zip/Postal Code
  *    - click 'Get a Quote' button
  *    - select 'Flat Rate' shipping
  *    - click 'Update Total' button
  * 8. Implementation assert
  *
  * @param CheckoutCart $checkoutCart
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountLogin $customerAccountLogin
  * @param CustomerAccountLogout $customerAccountLogout
  * @param CatalogCategoryView $catalogCategoryView
  * @param CatalogProductView $catalogProductView
  * @param Customer $customer
  * @param SalesRule $salesRule
  * @param Address $address
  * @param Browser $browser
  * @param array $productQuantity
  * @param CatalogProductSimple $productForSalesRule1
  * @param CatalogProductSimple $productForSalesRule2
  * @param array $shipping [optional]
  * @param int|null $isLoggedIn
  * @return void
  *
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function processAssert(CheckoutCart $checkoutCart, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout, CatalogCategoryView $catalogCategoryView, CatalogProductView $catalogProductView, Customer $customer, SalesRule $salesRule, Address $address, Browser $browser, array $productQuantity, CatalogProductSimple $productForSalesRule1, CatalogProductSimple $productForSalesRule2, array $shipping = [], $isLoggedIn = null)
 {
     $this->checkoutCart = $checkoutCart;
     $this->cmsIndex = $cmsIndex;
     $this->customerAccountLogin = $customerAccountLogin;
     $this->customerAccountLogout = $customerAccountLogout;
     $this->catalogCategoryView = $catalogCategoryView;
     $this->catalogProductView = $catalogProductView;
     $this->customer = $customer;
     $this->browser = $browser;
     $this->productForSalesRule1 = $productForSalesRule1;
     $this->productForSalesRule2 = $productForSalesRule2;
     $isLoggedIn ? $this->login() : $this->customerAccountLogout->open();
     $this->checkoutCart->open()->getCartBlock()->clearShoppingCart();
     $this->addProductsToCart($productQuantity);
     if ($address->hasData('country_id')) {
         $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address);
         if (!empty($shipping)) {
             $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping);
         }
     }
     if ($salesRule->getCouponCode()) {
         $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($salesRule->getCouponCode());
     }
     $this->assert();
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:64,代碼來源:AbstractCartPriceRuleApplying.php

示例2: fillEstimateBlock

 /**
  * Fill estimate block.
  *
  * @param Address $address
  * @param array $shipping
  * @return void
  */
 protected function fillEstimateBlock(Address $address, array $shipping)
 {
     $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address);
     $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping);
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:12,代碼來源:AbstractAssertTaxRuleIsAppliedToAllPrices.php


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