本文整理汇总了PHP中Lookup::customer_types方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::customer_types方法的具体用法?PHP Lookup::customer_types怎么用?PHP Lookup::customer_types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lookup
的用法示例。
在下文中一共展示了Lookup::customer_types方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings_meta_box
function settings_meta_box($Customer)
{
?>
<p>
<span>
<input type="hidden" name="marketing" value="no" />
<input type="checkbox" id="marketing" name="marketing" value="yes"<?php
echo $Customer->marketing == 'yes' ? ' checked="checked"' : '';
?>
/>
<label for="marketing" class="inline"> <?php
_e('Subscribes to marketing', 'Shopp');
?>
</label>
</span>
</p>
<br class="clear" />
<p>
<span>
<select name="type"><?php
echo Shopp::menuoptions(Lookup::customer_types(), $Customer->type);
?>
</select>
<label for="type"><?php
_e('Customer Type', 'Shopp');
?>
</label>
</span>
</p>
<br class="clear" />
<?php
do_action('shopp_customer_editor_settings', $Customer);
}
示例2: suggestions
public function suggestions()
{
check_admin_referer('wp_ajax_shopp_suggestions');
if (isset($_GET['t'])) {
// @legacy
switch ($_GET['t']) {
case "product-name":
$_GET['s'] = 'shopp_products';
break;
case "product-tags":
$_GET['s'] = 'shopp_tag';
break;
case "product-category":
$_GET['s'] = 'shopp_category';
break;
case "customer-type":
$_GET['s'] = 'shopp_customer_types';
break;
}
}
if (isset($_GET['s'])) {
global $wpdb;
$source = strtolower($_GET['s']);
$q = $_GET['q'];
$orderlimit = '';
do_action('shopp_suggestions_from_' . $source);
$joins = $where = array();
switch ($source) {
case 'wp_posts':
$id = 'ID';
$name = 'post_title';
$table = $wpdb->posts;
$where[] = "post_type='post'";
break;
case 'wp_pages':
$id = 'ID';
$name = 'post_title';
$table = $wpdb->posts;
$where[] = "post_type='page'";
break;
case 'wp_categories':
$id = 't.term_id';
$name = 'name';
$table = "{$wpdb->terms} AS t";
$joins[] = "INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id";
$where[] = "tt.taxonomy = 'category'";
break;
case 'wp_tags':
$id = 't.term_id';
$name = 'name';
$table = "{$wpdb->terms} AS t";
$joins[] = "INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id";
$where[] = "tt.taxonomy = 'post_tag'";
break;
case 'wp_media':
$id = 'ID';
$name = 'post_title';
$table = $wpdb->posts;
$where[] = "post_type='attachment'";
break;
case 'wp_users':
$id = 'ID';
$name = 'user_login';
$table = $wpdb->users;
break;
case 'shopp_memberships':
$id = 'id';
$name = 'name';
$table = ShoppDatabaseObject::tablename('meta');
$where[] = "context='membership'";
$where[] = "type='membership'";
break;
case 'shopp_products':
$id = 'ID';
$name = 'post_title';
$table = $wpdb->posts;
$where[] = "post_type='" . ShoppProduct::$posttype . "'";
break;
case 'shopp_promotions':
$id = 'id';
$name = 'name';
$table = ShoppDatabaseObject::tablename(ShoppPromo::$table);
break;
case 'shopp_downloads':
$id = 'id';
$name = 'name';
$table = ShoppDatabaseObject::tablename('meta');
$where[] = "context='price'";
$where[] = "type='download'";
break;
case 'shopp_target_markets':
$markets = shopp_setting('target_markets');
$results = array();
foreach ($markets as $id => $market) {
if (strpos(strtolower($market), strtolower($_GET['q'])) !== false) {
$_ = new StdClass();
$_->id = $id;
$_->name = stripslashes($market);
$results[] = $_;
}
//.........这里部分代码省略.........
示例3: _e
<p class="clearfix">
<span>
<input type="hidden" name="marketing" value="no" />
<input type="checkbox" id="marketing" name="marketing" value="yes"<?php
echo $Customer->marketing == 'yes' ? ' checked="checked"' : '';
?>
/>
<label for="marketing" class="inline"> <?php
_e('Subscribes to marketing', 'Shopp');
?>
</label>
</span>
</p>
<p class="clearfix">
<span>
<label for="customer-type"><?php
_e('Customer Type', 'Shopp');
?>
</label>
<select id="customer-type" name="type"><?php
echo Shopp::menuoptions(Lookup::customer_types(), $Customer->type);
?>
</select>
</span>
</p>
示例4: suggestions
function suggestions () {
check_admin_referer('wp_ajax_ecart_suggestions');
$db = DB::get();
switch($_GET['t']) {
case "product-name": $table = DatabaseObject::tablename(Product::$table); break;
case "product-tags": $table = DatabaseObject::tablename(Tag::$table); break;
case "product-category": $table = DatabaseObject::tablename(Category::$table); break;
case "customer-type":
$types = Lookup::customer_types();
$results = array();
foreach ($types as $type)
if (strpos(strtolower($type),strtolower($_GET['q'])) !== false) $results[] = $type;
echo join("\n",$results);
exit();
break;
}
$entries = $db->query("SELECT name FROM $table WHERE name LIKE '%{$_GET['q']}%'",AS_ARRAY);
$results = array();
foreach ($entries as $entry) $results[] = $entry->name;
echo join("\n",$results);
exit();
}