current = $this->currentItemMenu(); if( $this->current == 'dash' ) { $this->catch_reset(); } if( in_array( $this->current, array('currency', 'api', 'updates', 'cleanup') ) ) { $this->catch_request(); } if( $this->current == 'scheduled' ) $this->catch_cron(); if( $this->current == 'review' ) $this->catch_cron_review(); //读取wp_option数据 $this->AppKey = get_site_option('aliprice-app-key'); $this->trackingId = get_site_option('aliprice-tracking'); $this->appsignature = get_site_option('aliprice-appsignature'); $this->Partner_username = get_site_option('aliprice-partner_username'); $this->appearance = get_site_option('aliprice-appearance'); $this->todaysdeal = get_site_option('aliprice-todaysdeal'); $this->hotdeal = get_site_option('aliprice-hotdeal'); $this->alibaba = get_site_option('aliprice-alibaba'); $this->alibaba_href = get_site_option('aliprice-alibaba_href'); } /** * show current template */ public function getTemplate() { $current = $this->current; $tmpls = $this->templList(); $args = $this->listMenu(); if( !isset( $tmpls[$current] ) ) return false; $cancel = false; foreach($args as $key => $val) { if( $cancel ) continue; if( $key == $current ) { $this->title = $val['title']; $this->description = $val['description']; $this->icon = $val['icon']; $cancel = true; } if( isset($val['submenu']) ) { foreach( $val['submenu'] as $skey => $sval ) { if( $skey == $current ) { $this->title = $sval['title']; $this->description = $sval['description']; $this->icon = $val['icon']; $cancel = true; } } } } $method = $tmpls[$current]; if( method_exists( $this, $method ) ) { ob_start(); $this->$method(); $content = ob_get_contents(); ob_end_clean(); $this->createTpl( $content ); } else return false; } /** * list template slugs */ public function templList() { return array( 'dash' => 'tmplDashboard', 'bulkimport' => 'tmplBulk', 'advancedimport' => 'tmplAdvanced', 'scheduledimport' => 'tmplScheduled', 'translate' => 'tmplTranslate', 'review' => 'tmplReview', 'currency' => 'tmplCurrency', 'updates' => 'tmplUpdates', 'api' => 'tmplAPI', 'cleanup' => 'tmplCleanup' ); } /** * list menu array */ public function listMenu() { return array( 'dash' => array( 'title' => __('Dashboard', 'aliprice'), 'description' => __('This displays the current information about your online store', 'aliprice'), 'icon' => 'tachometer', 'submenu' => array() ), 'advancedimport' => array( 'title' => __('Import Products', 'aliprice'), 'icon' => 'cloud-download', 'description' => __('Using this module you can bulk import multiple products at once on your store', 'aliprice'), 'submenu' => array( 'advancedimport' => array( 'title' => __('Selective Import', 'aliprice'), 'description' => __('Find and select particular products to import', 'aliprice') ), 'bulkimport' => array( 'title' => __('Bulk Import', 'aliprice'), 'description' => __('Using this module you can bulk import multiple products at once on your store', 'aliprice') ), 'scheduledimport' => array( 'title' => __('Scheduled Import', 'aliprice'), 'description' => __('Using this module the system will automatically import and update products on your site according to given parameters', 'aliprice') ) ) ), 'review' => array( 'title' => __('Reviews', 'aliprice'), 'icon' => 'comment', 'description' => __('Add Reviews to your products.', 'aliprice'), 'submenu' => array() ), 'api' => array( 'title' => __('Settings', 'aliprice'), 'description' => __('Mandatory fields are APP Key and Tracking ID', 'aliprice'), 'icon' => 'cog', 'submenu' => array( 'api' => array( 'title' => __('General', 'aliprice'), 'description' => __('The following fields are required in order to send requests to AliExpress and retrieve data about products.', 'aliprice') ), 'currency' => array( 'title' => __('Currency', 'aliprice'), 'description' => __('Standards and formats are used to calculate such things as product price.', 'aliprice') ), 'updates' => array( 'title' => __('Updates', 'aliprice'), 'description' => '' ), 'cleanup' => array( 'title' => __('Cleanup', 'aliprice'), 'description' => __('All existent products imported in your store will be removed.', 'aliprice') ), 'translate' => array( 'title' => __('Translation', 'aliprice'), 'description' => __('Translate Page Titles and Categories', 'aliprice'), 'icon' => 'language', 'submenu' => array() ), ), ) ); } public function tmplUpdates() { ?>

0

'twicedaily', 'enabled' => '0', 'description' => '1', 'etitle' => '1' ); $args = get_site_option('aliprice-autoupdate'); $args = ( !$args ) ? array() : unserialize($args); $args = wp_parse_args( $args, $defaults ); $delete = get_site_option('aliprice-delete'); ?>
>

todaysdeal == 1) ? 'checked="checked"' : '' ?>>

hotdeal == 1) ? 'checked="checked"' : '' ?>>

alibaba == 1) ? 'checked="checked"' : '' ?>>

Portals

Portals AliExpress

AliExpress offers its own platform for affiliate marketing, also known as the Portals Affiliate Program.

Main features:

  • 8% commission on all paid and delivered orders
  • Approval Time Frames – 7-15 days
  • Payouts rate – once a month
  • Payment methods – wire transfer

