prefix.'posts'; /* Delete Products */ $delete_ptoduct = 'delete from '.$table_posts.' where post_type="item"'; $result = $wpdb->query($delete_ptoduct); $table_postmeta=$wpdb->prefix.'postmeta'; $delete_postmeta = 'delete from '.$table_postmeta.' where meta_key="_apptivo_featured" or meta_key="_apptivo_item_code" or meta_key="_apptivo_enabled" or meta_key="_apptivo_track_color" or meta_key="_apptivo_track_size" or meta_key="_apptivo_regular_price" or meta_key="_apptivo_sale_price" or meta_key="_apptivo_item_id" or meta_key="_apptivo_item_uom_id" or meta_key="_apptivo_item_manufactured_id" or meta_key="_apptivo_category_id" '; $result = $wpdb->query($delete_postmeta); /* Delete Categories */ $get_all_terms = get_terms( 'item_cat', 'orderby=count&hide_empty=0' ); foreach($get_all_terms as $terms) { wp_delete_term( $terms->term_id, 'item_cat' ); delete_post_meta($terms->term_id, '_apptivo_category_id'); } /* Delete Tags */ $get_all_terms = get_terms( 'item_tag', 'orderby=count&hide_empty=0' ); foreach($get_all_terms as $terms) { wp_delete_term( $terms->term_id, 'item_tag' ); } $apiKey = trim($_POST['apikey']); update_option('apptivo_ecommerce_apikey',$apiKey); echo 1000; die(); } /* Theme Templates*/ add_action('wp_ajax_apptivo_ecommerce_upload_theme_template','apptivo_ecommerce_upload_theme_template'); add_action('wp_ajax_nopriv_apptivo_ecommerce_upload_theme_template','apptivo_ecommerce_upload_theme_template'); function apptivo_ecommerce_upload_theme_template() { //Coped Products files $destination = TEMPLATEPATH.'/apptivo-ecommerce'; $eCommerce_css_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/assets/css/apptivo_ecommerce.css'; $eCommerce_archive_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/archive-product.php'; $eCommerce_taxonomy_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/product_taxonomy.php'; $eCommerce_taxonomy_tag_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/taxonomy-item_tag.php'; $eCommerce_single_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/single-product.php'; $eCommerce_products_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/loop-products.php'; $eCommerce_tags_file = APPTIVO_ECOMMERCE_PLUGIN_BASEPATH.'/templates/tags-products.php'; if(is_dir(TEMPLATEPATH.'/apptivo-ecommerce')){ $folder_name = TEMPLATEPATH.'/apptivo-ecommerce-'.strtotime("now"); copy_directory($destination, $folder_name); }else{ @mkdir( $destination ); } @mkdir( TEMPLATEPATH.'/apptivo-ecommerce/css' ); copy( $eCommerce_css_file, $destination.'/css/apptivo_ecommerce.css'); copy( $eCommerce_archive_file, $destination.'/archive-product.php'); copy( $eCommerce_taxonomy_file, $destination.'/product_taxonomy.php'); copy( $eCommerce_taxonomy_tag_file, $destination.'/taxonomy-item_tag.php'); copy( $eCommerce_single_file, $destination.'/single-product.php'); copy( $eCommerce_products_file, $destination.'/loop-products.php'); copy( $eCommerce_tags_file, $destination.'/tags-products.php'); //Copied Images $source_template_images = dirname(__FILE__).'/template_images'; $target_template_images = TEMPLATEPATH.'/apptivo-ecommerce/images'; copy_directory($source_template_images, $target_template_images); echo 1000; die(); } function copy_directory( $source, $destination ) { $i =0; if ( is_dir( $source ) ) { @mkdir( $destination ); $directory = dir( $source ); while ( FALSE !== ( $readdirectory = $directory->read() ) ) { if ( $readdirectory == '.' || $readdirectory == '..' ) { continue; } $PathDir = $source . '/' . $readdirectory; if ( is_dir( $PathDir ) ) { copy_directory( $PathDir, $destination . '/' . $readdirectory ); continue; } copy( $PathDir, $destination . '/' . $readdirectory ); } $directory->close(); }else { copy( $source, $destination ); } return '1000'; } /** * eCommerce Settings Page */ global $apptivo_ecommerce_settings; $business_api_key = get_option("apptivo_apikey"); $apptivo_ecommerce_settings['apptivo_ecommerce'] = array( array( 'name' => __( 'Genral', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ), array( 'name' => __( 'API Key', 'apptivo_ecommerce' ), 'desc' => 'Get an Apptivo API Key', 'id' => 'apptivo_ecommerce_apikey', 'std' => get_option("apptivo_apikey"), 'css' => 'width:500px;', 'type' => 'text' ), array( 'name' => __( 'Access Key', 'apptivo_ecommerce' ), 'desc' => '', 'id' => 'apptivo_ecommerce_accesskey', 'std' => (!empty($business_api_key))?get_option("apptivo_accesskey"):'', 'css' => 'width:500px;', 'type' => 'text' ), array( 'name' => __( 'Force SSL', 'apptivo_ecommerce' ), 'desc' => __( 'Force SSL on the checkout for added security (SSL certificate required).', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_force_ssl_checkout', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __( 'Error Message', 'apptivo_ecommerce' ), 'desc' => __( 'Enable single error message for form fields', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_single_error_message', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => __( 'Demo Store', 'apptivo_ecommerce' ), 'desc' => __( 'Enable the "Demo Store" notice on your site', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_demo_store', 'std' => 'no', 'type' => 'checkbox' ), array( 'type' => 'sectionend', 'id' => 'general_options'), array( 'name' => __( 'reCaptcha in Register Page', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'recaptcha_options' ), array( 'name' => 'Enable reCaptcha' , 'desc' => 'Create a reCAPTCHA key', 'id' => 'apptivo_ecommerce_recaptcha_mode', 'std' => 'no', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'width:185px;', 'desc_tip' => true, 'options' => array( 'yes' => 'Enabled', 'no' => 'Disabled' ) ), array( 'name' => __( 'reCaptcha - Public Key', 'apptivo_ecommerce' ), 'desc' => '', 'id' => 'apptivo_ecommerce_recaptcha_publickey', 'std' => '', 'css' => 'width:500px;', 'type' => 'text' ), array( 'name' => __( 'reCaptcha - Private Key', 'apptivo_ecommerce' ), 'desc' => '', 'id' => 'apptivo_ecommerce_recaptcha_privatekey', 'std' => '', 'css' => 'width:500px;', 'type' => 'text' ), array( 'name' => 'reCaptcha - Theme' , 'desc' => '', 'id' => 'apptivo_ecommerce_recaptcha_theme', 'std' => 'red', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'width:185px;', 'desc_tip' => true, 'options' => array( 'red' => 'Red', 'white' => 'White', 'blackglass' => 'Black Glass', 'clean' => 'Clean' ) ), array( 'name' => 'reCaptcha - Language' , 'desc' => '', 'id' => 'apptivo_ecommerce_recaptcha_language', 'std' => 'en', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'width:185px;', 'desc_tip' => true, 'options' => array( 'en' => 'English', 'nl' => 'Dutch', 'fr' => 'French', 'de' => 'German', 'pt' => 'Portuguese', 'ru' => 'Russian', 'es' => 'Spanish', 'tr' => 'Turkish', ) ), array( 'type' => 'sectionend', 'id' => 'general_options') ); // End general settings $apptivo_ecommerce_settings['apptivo_ecommerce_shopping_cart'] = array( array( 'name' => __( '', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'shopping_cart' ), array( 'name' => __( 'Enable Apply Coupon', 'apptivo_ecommerce' ), 'desc' => __( 'Enable apply coupon on your site', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_apply_coupan', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __( 'Enable Gift Note', 'apptivo_ecommerce' ), 'desc' => __( 'Enable gift note on your site', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_enable_gift', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __( 'Enable 2 steps', 'apptivo_ecommerce' ), 'desc' => __( 'Enable 2 steps for authorize.net checkout', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_enable_a_net_confirm', 'std' => 'yes', 'type' => 'checkbox' ), array( 'type' => 'sectionend', 'id' => 'general_options'), ); // End general settings $products_page_id = get_option('apptivo_ecommerce_products_page_id'); $base_slug = ($products_page_id > 0 && get_page( $products_page_id )) ? get_page_uri( $products_page_id ) : 'products'; $apptivo_ecommerce_settings['apptivo_ecommerce_products'] = array( array( 'type' => 'sectionend', 'id' => 'pricing_options' ), array( 'name' => __( 'Products Page', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'page_options' ), array( 'name' => __( 'Redirects To Cart Page', 'apptivo_ecommerce' ), 'desc' => __( 'Redirect to cart after adding a product to the cart (on products page)', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_redirects_to_cart', 'std' => 'yes', 'type' => 'checkbox' ), array( 'name' => 'Related Products', 'desc' => 'Show related products in your website', 'id' => 'apptivo_ecommerce_enable_related_products', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => 'Regular Price', 'desc' => 'Show regular price in your website', 'id' => 'apptivo_ecommerce_enable_regular_price', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => 'Item Code', 'desc' => 'Show item code in your website', 'id' => 'apptivo_ecommerce_enable_item_code', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => 'Products Sort by', 'desc' => 'Show products sort by options in your website', 'id' => 'apptivo_ecommerce_enable_sortby', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __( 'Products Base Page', 'apptivo_ecommerce' ), 'desc' => sprintf( __( 'This sets the base page of your products.', 'apptivo_ecommerce' ), '', '' ), 'id' => 'apptivo_ecommerce_products_page_id', 'css' => 'min-width:175px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => 'Products Sorting Type' , 'desc' => '', 'id' => 'apptivo_ecommerce_products_sorting_type', 'std' => '1', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'width:185px;', 'desc_tip' => true, 'options' => array( '1' => 'Price: Low to High', '2' => 'Price: High to Low', '6' => 'Name: A to Z', '7' => 'Name: Z to A' ) ), array( 'name' => __( 'PrettyPhoto Lightbox', 'apptivo_ecommerce' ), 'desc' => __( 'Enable jQuery PrettyPhoto lightbox in product description page', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_enable_lightbox', 'std' => 'no', 'type' => 'checkbox' ), array( 'name' => __( 'Products Per Page', 'apptivo_ecommerce' ), 'desc' => 'Number of products per page', 'id' => 'apptivo_ecommerce_products_per_page', 'std' => 8, 'css' => 'width:50px;', 'type' => 'text' ), array( 'name' => 'Products Pagination Type' , 'desc' => '', 'id' => 'apptivo_ecommerce_products_pagination_type', 'std' => '1', 'type' => 'select', 'class' => 'chosen_select', 'css' => 'width:185px;', 'desc_tip' => true, 'options' => array( '1' => 'Bottom', '2' => 'Top', '3' => 'Bottom & Top' ) ), array( 'name' => __( 'Base Page Title', 'apptivo_ecommerce' ), 'desc' => __( 'This title to show on the shop base page. Leave blank to use the page title.', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_products_page_title', 'type' => 'text', 'std' => 'All Products' // Default value for the page title - changed in settings ), array( 'type' => 'sectionend', 'id' => 'page_options'), array( 'name' => __( 'Products Image Settings', 'apptivo_ecommerce' ), 'type' => 'title','desc' => __('These settings affect the actual dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles.', 'apptivo_ecommerce'), 'id' => 'image_options' ), array( 'name' => __( 'Catalog Images', 'apptivo_ecommerce' ), 'desc' => __('Product listings image', 'apptivo_ecommerce'), 'id' => 'apptivo_ecommerce_catalog_image', 'css' => '', 'type' => 'image_width', 'std' => '150' ), array( 'name' => __( 'Single Product Image', 'apptivo_ecommerce' ), 'desc' => __('Product main image', 'apptivo_ecommerce'), 'id' => 'apptivo_ecommerce_single_image', 'css' => '', 'type' => 'image_width', 'std' => '300' ), array( 'name' => __( 'Product Thumbnails', 'apptivo_ecommerce' ), 'desc' => __('Product gallery image', 'apptivo_ecommerce'), 'id' => 'apptivo_ecommerce_thumbnail_image', 'css' => '', 'type' => 'image_width', 'std' => '90' ), array( 'type' => 'sectionend', 'id' => 'image_options' ), ); // End pages settings $apptivo_ecommerce_settings['apptivo_ecommerce_pages'] = array( array( 'type' => 'sectionend', 'id' => 'pricing_options' ), array( 'name' => __( 'eCommerce Products Template Settings', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'page_options' ), array( 'name' => __( 'Copy eCommerce Template To Your Current Theme', 'apptivo_ecommerce' ), 'desc' => 'Most suggested, if you dont have customized ecommerce theme or templates.', 'id' => 'apptivo_ecommerce_template_upload', 'css' => 'min-width:50px;', 'type' => 'template_upload', 'std' => '' ), array(), array( 'type' => 'sectionend', 'id' => 'pricing_options' ), array( 'name' => __( 'eCommerce Page Settings', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'page_options' ), array( 'name' => __( 'Terms and Conditions page', 'apptivo_ecommerce' ), 'tip' => '', 'id' => 'apptivo_ecommerce_terms_page_id', 'css' => 'min-width:50px;', 'std' => '', 'type' => 'single_select_page', 'args' => 'show_option_none=' . __('None', 'apptivo_ecommerce'), ), array( 'name' => __( 'Cart Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_cart]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_cart_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Checkout Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_checkout]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_checkout_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Secure Checkout Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_secure_checkout]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_secure_checkout_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __('Thanks Page', 'apptivo_ecommerce'), 'desc' => __( ' Shortcode : [apptivo_ecommerce_thankyou]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_thanks_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'My Account Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_my_account]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_myaccount_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Register Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_register]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_register_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Logout Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_logout]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_logout_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Login Page', 'apptivo_ecommerce' ), 'desc' => __( ' Shortcode : [apptivo_ecommerce_login]', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_login_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'type' => 'sectionend', 'id' => 'page_options'), ); // End pages settings $apptivo_ecommerce_settings['apptivo_ecommerce_print_receipt'] = array( array( 'type' => 'sectionend', 'id' => 'pricing_receipt' ), array( 'name' => __( '', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'page_options' ), array( 'name' => __('Print Receipt Page', 'apptivo_ecommerce'), 'id' => 'apptivo_ecommerce_print_receipt_page_id', 'css' => 'min-width:50px;', 'type' => 'single_select_page', 'std' => '' ), array( 'name' => __( 'Print Receipt Address', 'apptivo_ecommerce' ), 'desc' => '', 'id' => 'apptivo_ecommerce_print_receipt_address', 'std' => get_option('home').' Insert your address ', 'css' => 'width:500px;', 'type' => 'textarea', 'editor' => 'yes' ), array( 'name' => __( 'Print Receipt Logo', 'apptivo_ecommerce' ), 'desc' => __( 'Print receipt logo. ', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_print_receipt_logo', 'std' => '', 'css' => 'width:400px;', 'type' => 'text', 'upload' => 'yes' ), array( 'type' => 'sectionend', 'id' => 'print_receipt_end'), ); //Order Number Settings Start. $apptivo_ecommerce_settings['apptivo_ecommerce_order_number'] = array( array( 'name' => __( 'Order Number Settings', 'apptivo_ecommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'order_number' ), array( 'name' => __( 'Prefix', 'apptivo_ecommerce' ), 'desc' => __( 'Order Number Prefix ', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_ordernumber_prefix', 'std' => '', 'tab' => 'order_number', 'type' => 'text' ), array( 'name' => __( 'Starts With', 'apptivo_ecommerce' ), 'desc' => __( 'Order Number Starts with. ', 'apptivo_ecommerce' ), 'id' => 'apptivo_ecommerce_ordernumber_startswith', 'std' => '', 'tab' => 'order_number', 'type' => 'text' ), array( 'type' => 'sectionend', 'id' => 'order_number') ); //Order Number settings End. if(!function_exists('apptivo_ecommerce_syncs')){ function apptivo_ecommerce_syncs(){ global $wpdb; if($_POST['sync'] != 'Sync With Apptivo') { echo '
POST details";print_r($new_post); exit;
remove_action('apptivo_ecommerce_process_item_meta', 'apptivo_ecommerce_process_item_meta', 1, 2);
$post_id = wp_insert_post($new_post);
echo 'Synced the New Item "'.$items_details->itemName.'" with Post ID "'.$post_id.'"...
';
$new_items++;
}
else
{
//echo "product id else";
$update_post = array(
'ID' => $product_postid,
'post_title' => $items_details->itemName,
'post_content' => $items_details->description,
//'post_excerpt' => $items_details->itemShortDescription,
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'item',
'post_category' => array(),
'tax_input' => array( 'item_cat' => $item_categoryID )
);
remove_action('apptivo_ecommerce_process_item_meta', 'apptivo_ecommerce_process_item_meta', 1, 2);
$post_id = wp_update_post($update_post);
echo 'Synced the Old Item "'.$items_details->itemName.'" with Post ID "'.$post_id.'"...
';
$old_items++;
}
if($post_id){
//echo "calleeddd post id";
update_post_meta($post_id, '_apptivo_item_code', $items_details->itemCode);
update_post_meta($post_id, '_apptivo_item_id', $items_details->itemId);
update_post_meta($post_id, '_apptivo_item_uom_id', $items_details->uomId);
update_post_meta($post_id, '_apptivo_item_manufactured_id', $items_details->supplierId);
update_post_meta( $post_id, '_apptivo_regular_price', $items_details->suggestedPrice );
update_post_meta( $post_id, '_apptivo_supplier', $items_details->supplierName );
update_post_meta( $post_id, '_apptivo_sale_price', $items_details->itemPrice );
update_post_meta( $post_id, '_apptivo_track_color', $items_details->trackColor );
update_post_meta( $post_id, '_apptivo_track_size', $items_details->trackSize );
$apptivo_enabled = ($items_details->enabledForSales)?'yes':'no';
update_post_meta( $post_id, '_apptivo_enabled', $apptivo_enabled );
$apptivo_featured = ($items_details->featured)?'yes':'no';
update_post_meta( $post_id, '_apptivo_featured', $apptivo_featured );
}
}
endforeach;
//Wordpress items lists
$wpdb->query("
SELECT `post_id`, `meta_value`
FROM $wpdb->postmeta
WHERE `meta_key` = '_apptivo_item_id'
");
foreach($wpdb->last_result as $key => $value){
$wp_ecommerce_items[$value->post_id] = $value->meta_value;
}
$filter_items_arrays = array_diff($wp_ecommerce_items,$apptivo_item_lists);
//Removing items from wordpress
if( count($filter_items_arrays) != 0 ) {
foreach ($filter_items_arrays as $filtered_post_id => $value) {
wp_delete_post( $filtered_post_id, 1 );
delete_post_meta($filtered_post_id, '_apptivo_item_code');
delete_post_meta($filtered_post_id, '_apptivo_item_id');
delete_post_meta($filtered_post_id, '_apptivo_item_uom_id');
delete_post_meta($filtered_post_id, '_apptivo_item_manufactured_id');
delete_post_meta($filtered_post_id, '_apptivo_regular_price');
delete_post_meta($filtered_post_id, '_apptivo_supplier');
delete_post_meta($filtered_post_id, '_apptivo_sale_price');
delete_post_meta($filtered_post_id, '_apptivo_track_color');
delete_post_meta($filtered_post_id, '_apptivo_track_size');
delete_post_meta($filtered_post_id, '_apptivo_enabled');
delete_post_meta($filtered_post_id, '_apptivo_featured');
echo 'Removing the old Item ID ('.$filtered_post_id.')...
';
}
}
//Removed Items
if ( count($apptivo_item_category) == 0)
{
echo '
No categories found...
';
}
if($new_items == 0 )
{
echo '
No New items found...
';
}
else if($new_items != 0){
echo '
Synced '.$new_items.' New Items';
echo '
Items Added Successfully..
';
}
if($old_items != 0)
{
echo '
Synced '.$old_items.' Old Items';
echo '
Items Updated Successfully..
';
}
update_option('apptivo_ecommerce_sync_status', 'yes'); //For Deafult category Update.
echo '
Sync Completed';
echo '' . __( 'Your settings have been saved.', 'apptivo_ecommerce' ) . '