Magento2 - Custom Product Type PricingHow to add a new product type in Magento 2? (MageStackDay mystery question 1)Checking Configurable-Child product price types (fixed or percent)How to add custom column of custom table field or module to sales order admin grid in magento2?Extending the complexType named “imageType” with a custom image typeMagento2 prevent reindex after adding product programmaticallyHow to introduce a new type for widget parameter in Magento2?How does the grouped product module display the linked position attribute?Magento 2 configurable product on product list, prices all changeAdd to cart configurable product programatically magento2How to set custom discount on totals of product(type=bundle) price in cart. Magento 2Magento 2.2.3 - Remove price from select field on product page

Recursively updating the MLE as new observations stream in

What is the difference between something being completely legal and being completely decriminalized?

The English Debate

Was World War I a war of liberals against authoritarians?

CLI: Get information Ubuntu releases

Have the tides ever turned twice on any open problem?

Single word to change groups

Which partition to make active?

Weird lines in Microsoft Word

Homology of the fiber

Do people actually use the word "kaputt" in conversation?

Writing in a Christian voice

What are the rules for concealing thieves' tools (or items in general)?

Help with identifying unique aircraft over NE Pennsylvania

Can other pieces capture a threatening piece and prevent a checkmate?

How do researchers send unsolicited emails asking for feedback on their works?

Why are there no stars visible in cislunar space?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Exposing a company lying about themselves in a tightly knit industry: Is my career at risk on the long run?

PTIJ: Why do we make a Lulav holder?

How to read string as hex number in bash?

Should a narrator ever describe things based on a characters view instead of fact?

How old is Nick Fury?

What favor did Moody owe Dumbledore?



Magento2 - Custom Product Type Pricing


How to add a new product type in Magento 2? (MageStackDay mystery question 1)Checking Configurable-Child product price types (fixed or percent)How to add custom column of custom table field or module to sales order admin grid in magento2?Extending the complexType named “imageType” with a custom image typeMagento2 prevent reindex after adding product programmaticallyHow to introduce a new type for widget parameter in Magento2?How does the grouped product module display the linked position attribute?Magento 2 configurable product on product list, prices all changeAdd to cart configurable product programatically magento2How to set custom discount on totals of product(type=bundle) price in cart. Magento 2Magento 2.2.3 - Remove price from select field on product page













1















I am working on a custom product type for a Magento2 build that I am working on. I have followed the guide linked below and it has served as a brilliant base for me to work from.



How to add a new product type in Magento 2? (MageStackDay mystery question 1)



I am however having trouble in getting the price field show for my custom product type in the admin panel when adding/editing the custom product type and I can not see why, please see image below:



enter image description here



I think I may missed a price layout/model some where that adds the price field in but can not seem to track down where or what I have missed.



Any help/guidance would be greatly appreciated.










share|improve this question
























  • Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

    – Matthéo Geoffray
    Feb 3 '16 at 16:55















1















I am working on a custom product type for a Magento2 build that I am working on. I have followed the guide linked below and it has served as a brilliant base for me to work from.



How to add a new product type in Magento 2? (MageStackDay mystery question 1)



I am however having trouble in getting the price field show for my custom product type in the admin panel when adding/editing the custom product type and I can not see why, please see image below:



enter image description here



I think I may missed a price layout/model some where that adds the price field in but can not seem to track down where or what I have missed.



Any help/guidance would be greatly appreciated.










share|improve this question
























  • Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

    – Matthéo Geoffray
    Feb 3 '16 at 16:55













1












1








1


1






I am working on a custom product type for a Magento2 build that I am working on. I have followed the guide linked below and it has served as a brilliant base for me to work from.



How to add a new product type in Magento 2? (MageStackDay mystery question 1)



I am however having trouble in getting the price field show for my custom product type in the admin panel when adding/editing the custom product type and I can not see why, please see image below:



enter image description here



I think I may missed a price layout/model some where that adds the price field in but can not seem to track down where or what I have missed.



Any help/guidance would be greatly appreciated.










share|improve this question
















I am working on a custom product type for a Magento2 build that I am working on. I have followed the guide linked below and it has served as a brilliant base for me to work from.



How to add a new product type in Magento 2? (MageStackDay mystery question 1)



I am however having trouble in getting the price field show for my custom product type in the admin panel when adding/editing the custom product type and I can not see why, please see image below:



enter image description here



I think I may missed a price layout/model some where that adds the price field in but can not seem to track down where or what I have missed.



Any help/guidance would be greatly appreciated.







magento2 php






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:55









Community

