本文整理汇总了PHP中Magento\Mtf\Fixture\InjectableFixture::getAssociated方法的典型用法代码示例。如果您正苦于以下问题:PHP InjectableFixture::getAssociated方法的具体用法?PHP InjectableFixture::getAssociated怎么用?PHP InjectableFixture::getAssociated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Mtf\Fixture\InjectableFixture
的用法示例。
在下文中一共展示了InjectableFixture::getAssociated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* Return product options on view page.
*
* @param InjectableFixture $product
* @return array
*/
public function getOptions(InjectableFixture $product)
{
$options = [];
$associatedProducts = $product->getAssociated();
foreach ($associatedProducts as $product) {
$subProductBlock = $this->_rootElement->find(sprintf($this->subProductByName, $product['name']), Locator::SELECTOR_XPATH);
$options[] = ['name' => $subProductBlock->find($this->productName)->getText(), 'qty' => $subProductBlock->find($this->qty)->getValue()];
}
return $options;
}
示例2: fillOptions
/**
* Fill grouped product options.
*
* @param InjectableFixture $product
* @return void
*/
public function fillOptions(InjectableFixture $product)
{
$checkoutData = $checkoutData = $product->getCheckoutData();
$associatedProducts = $product->getAssociated();
if (isset($checkoutData['options'])) {
$groupedBlock = $this->getGroupedProductBlock();
foreach ($checkoutData['options'] as $key => $option) {
$groupedBlock->getGroupedItemForm($associatedProducts[$key]['name'])->fillOption($option);
}
}
}