elseif ( 'update_sku' == $operation ) {
$prodIDs = $product_id[0];
$already_uploaded = get_post_meta( $prodIDs, '_ced_ebay_listing_id_' . $user_id, true );
$product = wc_get_product($prodIDs);
$product_type = $product->get_type();
if('variable' == $product_type){
echo json_encode(
$fileCategory = CED_EBAY_DIRPATH . 'admin/ebay/lib/cedGetcategories.php';
if ( file_exists( $fileCategory ) ) {
require_once $fileCategory;
}
if(!empty($itemDetails['Item']['PrimaryCategory']['CategoryID'])){
$cedCatInstance = CedGetCategories::get_instance( $siteID, $token );
### class-ebay.php
public function prepareProductHtmlForUpdateStock( $proIDs = array(), $userId, $notAjax = false ) {
if ( ! is_array( $proIDs ) ) {
$proIDs = array( $proIDs );
}
$shop_data = ced_ebay_get_shop_data( $userId );
$user_id = 'nextdaykoi';
require_once CED_EBAY_DIRPATH . 'admin/ebay/lib/ebayUpload.php';
$shop_data = ced_ebay_get_shop_data( $user_id );
if ( ! empty( $shop_data ) ) {
$siteID = $shop_data['siteID'];
$token = $shop_data['token']['eBayAuthToken'];
$getLocation = $shop_data['Location'];
}
##category-mapping-view.php
<?php
// If this file is called directly, abort.
### settings-view.php code changes
if ( isset( $_POST['ced_ebay_setting_nonce'] ) && wp_verify_nonce( sanitize_text_field( $_POST['ced_ebay_setting_nonce'] ), 'ced_ebay_setting_page_nonce' ) ) {
if ( isset( $_POST['global_settings'] ) ) {
$settings = array();
$sanitized_array = filter_input_array( INPUT_POST, FILTER_SANITIZE_STRING );
$settings = get_option( 'ced_ebay_global_settings', array() );
$settings[ $user_id ] = isset( $sanitized_array['ced_ebay_global_settings'] ) ? ( $sanitized_array['ced_ebay_global_settings'] ) : array();
### Change the USER ID
add_action('wp_ajax_nopriv_ced_ebay_import_products_async_endpoint', array($this, 'ced_ebay_import_products_async_endpoint'));
add_action('ced_ebay_import_products_async_action', array($this, 'ced_ebay_import_products_async_method'));
public function ced_ebay_import_products_async_method($ebay_item){
if(!empty($ebay_item)){
$logger = wc_get_logger();
add_action('wp_ajax_ced_ebay_notification_endpoint', array($this, 'ced_ebay_notification_endpoint'));
add_action('wp_ajax_nopriv_ced_ebay_notification_endpoint', array($this, 'ced_ebay_notification_endpoint'));
add_action('ced_ebay_item_revised_async_action', array($this, 'ced_ebay_process_item_revised_notification'));
add_action('ced_ebay_item_listed_async_action', array($this, 'ced_ebay_process_item_listed_notification'));
add_action('ced_ebay_order_placed_notification_async_action', array($this, 'ced_ebay_process_order_placed_notification'));
### GETTING NOTIFICATION PREFERENCES
//refunded orders on eBay will be cancelled and refunded on woo as well along with order fulfillment from eBay to Woo.
add_action('wp_ajax_nopriv_ced_ebay_fetch_order_status_from_ebay', array($this, 'ced_ebay_fetch_order_status_from_ebay'));
public function ced_ebay_fetch_order_status_from_ebay(){