Plugin Directory

Changeset 3017317


Ignore:
Timestamp:
01/04/2024 08:39:45 AM (2 years ago)
Author:
setaryapp
Message:

Update to version 1.11.0 from GitHub

Location:
setary
Files:
2 added
2 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • setary/tags/1.11.0/inc/bootstrap.php

    r2940762 r3017317  
    5050        'media_list'      => __NAMESPACE__ . '\\Media_List',
    5151        'meta_attributes' => __NAMESPACE__ . '\\MetaAttributes',
    52         'save_by_field'   => __NAMESPACE__ . '\\SaveByField',
     52        'product_tools'   => __NAMESPACE__ . '\\ProductTools',
    5353        'batch'           => __NAMESPACE__ . '\\Batch',
    5454        // https://setary.wp.loc/wp-json/wc/setary/info/.
  • setary/tags/1.11.0/inc/class-product-controller.php

    r3003697 r3017317  
    148148     */
    149149    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   
    150154        // Change variation to product, or product to variation.
    151         if ( ! empty( $request['product_type'] ) ) {
     155        if ( ! $creating && ! empty( $request['product_type'] ) ) {
    152156            $product = $this->change_type( $product, $request['product_type'] );
    153157        }
     
    438442        }
    439443
    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;
    441449    }
    442450}
  • setary/tags/1.11.0/setary.php

    r3003697 r3017317  
    4848    include_once __DIR__ . '/inc/class-media-list.php';
    4949    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';
    5151    include_once __DIR__ . '/inc/class-info.php';
    5252    include_once __DIR__ . '/inc/class-batch.php';
  • setary/trunk/inc/bootstrap.php

    r2940762 r3017317  
    5050        'media_list'      => __NAMESPACE__ . '\\Media_List',
    5151        'meta_attributes' => __NAMESPACE__ . '\\MetaAttributes',
    52         'save_by_field'   => __NAMESPACE__ . '\\SaveByField',
     52        'product_tools'   => __NAMESPACE__ . '\\ProductTools',
    5353        'batch'           => __NAMESPACE__ . '\\Batch',
    5454        // https://setary.wp.loc/wp-json/wc/setary/info/.
  • setary/trunk/inc/class-product-controller.php

    r3003697 r3017317  
    148148     */
    149149    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   
    150154        // Change variation to product, or product to variation.
    151         if ( ! empty( $request['product_type'] ) ) {
     155        if ( ! $creating && ! empty( $request['product_type'] ) ) {
    152156            $product = $this->change_type( $product, $request['product_type'] );
    153157        }
     
    438442        }
    439443
    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;
    441449    }
    442450}
  • setary/trunk/setary.php

    r3003697 r3017317  
    4848    include_once __DIR__ . '/inc/class-media-list.php';
    4949    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';
    5151    include_once __DIR__ . '/inc/class-info.php';
    5252    include_once __DIR__ . '/inc/class-batch.php';
Note: See TracChangeset for help on using the changeset viewer.