1

I have a product which has 1 custom option (Size) with 3 custom options values (Standard,Medium,Large).

Now I am trying to change price type (price_type) 'fixed' to 'absolute'. I fetched the option_type_id by using customOptions as below:

$customOptions = $obj->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($product);
foreach ($customOptions as $customOption) {
    $values = $customOption->getValues();
    foreach ($values as $value) {
    // fetched the option_type_id
    }
}

It stored in catalog_product_option_type_price table into the database.

Is there any way to update the price type directly from option_type_id?

How to do with ProductCustomOptionInterface?

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.