1




1










asked Feb 3 '16 at 16:37









BaberBaber

679




679












  • Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

    – Matthéo Geoffray
    Feb 3 '16 at 16:55

















  • Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

    – Matthéo Geoffray
    Feb 3 '16 at 16:55
















Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

– Matthéo Geoffray
Feb 3 '16 at 16:55





Can you give us some codes / examples that you have tried before to give us a lead to help you ? Thank you.

– Matthéo Geoffray
Feb 3 '16 at 16:55










2 Answers
2






active

oldest

votes


















2














Looks like you do not add you type to list of applicable in price attribute. Add it in install data script:



<?php
namespace SuperLLCSuperTypeSetup;

use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory;
use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface

/**
* EAV setup factory
*
* @var EavSetupFactory
*/
private $eavSetupFactory;

/**
* Init
*
* @param EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)

$this->eavSetupFactory = $eavSetupFactory;


/**
* @inheritdoc
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$fieldList = [
'price',
'special_from_date',
'special_to_date',
'cost',
'tier_price',
'weight',
];
$newType = 'super_type';
foreach ($fieldList as $field)
$applyTo = explode(
',',
$eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
);
if (!in_array($newType, $applyTo))
$applyTo[] = $newType';
$eavSetup->updateAttribute(
MagentoCatalogModelProduct::ENTITY,
$field,
'apply_to',
implode(',', $applyTo)
);









share|improve this answer

























  • Thank you, I will try that out today and see where I get to with it.

    – Baber
    Feb 4 '16 at 9:13











  • Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

    – Baber
    Feb 4 '16 at 12:31



















0














Not working for me. Find below My Code:



  1. /etc/product_types.xml





Abc/Framer/Model/Product/Type/Framerprod.php




}





use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory;
use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;



/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface

/**
* EAV setup factory
*
* @var EavSetupFactory
*/
private $eavSetupFactory;



