Plugin Directory

Changeset 3190108


Ignore:
Timestamp:
11/16/2024 10:05:22 AM (17 months ago)
Author:
api2cartdev
Message:

Fix bug

Location:
api2cart-webhook-helper/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • api2cart-webhook-helper/trunk/app/WH_Helper.php

    r3022575 r3190108  
    226226  }
    227227
    228   function insertChild($id, $product) {
    229     do_action('a2c_wh_variant_created_action', ['store_id' => $this->_blogId, 'id' => $id, 'parent_id' => $product->get_data()['parent_id']]);
    230   }
    231 
    232   function updateChild($id, $product) {
    233     do_action('a2c_wh_variant_updated_action', ['store_id' => $this->_blogId, 'id' => $id, 'parent_id' => $product->get_data()['parent_id']]);
     228  function insertChild($id, $variant = null) {
     229    if ($variant == null) {
     230      $variant = new WC_Product_Variation( $id );
     231    }
     232
     233    do_action('a2c_wh_variant_created_action', ['store_id' => $this->_blogId, 'id' => $id, 'parent_id' => $variant->get_data()['parent_id']]);
     234  }
     235
     236  function updateChild($id, $variant = null) {
     237    if ($variant == null) {
     238      $variant = new WC_Product_Variation( $id );
     239    }
     240
     241    do_action('a2c_wh_variant_updated_action', ['store_id' => $this->_blogId, 'id' => $id, 'parent_id' => $variant->get_data()['parent_id']]);
    234242  }
    235243
  • api2cart-webhook-helper/trunk/readme.txt

    r3186533 r3190108  
    55Requires at least: 4.1
    66Tested up to: 6.7
    7 Stable tag: 1.7
     7Stable tag: 1.7.1
    88License:      GPL2
    99License URI:  https://www.gnu.org/licenses/gpl-2.0.html
     
    4848
    4949== Changelog ==
     50= 1.7.1 =
     51* Fix bugs
     52
    5053= 1.7 =
    5154* Added webhooks 'Category Created, Category Updated, Category Deleted'
Note: See TracChangeset for help on using the changeset viewer.