cancel
Showing results for 
Search instead for 
Did you mean: 

magento2 (Enterprise Edition version2.1.1) - how to add Special Price for product from date to date?

magento2 (Enterprise Edition version2.1.1) - how to add Special Price for product from date to date?

Hello Alan,

Thanks for providing a form to ask you questions.

As the title indicates, how to add Special Price for product from date to date programmatically?

I can set in admin but I want to use code to set multi-products.

I using EE version

I want to add Special Price for product from date to date programmatically by code but don't know how.. I can set in admin use

ee


then
EE

but I want use code to set programmatically. If anyone know, please advice.

1 REPLY

Re: magento2 (Enterprise Edition version2.1.1) - how to add Special Price for product from date to d

$_product->setCustomAttributes(array(
                'special_from_date' => "01/12/2016", 
                'special_to_date' => "11/12/2016", 
                'special_price' => 12, 
            )
        );        $_product->save();