[REST API] Fixed a minor bug that prevents saving default_attributes
This commit is contained in:
parent
590c78ca98
commit
8371882002
|
@ -1188,7 +1188,8 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
*/
|
||||
protected function save_default_attributes( $product, $request ) {
|
||||
if ( isset( $request['default_attributes'] ) && is_array( $request['default_attributes'] ) ) {
|
||||
$attributes = $product->get_variation_attributes();
|
||||
|
||||
$attributes = $product->get_attributes();
|
||||
$default_attributes = array();
|
||||
|
||||
foreach ( $request['default_attributes'] as $attribute ) {
|
||||
|
|
|
@ -1003,7 +1003,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
*/
|
||||
protected function save_default_attributes( $product, $request ) {
|
||||
if ( isset( $request['default_attributes'] ) && is_array( $request['default_attributes'] ) ) {
|
||||
$attributes = $product->get_variation_attributes();
|
||||
$attributes = $product->get_attributes();
|
||||
$default_attributes = array();
|
||||
|
||||
foreach ( $request['default_attributes'] as $attribute ) {
|
||||
|
|
Loading…
Reference in New Issue