0

I want to add a new field in magento2 tier price. This field will contain another price. So that when we add percentage in tier price then percenatage of this custom price should be taken, not the base price. Please tell me how can I achieve this.

Thank you

3 Answers 3

1

The right aproch is to create a new custom module. Preference, extends, plugin this model as you prefer \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AdvancedPricing::getTierPriceStructure inserting your custom new field.

After that please create new custom table with db_schema.xml. Than create a plugin after product save which handle the product save and customize this model (with Preference, extends, plugin) \Magento\Catalog\Model\Product\Attribute\Backend\TierPrice\SaveHandler for retrive the custom value.

Cheers

1

Sharing the custom module that I have created for the same. Solutions given online have a lot of issues. I have created a custom one.Values are getting saved in DB (Table - catalog_product_entity_tier_price)

Check if the solution works for you Please download it from here - https://github.com/rashigoyal14/rashigoyal14.git

Thanks, Rashi

1
  • 1
    this is very helpful !!!!
    – kishan
    Commented Jul 18 at 13:30
0

Hello Rashi I have check the module that you have upload and i would like to know if you can help me to change to it. Becuase I would like to add a new field in tierprice but not a string I would like to add a date field so to can save in each price and a date time value.

Thanks for your help!

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.