/**
* Init
*
* @param EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)

$this->eavSetupFactory = $eavSetupFactory;


/**
* @inheritdoc
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$fieldList = [
'price',
'special_from_date',
'special_to_date',
'cost',
'tier_price',
'weight',
];
$newType = 'framerprod';
foreach ($fieldList as $field)
$applyTo = explode(
',',
$eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
);
if (!in_array($newType, $applyTo))
$applyTo[] = $newType;
$eavSetup->updateAttribute(
MagentoCatalogModelProduct::ENTITY,
$field,
'apply_to',
implode(',', $applyTo)
);










share|improve this answer








New contributor




Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100239%2fmagento2-custom-product-type-pricing%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Looks like you do not add you type to list of applicable in price attribute. Add it in install data script:



    <?php
    namespace SuperLLCSuperTypeSetup;

    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    /**
    * @codeCoverageIgnore
    */
    class InstallData implements InstallDataInterface

    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $eavSetupFactory;

    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)

    $this->eavSetupFactory = $eavSetupFactory;


    /**
    * @inheritdoc
    */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $fieldList = [
    'price',
    'special_from_date',
    'special_to_date',
    'cost',
    'tier_price',
    'weight',
    ];
    $newType = 'super_type';
    foreach ($fieldList as $field)
    $applyTo = explode(
    ',',
    $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
    );
    if (!in_array($newType, $applyTo))
    $applyTo[] = $newType';
    $eavSetup->updateAttribute(
    MagentoCatalogModelProduct::ENTITY,
    $field,
    'apply_to',
    implode(',', $applyTo)
    );









    share|improve this answer

























    • Thank you, I will try that out today and see where I get to with it.

      – Baber
      Feb 4 '16 at 9:13











    • Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

      – Baber
      Feb 4 '16 at 12:31
















    2














    Looks like you do not add you type to list of applicable in price attribute. Add it in install data script:



    <?php
    namespace SuperLLCSuperTypeSetup;

    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    /**
    * @codeCoverageIgnore
    */
    class InstallData implements InstallDataInterface

    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $eavSetupFactory;

    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)

    $this->eavSetupFactory = $eavSetupFactory;


    /**
    * @inheritdoc
    */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $fieldList = [
    'price',
    'special_from_date',
    'special_to_date',
    'cost',
    'tier_price',
    'weight',
    ];
    $newType = 'super_type';
    foreach ($fieldList as $field)
    $applyTo = explode(
    ',',
    $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
    );
    if (!in_array($newType, $applyTo))
    $applyTo[] = $newType';
    $eavSetup->updateAttribute(
    MagentoCatalogModelProduct::ENTITY,
    $field,
    'apply_to',
    implode(',', $applyTo)
    );









    share|improve this answer

























    • Thank you, I will try that out today and see where I get to with it.

      – Baber
      Feb 4 '16 at 9:13











    • Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

      – Baber
      Feb 4 '16 at 12:31














    2












    2








    2







    Looks like you do not add you type to list of applicable in price attribute. Add it in install data script:



    <?php
    namespace SuperLLCSuperTypeSetup;

    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    /**
    * @codeCoverageIgnore
    */
    class InstallData implements InstallDataInterface

    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $eavSetupFactory;

    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)

    $this->eavSetupFactory = $eavSetupFactory;


    /**
    * @inheritdoc
    */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $fieldList = [
    'price',
    'special_from_date',
    'special_to_date',
    'cost',
    'tier_price',
    'weight',
    ];
    $newType = 'super_type';
    foreach ($fieldList as $field)
    $applyTo = explode(
    ',',
    $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
    );
    if (!in_array($newType, $applyTo))
    $applyTo[] = $newType';
    $eavSetup->updateAttribute(
    MagentoCatalogModelProduct::ENTITY,
    $field,
    'apply_to',
    implode(',', $applyTo)
    );









    share|improve this answer















    Looks like you do not add you type to list of applicable in price attribute. Add it in install data script:



    <?php
    namespace SuperLLCSuperTypeSetup;

    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    /**
    * @codeCoverageIgnore
    */
    class InstallData implements InstallDataInterface

    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $eavSetupFactory;

    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)

    $this->eavSetupFactory = $eavSetupFactory;


    /**
    * @inheritdoc
    */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $fieldList = [
    'price',
    'special_from_date',
    'special_to_date',
    'cost',
    'tier_price',
    'weight',
    ];
    $newType = 'super_type';
    foreach ($fieldList as $field)
    $applyTo = explode(
    ',',
    $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
    );
    if (!in_array($newType, $applyTo))
    $applyTo[] = $newType';
    $eavSetup->updateAttribute(
    MagentoCatalogModelProduct::ENTITY,
    $field,
    'apply_to',
    implode(',', $applyTo)
    );










    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 3 '16 at 21:16









    Arkadii Chyzhov

    2,438714




    2,438714










    answered Feb 3 '16 at 19:09









    KAndyKAndy

    16k23145




    16k23145












    • Thank you, I will try that out today and see where I get to with it.

      – Baber
      Feb 4 '16 at 9:13











    • Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

      – Baber
      Feb 4 '16 at 12:31


















    • Thank you, I will try that out today and see where I get to with it.

      – Baber
      Feb 4 '16 at 9:13











    • Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

      – Baber
      Feb 4 '16 at 12:31

















    Thank you, I will try that out today and see where I get to with it.

    – Baber
    Feb 4 '16 at 9:13





    Thank you, I will try that out today and see where I get to with it.

    – Baber
    Feb 4 '16 at 9:13













    Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

    – Baber
    Feb 4 '16 at 12:31






    Fantastic! More than enough for me to work with. I added the install script and updated field-list and type to what I needed and it worked :). I followed up its behaviour and I understand now why and what I was missing. For anyone that is having missing field issues, it is worth checking the "catalong_eav_aatribute" table, filter by "attribute_id" and check the field "apply_to" to make sure that your new product type is present in the comma separated field.

    – Baber
    Feb 4 '16 at 12:31














    0














    Not working for me. Find below My Code:



    1. /etc/product_types.xml





    Abc/Framer/Model/Product/Type/Framerprod.php




    }





    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;



    /**
    * @codeCoverageIgnore
    */
    class InstallData implements InstallDataInterface

    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $eavSetupFactory;



    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)

    $this->eavSetupFactory = $eavSetupFactory;


    /**
    * @inheritdoc
    */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    /** @var EavSetup $eavSetup */
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $fieldList = [
    'price',
    'special_from_date',
    'special_to_date',
    'cost',
    'tier_price',
    'weight',
    ];
    $newType = 'framerprod';
    foreach ($fieldList as $field)
    $applyTo = explode(
    ',',
    $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
    );
    if (!in_array($newType, $applyTo))
    $applyTo[] = $newType;
    $eavSetup->updateAttribute(
    MagentoCatalogModelProduct::ENTITY,
    $field,
    'apply_to',
    implode(',', $applyTo)
    );










    share|improve this answer








    New contributor




    Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
























      0














      Not working for me. Find below My Code:



      1. /etc/product_types.xml





      Abc/Framer/Model/Product/Type/Framerprod.php




      }





      use MagentoEavSetupEavSetup;
      use MagentoEavSetupEavSetupFactory;
      use MagentoFrameworkSetupInstallDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;



      /**
      * @codeCoverageIgnore
      */
      class InstallData implements InstallDataInterface

      /**
      * EAV setup factory
      *
      * @var EavSetupFactory
      */
      private $eavSetupFactory;



      /**
      * Init
      *
      * @param EavSetupFactory $eavSetupFactory
      */
      public function __construct(EavSetupFactory $eavSetupFactory)

      $this->eavSetupFactory = $eavSetupFactory;


      /**
      * @inheritdoc
      */
      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

      /** @var EavSetup $eavSetup */
      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
      $fieldList = [
      'price',
      'special_from_date',
      'special_to_date',
      'cost',
      'tier_price',
      'weight',
      ];
      $newType = 'framerprod';
      foreach ($fieldList as $field)
      $applyTo = explode(
      ',',
      $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
      );
      if (!in_array($newType, $applyTo))
      $applyTo[] = $newType;
      $eavSetup->updateAttribute(
      MagentoCatalogModelProduct::ENTITY,
      $field,
      'apply_to',
      implode(',', $applyTo)
      );










      share|improve this answer








      New contributor




      Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















        0












        0








        0







        Not working for me. Find below My Code:



        1. /etc/product_types.xml





        Abc/Framer/Model/Product/Type/Framerprod.php




        }





        use MagentoEavSetupEavSetup;
        use MagentoEavSetupEavSetupFactory;
        use MagentoFrameworkSetupInstallDataInterface;
        use MagentoFrameworkSetupModuleContextInterface;
        use MagentoFrameworkSetupModuleDataSetupInterface;



        /**
        * @codeCoverageIgnore
        */
        class InstallData implements InstallDataInterface

        /**
        * EAV setup factory
        *
        * @var EavSetupFactory
        */
        private $eavSetupFactory;



        /**
        * Init
        *
        * @param EavSetupFactory $eavSetupFactory
        */
        public function __construct(EavSetupFactory $eavSetupFactory)

        $this->eavSetupFactory = $eavSetupFactory;


        /**
        * @inheritdoc
        */
        public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $fieldList = [
        'price',
        'special_from_date',
        'special_to_date',
        'cost',
        'tier_price',
        'weight',
        ];
        $newType = 'framerprod';
        foreach ($fieldList as $field)
        $applyTo = explode(
        ',',
        $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
        );
        if (!in_array($newType, $applyTo))
        $applyTo[] = $newType;
        $eavSetup->updateAttribute(
        MagentoCatalogModelProduct::ENTITY,
        $field,
        'apply_to',
        implode(',', $applyTo)
        );










        share|improve this answer








        New contributor




        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        Not working for me. Find below My Code:



        1. /etc/product_types.xml





        Abc/Framer/Model/Product/Type/Framerprod.php




        }





        use MagentoEavSetupEavSetup;
        use MagentoEavSetupEavSetupFactory;
        use MagentoFrameworkSetupInstallDataInterface;
        use MagentoFrameworkSetupModuleContextInterface;
        use MagentoFrameworkSetupModuleDataSetupInterface;



        /**
        * @codeCoverageIgnore
        */
        class InstallData implements InstallDataInterface

        /**
        * EAV setup factory
        *
        * @var EavSetupFactory
        */
        private $eavSetupFactory;



        /**
        * Init
        *
        * @param EavSetupFactory $eavSetupFactory
        */
        public function __construct(EavSetupFactory $eavSetupFactory)

        $this->eavSetupFactory = $eavSetupFactory;


        /**
        * @inheritdoc
        */
        public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $fieldList = [
        'price',
        'special_from_date',
        'special_to_date',
        'cost',
        'tier_price',
        'weight',
        ];
        $newType = 'framerprod';
        foreach ($fieldList as $field)
        $applyTo = explode(
        ',',
        $eavSetup->getAttribute(MagentoCatalogModelProduct::ENTITY, $field, 'apply_to')
        );
        if (!in_array($newType, $applyTo))
        $applyTo[] = $newType;
        $eavSetup->updateAttribute(
        MagentoCatalogModelProduct::ENTITY,
        $field,
        'apply_to',
        implode(',', $applyTo)
        );











        share|improve this answer








        New contributor




        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 10 mins ago









        Vishal BansalVishal Bansal

        13




        13




        New contributor




        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Vishal Bansal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100239%2fmagento2-custom-product-type-pricing%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

            Fil:Tokke komm.svg

            Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?