Skip to main content
edited body
Source Link
BAF
  • 719
  • 1
  • 9
  • 23

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Another option is to import a multi store CSV using Magento 2 import functionality - this is best if you're not familiar with Magento/PHP development:

Here is an article about it:

https://www.alexcorradi.org/blog/a-guide-on-how-to-import-export-products-in-magento-2

Otherwise if you have a test environment and are more confident with coding you can create your own script to update:

Inside a class you'd have:

protected $action;

public function __construct(\Magento\Catalog\Model\Product\Action $productAction) {
   $this->action = $productAction;
}

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = '';null; //or null,OR '' can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Another option is to import a multi store CSV using Magento 2 import functionality - this is best if you're not familiar with Magento/PHP development:

Here is an article about it:

https://www.alexcorradi.org/blog/a-guide-on-how-to-import-export-products-in-magento-2

Otherwise if you have a test environment and are more confident with coding you can create your own script to update:

Inside a class you'd have:

protected $action;

public function __construct(\Magento\Catalog\Model\Product\Action $productAction) {
   $this->action = $productAction;
}

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Another option is to import a multi store CSV using Magento 2 import functionality - this is best if you're not familiar with Magento/PHP development:

Here is an article about it:

https://www.alexcorradi.org/blog/a-guide-on-how-to-import-export-products-in-magento-2

Otherwise if you have a test environment and are more confident with coding you can create your own script to update:

Inside a class you'd have:

protected $action;

public function __construct(\Magento\Catalog\Model\Product\Action $productAction) {
   $this->action = $productAction;
}

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = null; // OR '' can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

added 2 characters in body
Source Link
BAF
  • 719
  • 1
  • 9
  • 23

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Another option is to import a multi store CSV using Magento 2 import functionality - this is best if you're not familiar with Magento/PHP development:

Here is an article about it:

https://www.alexcorradi.org/blog/a-guide-on-how-to-import-export-products-in-magento-2

Otherwise if you have a test environment and are more confident with coding you can create your own script to update a lot quicker:

Inside a class you'd have: protected $action; public function __construct(\Magento\Catalog\Model\Product\Action $productAction) { $this->action = $productAction; }

protected $action;

public function __construct(\Magento\Catalog\Model\Product\Action $productAction) {
   $this->action = $productAction;
}

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Otherwise if you have a test environment and are more confident with coding you can create your own script to update a lot quicker:

Inside a class you'd have: protected $action; public function __construct(\Magento\Catalog\Model\Product\Action $productAction) { $this->action = $productAction; }

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Another option is to import a multi store CSV using Magento 2 import functionality - this is best if you're not familiar with Magento/PHP development:

Here is an article about it:

https://www.alexcorradi.org/blog/a-guide-on-how-to-import-export-products-in-magento-2

Otherwise if you have a test environment and are more confident with coding you can create your own script to update:

Inside a class you'd have:

protected $action;

public function __construct(\Magento\Catalog\Model\Product\Action $productAction) {
   $this->action = $productAction;
}

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

added 2 characters in body
Source Link
BAF
  • 719
  • 1
  • 9
  • 23

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Otherwise if you have a test environment and are more confident with coding you can create your own script to update a lot quicker:

Inside a class you'd have: protected $action; public function __construct(\Magento\Catalog\Model\Product\Action $productAction) { $this->action = $productAction; }

public function updatePrice($productId$productIds, $storeId$data, $data$storeId) {
    $this->action->updateAttributes($productId$productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Otherwise if you have a test environment and are more confident with coding you can create your own script to update a lot quicker:

Inside a class you'd have: protected $action; public function __construct(\Magento\Catalog\Model\Product\Action $productAction) { $this->action = $productAction; }

public function updatePrice($productId, $storeId, $data) {
    $this->action->updateAttributes($productId, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Price is set at simple product level in Magento 2 (and configurable products will inherit the special price from simple products beneath it).

The quickest way to do it correctly would be to use the REST API inside a script. This is the best way if you're a beginner - Magento has created this as an interface for external integration which should be used wherever possible.

http://devdocs.magento.com/swagger/index_20.html#!/catalogProductRepositoryV1

The correct endpoint is catalogProductRepository's PUT /V1/products/{sku} -

Note that you need to put the storeview code into the calling URL as described here.

http://devdocs.magento.com/guides/v2.0/rest/rest_endpoints.html

Here is a good post on using a script with the REST API

GET or SET Product special price using REST API

Otherwise if you have a test environment and are more confident with coding you can create your own script to update a lot quicker:

Inside a class you'd have: protected $action; public function __construct(\Magento\Catalog\Model\Product\Action $productAction) { $this->action = $productAction; }

public function updatePrice($productIds, $data, $storeId) {
    $this->action->updateAttributes($productIds, $data, $storeId);
}

then to run it use the following;

 $specialPrice = ''; //or null, can't remember off the top of my head which clears it - perhaps either.

 $data = ['special_price' => $specialPrice];
 $storeId = 1; //whatever store id you like
 $productIds = [1,2,3,4,5,6,7]; //whatever product ids you wish to change.

 $this->updatePrice($productIds, $data, $storeId);

run for each store.

Apologies for any mistakes, I am just typing by memory. Please run on a test environment first!

Source Link
BAF
  • 719
  • 1
  • 9
  • 23
Loading