11 use Magento\Mtf\Block\Form;
12 use Magento\Mtf\Fixture\FixtureInterface;
13 use Magento\Mtf\Fixture\InjectableFixture;
35 return $this->blockFactory->create(
36 \
Magento\Catalog\Test\Block\Product\View\CustomOptions::class,
37 [
'element' => $this->_rootElement->find($this->customOptionsSelector)]
49 public function fillOptions(FixtureInterface
$product)
51 $dataConfig =
$product->getDataConfig();
52 $typeId = isset($dataConfig[
'type_id']) ? $dataConfig[
'type_id'] :
null;
56 if ($this->hasRender($typeId)) {
57 $this->callRender($typeId,
'fillOptions', [
'product' =>
$product]);
61 $checkoutData =
$product->getCheckoutData();
62 $checkoutCustomOptions = isset($checkoutData[
'options'][
'custom_options'])
63 ? $checkoutData[
'options'][
'custom_options']
66 ?
$product->getDataFieldConfig(
'custom_options')[
'source']->getCustomOptions()
79 abstract public function setQty($qty);
92 foreach ($checkoutData as $checkoutOption) {
93 $attribute = str_replace(
'attribute_key_',
'', $checkoutOption[
'title']);
94 $option = str_replace(
'option_key_',
'', $checkoutOption[
'value']);