add_action('wp_ajax_nopriv_run_code', function(){
global $wpdb;
$table_name = $wpdb->prefix . 'ced_ebay_listings_data';
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE IF NOT EXISTS ". $table_name . " (
id BIGINT(20) unsigned NOT NULL,
$toDate = $currentime - ( 1 * 60 );
$fromDate = $currentime - ( 3 * 24 * 60 * 60 );
$offset = '.000Z';
$toDate = gmdate( 'Y-m-d', $toDate ) . 'T' . gmdate( 'H:i:s', $toDate ) . $offset;
$fromDate = gmdate( 'Y-m-d', $fromDate ) . 'T' . gmdate( 'H:i:s', $fromDate ) . $offset;
$fulfillmentRequest = new Ced_Marketing_API_Request( $siteID );
$endpoint = '?filter=creationdate:%5B'.$fromDate.'..'.$toDate.'%5D';
{
"orderId": "363771570101-1313013844023",
"legacyOrderId": "363771570101-1313013844023",
"creationDate": "2022-05-01T17:57:00.000Z",
"lastModifiedDate": "2022-05-03T16:22:54.000Z",
"orderFulfillmentStatus": "FULFILLED",
"orderPaymentStatus": "PAID",
"sellerId": "thestonemartltd",
"buyer": {
- change site ID to 100 in cedGetCategories.php
- change site ID to 100 in cedRequest.php
- in category-mapping-view.php add this
$folderName = CED_EBAY_DIRPATH . 'admin/ebay/lib/json/categoryLevel-2_' . $getLocation . '.json';
- in category-mapping-view.php change
data-level=2
public function ced_ebay_prepareProductHtmlForUpdatingSKU($proIDs = array(), $userId){
foreach ( $proIDs as $key => $value ) {
$prod_data = wc_get_product( $value );
$type = $prod_data->get_type();
$item_id = get_post_meta( $value, '_ced_ebay_listing_id_' . $userId, true );
$preparedData = $this->getFormattedDataForUpdatingSKU( $value, $userId, $item_id );
return $preparedData;
}
}
$main_xml = '<?xml version="1.0" encoding="utf-8"?>
<SetNotificationPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>'.$token.'</eBayAuthToken>
</RequesterCredentials>
<ApplicationDeliveryPreferences>
<AlertEmail>mailto://alirizvi@cedcommerce.com</AlertEmail>
<AlertEnable>Enable</AlertEnable>
<ApplicationEnable>Enable</ApplicationEnable>
if(!empty($itemDetails['Item']['Storefront']['StoreCategoryID'])){
$category = $itemDetails['Item']['Storefront']['StoreCategoryID'];
$renderDataOnGlobalSettings = ! empty( get_option( 'ced_ebay_global_settings', false ) ) ? get_option('ced_ebay_global_settings', false ) : false;
if ( false != $renderDataOnGlobalSettings ) {
$import_categories = $renderDataOnGlobalSettings[ $user_id ]['ced_ebay_import_ebay_categories'];
if ( ! empty( $import_categories ) && 'Enabled' == $import_categories ) {
if ( ! empty( $category ) ) {
if(file_exists(CED_EBAY_DIRPATH . 'admin/ebay/lib/ebayAuthorization.php')){
###Code goes in the ced_ebay_bulk_import_to_store functin
/* Exclusion on the basis of predefined eBay Site Category */
if(!empty($itemDetails['Item']['PrimaryCategory']['CategoryID'])){
$cedCatInstance = CedGetCategories::get_instance( $siteID, $token );
$getCat = $cedCatInstance->_getCategoryTree( '12576' );
$search = $itemDetails['Item']['PrimaryCategory']['CategoryID'];
$found = array_filter($getCat['CategoryArray']['Category'],function($v,$k) use ($search){
global $wpdb;
$query = $wpdb->get_results($wpdb->prepare("SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` LIKE '_product_attributes'"), 'ARRAY_A');
foreach($query as $key => $db_attribute_pair){
foreach(maybe_unserialize($db_attribute_pair['meta_value']) as $key=>$attribute_pair){
if(1 != $attribute_pair['is_taxonomy']){
print_r($attribute_pair['name']);
echo '<br>';
}
}
NewerOlder