0%
'daily', 'enabled' => '0', 'currency' => '', 'value' => '', 'round' => '0' ); $args = get_site_option('aliprice-currency'); $args = ( !$args ) ? array() : unserialize($args); $args = wp_parse_args( $args, $defaults ); ?>

>
>
publish; ?>

 
catch_dashboard() ?>


+

tmplFormImport(); } /** * Template Bulk Import */ public function tmplAdvanced() { ?>
tmplFormImport('advanced'); ?>
tmplFormById() ?>

-

-

- USD

0
'daily', 'enabled' => 0, 'position' => 1, 'count_settings' => 40, 'star' => 1 ); $args = get_site_option('aliprice-scheduled-review'); $args = ( !$args ) ? array() : unserialize($args); $args = wp_parse_args( $args, $defaults ); ?>

>

.

'', 'keywords' => '', 'promotionfrom' => '10', 'promotionto' => '5000', 'pricefrom' => '', 'priceto' => '', 'inteval' => 'daily', 'enabled' => '0', 'all_match' => '10', 'creditScoreFrom' => '0', 'creditScoreTo' => '1000', 'fs' => '0', 'unitType' => '', ); $args = get_site_option('aliprice-scheduled'); $args = ( !$args ) ? array() : unserialize($args); $args = wp_parse_args( $args, $defaults ); ?>


+

-

-

- USD

>
>
'---', 'piece' => __('Piece', 'aliprice'), 'lot' => __('Lot', 'aliprice') ) ?>

'page', 'orderby' => 'post_title', 'order' => 'ASC', 'posts_per_page' => '-1') ); $this->translate_table( __('Pages', 'aliprice'), 'page', $data ); $terms = get_terms('shopcategory'); $this->translate_table( __('Product Categories', 'aliprice'), 'taxonomy', $terms ); ?>

0%
'; else foreach( $data as $item ){ if( $type == 'page' ) { $title = $item->post_title; $id = $item->ID; $original = get_post_meta($id, 'aliprice_original_title', true); } elseif( $type == 'taxonomy' ) { $title = $item->name; $id = $item->term_id; $original = get_site_option('aliprice_original_title_' . $id, ''); } ?>

' . __('Not Found', 'aliprice') . '

 

Setting saved.

'daily', 'enabled' => '0', 'description' => '0', 'etitle' => '0', ); $args = wp_parse_args( $_POST, $defaults ); update_site_option( 'aliprice-autoupdate', serialize( $args ) ); $delete = $_POST['delete']; update_site_option( 'aliprice-delete', $delete ); wp_clear_scheduled_hook( 'aliprice_cron_event' ); ?>

.

'daily', 'enabled' => '0', 'currency' => '', 'value' => '', 'round' => '0' ); $args = get_site_option('aliprice-currency'); $args = ( !$args ) ? array() : unserialize($args); $args = wp_parse_args( $args, $defaults ); $currency = strip_tags($_POST['currency']); $value = aliprice_convertCurrency( 1, 'USD', $currency ); if( !$value ) { ?>

.

$args['inteval'], 'enabled' => isset( $_POST['enabled'] ) ? 1 : 0, 'currency' => $currency, 'value' => $value, 'round' => isset( $_POST['round'] ) ? 1 : 0 ); update_site_option( 'aliprice-currency', serialize($foo) ); wp_clear_scheduled_hook( 'aliprice_cron_currency' ); ?>

.

'', 'keywords' => '', 'promotionfrom' => '10', 'promotionto' => '5000', 'pricefrom' => '', 'priceto' => '', 'creditScoreFrom' => '', 'creditScoreTo' => '', 'inteval' => 'daily', 'enabled' => '0', 'all_match' => '20', 'page_no' => '1', 'dropcat' => '', 'publishstatus' => 'publish' ); $args = wp_parse_args( $_POST, $defaults ); update_site_option( 'aliprice-scheduled', serialize( $args ) ); wp_clear_scheduled_hook( 'aliprice_cron_import' ); ?>

.

'daily', 'enabled' => 0, 'count_settings' => 40, 'position' => 1, 'star' => 1 ); $args = wp_parse_args( $_POST, $defaults ); update_site_option( 'aliprice-scheduled-review', serialize( $args ) ); wp_clear_scheduled_hook( 'aliprice_cron_review' ); ?>

.

ID; $views = get_post_meta($id, 'views', true); $redirects = get_post_meta($id, 'redirects', true); $views = intval( $views ); $redirects = intval( $redirects ); $info = new AEProducts( ); $info->set( $id ); $img = $info->getThumb( 'medium' ); $img = ( $img ) ? '' : ''; if( $i == 1 ) echo '
'; ?>

post_title ?>

:
:

'; $i = 0; } } if( $i != 0 ) echo '
'; } /** * Generate Hierarhical to dropdown menu */ public function taxonomy_options( $tax_slug, $parent = '', $level = 0, $selected = null ) { $args = array('hide_empty' => false); if( !is_null($parent) ) $args['parent'] = $parent; $terms = get_terms( $tax_slug, $args ); $tab = ''; for( $i = 0; $i < $level; $i++ ) { $tab .= '--'; } foreach ( $terms as $term ) { echo ''; $this->taxonomy_options( $tax_slug, $term->term_id, $level+1, $selected ); } } } ?>