1

I have created dynamic rows in Product edit form using dataProvider as per my custom requirements. I want to have Catalog Price Scope dropdown with amount option as in screen shot: enter image description here

I have got amount field with currency symbol. In dynamic rows children I added:

'children' => [

                static::FIELD_PRICE_NAME => $this->getPriceFieldConfigForSelectType(30)

            ]

and defined function as:

private function getPriceFieldConfigForSelectType(int $sortOrder)
{
    $priceFieldConfig = $this->getPriceFieldConfig($sortOrder);
    $priceFieldConfig['arguments']['data']['config']['template'] = 'Magento_Catalog/form/field';

    return $priceFieldConfig;
}
protected function getPriceFieldConfig($sortOrder)
{
    return [
        'arguments' => [
            'data' => [
                'config' => [
                    'label' => __('Amount'),
                    'componentType' => Field::NAME,
                    'component' => 'Magento_Catalog/js/components/custom-options-component',
                    'formElement' => Input::NAME,
                    'dataScope' => static::FIELD_PRICE_NAME,
                    'dataType' => Number::NAME,
                    'addbefore' => $this->getCurrencySymbol(),
                    'addbeforePool' => $this->productOptionsPrice->prefixesToOptionArray(),
                    'sortOrder' => $sortOrder,
                    'validation' => [
                        'validate-number' => true
                    ],
                ],
            ],
        ],
    ];
}

I just wanted to know how to add base/catalog Price Scope in Dynamic rows. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.