Changeset 3017317
- Timestamp:
- 01/04/2024 08:39:45 AM (2 years ago)
- Location:
- setary
- Files:
-
- 2 added
- 2 deleted
- 6 edited
- 1 copied
-
tags/1.11.0 (copied) (copied from setary/trunk)
-
tags/1.11.0/inc/bootstrap.php (modified) (1 diff)
-
tags/1.11.0/inc/class-product-controller.php (modified) (2 diffs)
-
tags/1.11.0/inc/class-product-tools.php (added)
-
tags/1.11.0/inc/class-save-by-field.php (deleted)
-
tags/1.11.0/setary.php (modified) (1 diff)
-
trunk/inc/bootstrap.php (modified) (1 diff)
-
trunk/inc/class-product-controller.php (modified) (2 diffs)
-
trunk/inc/class-product-tools.php (added)
-
trunk/inc/class-save-by-field.php (deleted)
-
trunk/setary.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
setary/tags/1.11.0/inc/bootstrap.php
r2940762 r3017317 50 50 'media_list' => __NAMESPACE__ . '\\Media_List', 51 51 'meta_attributes' => __NAMESPACE__ . '\\MetaAttributes', 52 ' save_by_field' => __NAMESPACE__ . '\\SaveByField',52 'product_tools' => __NAMESPACE__ . '\\ProductTools', 53 53 'batch' => __NAMESPACE__ . '\\Batch', 54 54 // https://setary.wp.loc/wp-json/wc/setary/info/. -
setary/tags/1.11.0/inc/class-product-controller.php
r3003697 r3017317 148 148 */ 149 149 public function pre_insert_product_object( $product, $request, $creating ) { 150 if ( ! empty( $request['type'] ) && empty( $request['product_type'] ) ) { 151 $request['product_type'] = $request['type']; 152 } 153 150 154 // Change variation to product, or product to variation. 151 if ( ! empty( $request['product_type'] ) ) {155 if ( ! $creating && ! empty( $request['product_type'] ) ) { 152 156 $product = $this->change_type( $product, $request['product_type'] ); 153 157 } … … 438 442 } 439 443 440 return new $classname( $product->get_id() ); 444 $changes = $product->get_changes(); 445 $productClass = new $classname( $product->get_id() ); 446 $productClass->set_props( $changes ); 447 448 return $productClass; 441 449 } 442 450 } -
setary/tags/1.11.0/setary.php
r3003697 r3017317 48 48 include_once __DIR__ . '/inc/class-media-list.php'; 49 49 include_once __DIR__ . '/inc/class-meta-attributes.php'; 50 include_once __DIR__ . '/inc/class- save-by-field.php';50 include_once __DIR__ . '/inc/class-product-tools.php'; 51 51 include_once __DIR__ . '/inc/class-info.php'; 52 52 include_once __DIR__ . '/inc/class-batch.php'; -
setary/trunk/inc/bootstrap.php
r2940762 r3017317 50 50 'media_list' => __NAMESPACE__ . '\\Media_List', 51 51 'meta_attributes' => __NAMESPACE__ . '\\MetaAttributes', 52 ' save_by_field' => __NAMESPACE__ . '\\SaveByField',52 'product_tools' => __NAMESPACE__ . '\\ProductTools', 53 53 'batch' => __NAMESPACE__ . '\\Batch', 54 54 // https://setary.wp.loc/wp-json/wc/setary/info/. -
setary/trunk/inc/class-product-controller.php
r3003697 r3017317 148 148 */ 149 149 public function pre_insert_product_object( $product, $request, $creating ) { 150 if ( ! empty( $request['type'] ) && empty( $request['product_type'] ) ) { 151 $request['product_type'] = $request['type']; 152 } 153 150 154 // Change variation to product, or product to variation. 151 if ( ! empty( $request['product_type'] ) ) {155 if ( ! $creating && ! empty( $request['product_type'] ) ) { 152 156 $product = $this->change_type( $product, $request['product_type'] ); 153 157 } … … 438 442 } 439 443 440 return new $classname( $product->get_id() ); 444 $changes = $product->get_changes(); 445 $productClass = new $classname( $product->get_id() ); 446 $productClass->set_props( $changes ); 447 448 return $productClass; 441 449 } 442 450 } -
setary/trunk/setary.php
r3003697 r3017317 48 48 include_once __DIR__ . '/inc/class-media-list.php'; 49 49 include_once __DIR__ . '/inc/class-meta-attributes.php'; 50 include_once __DIR__ . '/inc/class- save-by-field.php';50 include_once __DIR__ . '/inc/class-product-tools.php'; 51 51 include_once __DIR__ . '/inc/class-info.php'; 52 52 include_once __DIR__ . '/inc/class-batch.php';
Note: See TracChangeset
for help on using the changeset viewer.