I created a new product type like "License Product" extend from "Virtual Product". I can place an order with this product type in frontend, but i can't add this product to order in backend.

Any help will be appreciated.

This is my code:


class InstallData implements InstallDataInterface
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
        $this->eavSetupFactory = $eavSetupFactory;

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $fieldList = [

        foreach ($fieldList as $field) {
            $applyTo = explode(
               $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $field, 'apply_to')
        if (!in_array('license', $applyTo)) {
            $applyTo[] = 'license';
                implode(',', $applyTo)


<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<type name="license" label="License Product" modelInstance="Demo\ProductType\Model\Product\Type\License"
      composite="false" isQty="true" canUseQtyDecimals="false" sortOrder="70">
    <priceModel instance="Demo\ProductType\Model\Product\Type\Price"/>
        <attribute name="refundable" value="true"/>
        <attribute name="is_real_product" value="false"/>

  • can you explain more? Commented Mar 11, 2016 at 11:25
  • Ex: I created a new product with type "License Product" and it have id as 2000. But when i can't find this product when i want add it to an orders in admin panel.
    – LinoPham
    Commented Mar 11, 2016 at 16:34

1 Answer 1


as far as I see, when the collection of available product types is prepared, the list is fetched from Magento\Sales\Model\Config::getAvailableProductTypes() which in turns searches for XML configuration under order/available_product_types nodes.

In other words: did you define a sales.xml file under your module's etc folder made like this?

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd">
        <available_product_type name="license"/>

Hope it throws some light.

  • Glad it was helpful! Thank you for the points. Commented Mar 15, 2016 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.