本文整理汇总了PHP中fn_get_profile_fields函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_profile_fields函数的具体用法?PHP fn_get_profile_fields怎么用?PHP fn_get_profile_fields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_profile_fields函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fn_charge_subscription
function fn_charge_subscription($subscription_id)
{
$_SESSION['cart'] = isset($_SESSION['cart']) ? $_SESSION['cart'] : array();
$cart =& $_SESSION['cart'];
$_SESSION['customer_auth'] = isset($_SESSION['customer_auth']) ? $_SESSION['customer_auth'] : array();
$customer_auth =& $_SESSION['customer_auth'];
fn_clear_cart($cart, true);
$customer_auth = fn_fill_auth();
$subscription = fn_get_recurring_subscription_info($subscription_id);
if ($subscription['status'] != 'A') {
fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('rb_subscription_inactive'));
} else {
$product_data = array();
foreach ($subscription['order_info']['items'] as $k => $item) {
if (!empty($subscription['order_info']['items'][$k]['extra']['recurring_plan_id']) && $subscription['order_info']['items'][$k]['extra']['recurring_plan_id'] == $subscription['plan_id'] && $subscription['order_info']['items'][$k]['extra']['recurring_duration'] == $subscription['orig_duration']) {
$product_data[$subscription['order_info']['items'][$k]['product_id']] = array('amount' => $subscription['order_info']['items'][$k]['amount'], 'extra' => array('recurring_plan_id' => $subscription['plan_id'], 'recurring_force_calculate' => true, 'recurring_subscription_id' => $subscription['subscription_id'], 'recurring_plan' => $subscription['order_info']['items'][$k]['extra']['recurring_plan'], 'recurring_duration' => $subscription['order_info']['items'][$k]['extra']['recurring_duration']));
if (!empty($subscription['order_info']['items'][$k]['extra']['product_options'])) {
$product_data[$subscription['order_info']['items'][$k]['product_id']]['product_options'] = $subscription['order_info']['items'][$k]['extra']['product_options'];
}
}
}
$cart['user_id'] = $subscription['user_id'];
$u_data = db_get_row("SELECT user_id, user_type, tax_exempt FROM ?:users WHERE user_id = ?i", $cart['user_id']);
$customer_auth = fn_fill_auth($u_data);
$cart['user_data'] = array();
fn_add_product_to_cart($product_data, $cart, $customer_auth);
$cart['profile_id'] = 0;
$cart['user_data'] = fn_get_user_info($customer_auth['user_id'], true, $cart['profile_id']);
if (!empty($cart['user_data'])) {
$profile_fields = fn_get_profile_fields('O', $customer_auth);
$cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
}
fn_calculate_cart_content($cart, $customer_auth, 'A', true, 'I');
$cart['payment_id'] = $subscription['order_info']['payment_id'];
$cart['payment_info'] = $subscription['order_info']['payment_info'];
$cart['recurring_subscription_id'] = $subscription_id;
list($order_id, $process_payment) = fn_place_order($cart, $customer_auth);
if (!empty($order_id)) {
$order_info = fn_get_order_info($order_id, true);
$evt_data = array('subscription_id' => $subscription_id, 'timestamp' => $order_info['timestamp'], 'event_type' => 'C');
db_query("INSERT INTO ?:recurring_events ?e", $evt_data);
if ($process_payment == true) {
fn_start_payment($order_id);
}
$edp_data = fn_generate_ekeys_for_edp(array(), $order_info);
fn_order_notification($order_info, $edp_data);
}
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:49,代码来源:subscriptions.php
示例2: fn_qwintry_save_order_invoice
function fn_qwintry_save_order_invoice($order_id, $area = AREA, $lang_code = CART_LANGUAGE)
{
$view = Tygh::$app['view'];
$html = array();
$view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_ORDER, true, true));
$view->assign('profile_fields', fn_get_profile_fields('I'));
$order_info = fn_get_order_info($order_id, false, true, false, true);
if (empty($order_info)) {
return;
}
if (fn_allowed_for('MULTIVENDOR')) {
$view->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products']));
}
list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true));
$use_shipments = !fn_one_full_shipped($shipments);
$view->assign('order_info', $order_info);
$view->assign('shipments', $shipments);
$view->assign('use_shipments', $use_shipments);
$view->assign('payment_method', fn_get_payment_data(!empty($order_info['payment_method']['payment_id']) ? $order_info['payment_method']['payment_id'] : 0, $order_info['order_id'], $lang_code));
$view->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $lang_code, $order_info['company_id']));
$view->assign('status_settings', fn_get_status_params($order_info['status']));
$view->assign('company_data', fn_get_company_placement_info($order_info['company_id'], $lang_code));
fn_disable_live_editor_mode();
$html[] = $view->displayMail('orders/print_invoice.tpl', false, $area, $order_info['company_id'], $lang_code);
$filename = QWINTRY_DIR_INVOICES . $order_id . '.pdf';
if (Pdf::render($html, $filename, true)) {
return $filename;
}
return false;
}
开发者ID:qwintry,项目名称:logistics-cscart,代码行数:30,代码来源:func.php
示例3: export
//.........这里部分代码省略.........
list($values) = LanguageValues::getVariables(array(), 0, $lang_code);
foreach ($values as $_id => $value) {
$values[$_id]['msgctxt'] = 'Languages' . \I18n_Pofile::DELIMITER . $value['name'];
}
$values = fn_array_value_to_key($values, 'msgctxt');
$addons_lang_vars = array();
list($addons) = fn_get_addons(array('type' => 'installed'), 0, $lang_code);
foreach ($addons as $addon_id => $addon) {
$addons_lang_vars = array_merge($addons_lang_vars, self::exportAddonsPo($addon_id, $pack_path . 'addons/' . $addon_id . '.po', $lang_code, $values));
}
$original_values = self::getOriginalValues('Languages');
$values = array_diff_key($values, $addons_lang_vars);
foreach ($values as $_id => $value) {
$values[$_id]['original_value'] = isset($original_values['Languages::' . $value['name']]) ? $original_values['Languages::' . $value['name']]['msgid'] : '';
}
$values = Po::convert($values, array(), $allow_overlap);
list($values, $excluded) = self::excludeEditionVariables('Languages', $values, $mve_lang_variables);
Po::putValues('Languages', $values, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('Languages', $excluded, $mve_pack_path);
}
// Export Settings Sections
$sections = Settings::instance()->getCoreSections($lang_code);
$original_values = self::getOriginalValues('SettingsSections');
foreach ($sections as $_id => $value) {
$sections[$_id]['original_value'] = isset($original_values['SettingsSections::' . $value['section_id']]) ? $original_values['SettingsSections::' . $value['section_id']]['msgid'] : '';
}
$_sections = Po::convert($sections, array('id' => 'section_id', 'value' => 'description'), $allow_overlap);
list($_sections, $excluded) = self::excludeEditionVariables('SettingsSections', $_sections, $mve_lang_variables);
Po::putValues('SettingsSections', $_sections, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsSections', $excluded, $mve_pack_path);
}
unset($_sections);
$original_options = self::getOriginalValues('SettingsOptions');
$original_variants = self::getOriginalValues('SettingsVariants');
$original_tooltips = self::getOriginalValues('SettingsTooltips');
foreach ($sections as $section) {
$options = Settings::instance()->getList($section['object_id'], 0, false, null, $lang_code);
$_options = array();
$_tooltips = array();
foreach ($options['main'] as $option) {
$_options[] = array('name' => $option['name'], 'value' => $option['description'], 'original_value' => isset($original_options['SettingsOptions' . \I18n_Pofile::DELIMITER . $option['name']]) ? $original_options['SettingsOptions' . \I18n_Pofile::DELIMITER . $option['name']]['msgid'] : '');
if (!empty($option['variants'])) {
$_variants = array();
foreach ($option['variants'] as $variant_id => $variant) {
$_variants[] = array('name' => $variant_id, 'value' => $variant, 'original_value' => isset($original_variants['SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'] . \I18n_Pofile::DELIMITER . $variant_id]) ? $original_variants['SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'] . \I18n_Pofile::DELIMITER . $variant_id]['msgid'] : '');
}
$_variants = Po::convert($_variants, array(), $allow_overlap);
list($_variants, $excluded) = self::excludeEditionVariables('SettingsVariants', $_variants, $mve_lang_variables);
Po::putValues('SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'], $_variants, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsVariants', $excluded, $mve_pack_path);
}
unset($_variants);
}
if (!empty($option['tooltip'])) {
$_tooltips[] = array('name' => $option['name'], 'value' => $option['tooltip'], 'original_value' => isset($original_tooltips['SettingsTooltips' . \I18n_Pofile::DELIMITER . $option['name']]) ? $original_tooltips['SettingsTooltips' . \I18n_Pofile::DELIMITER . $option['name']]['msgid'] : '');
}
}
$_options = Po::convert($_options, array(), $allow_overlap);
list($_options, $excluded) = self::excludeEditionVariables('SettingsOptions', $_options, $mve_lang_variables);
Po::putValues('SettingsOptions', $_options, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsOptions', $excluded, $mve_pack_path);
}
$_tooltips = Po::convert($_tooltips, array(), $allow_overlap);
list($_tooltips, $excluded) = self::excludeEditionVariables('SettingsTooltips', $_tooltips, $mve_lang_variables);
Po::putValues('SettingsTooltips', $_tooltips, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsTooltips', $excluded, $mve_pack_path);
}
}
// Export Profile fields
$profile_fields = fn_get_profile_fields('ALL', array(), $lang_code);
$original_values = self::getOriginalValues('ProfileFields');
$values = array();
foreach ($profile_fields as $zone => $fields) {
foreach ($fields as $field_id => $field) {
$values[] = array('name' => $field['field_name'], 'value' => $field['description'], 'original_value' => isset($original_values['ProfileFields::' . $field['field_name']]) ? $original_values['ProfileFields::' . $field['field_name']]['msgid'] : '');
}
}
$values = Po::convert($values, array(), $allow_overlap);
list($values, $excluded) = self::excludeEditionVariables('ProfileFields', $values, $mve_lang_variables);
Po::putValues('ProfileFields', $values, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('ProfileFields', $excluded, $mve_pack_path);
}
fn_compress_files($lang_code . '.zip', './', $pack_path);
$filename = $pack_path . $lang_code . '.zip';
switch ($output) {
case 'server':
fn_copy($filename, Registry::get('config.dir.lang_packs') . $lang_code . '.zip');
break;
case 'download':
fn_get_file($filename, $lang_code . '.zip');
break;
}
return true;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:101,代码来源:Languages.php
示例4: elseif
}
Tygh::$app['view']->assign('companies', $companies);
Tygh::$app['view']->assign('search', $search);
} elseif ($mode == 'apply_for_vendor') {
if (Registry::get('settings.Vendors.apply_for_vendor') != 'Y') {
return array(CONTROLLER_STATUS_NO_PAGE);
}
$restored_company_data = fn_restore_post_data('company_data');
if ($restored_company_data) {
Tygh::$app['view']->assign('company_data', $restored_company_data);
}
$restored_user_data = fn_restore_post_data('user_data');
if ($restored_user_data) {
Tygh::$app['view']->assign('user_data', $restored_user_data);
}
$profile_fields = fn_get_profile_fields('A', array(), CART_LANGUAGE, array('get_custom' => true, 'get_profile_required' => true));
Tygh::$app['view']->assign('profile_fields', $profile_fields);
Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
Tygh::$app['view']->assign('states', fn_get_all_states());
fn_add_breadcrumb(__('apply_for_vendor_account'));
$_SESSION['apply_for_vendor']['return_url'] = !empty($_REQUEST['return_previous_url']) ? $_REQUEST['return_previous_url'] : fn_url('');
} elseif ($mode == 'products') {
$company_data = !empty($_REQUEST['company_id']) ? fn_get_company_data($_REQUEST['company_id']) : array();
if (empty($company_data)) {
return array(CONTROLLER_STATUS_NO_PAGE);
}
$company_id = $company_data['company_id'];
fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
$params = $_REQUEST;
$params['company_id'] = $company_id;
$params['extend'] = array('description');
开发者ID:arpad9,项目名称:bygmarket,代码行数:31,代码来源:companies.php
示例5: fn_delete_profile_field
}
if ($mode == 'delete') {
if (!empty($_REQUEST['field_id'])) {
fn_delete_profile_field($_REQUEST['field_id']);
}
}
return array(CONTROLLER_STATUS_OK, 'profile_fields' . $_suffix);
}
if ($mode == 'manage') {
$profile_fields = fn_get_profile_fields('ALL', array(), DESCR_SL);
Registry::get('view')->assign('profile_fields_areas', fn_profile_fields_areas());
Registry::get('view')->assign('profile_fields', $profile_fields);
} elseif ($mode == 'update' || $mode == 'add') {
if ($mode == 'update') {
$params['field_id'] = $_REQUEST['field_id'];
$field = fn_get_profile_fields('ALL', array(), DESCR_SL, $params);
Registry::get('view')->assign('field', $field);
}
Registry::get('view')->assign('profile_fields_areas', fn_profile_fields_areas());
}
// -------------- Functions ----------------
function fn_add_field_values($values = array(), $field_id = 0)
{
if (empty($values) || empty($field_id)) {
return false;
}
foreach ($values as $_v) {
if (empty($_v['description'])) {
continue;
}
// Insert main data
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:profile_fields.php
示例6: fn_twg_get_all_settings
/**
* Prepare all settings, wich should be passed to js
*/
function fn_twg_get_all_settings()
{
$settings = fn_twg_get_boot_settings();
$addon_settings = TwigmoSettings::get();
$settings['access_id'] = $addon_settings['access_id'];
$settings['currency'] = Registry::get('currencies.' . CART_SECONDARY_CURRENCY);
$settings['primaryCurrency'] = Registry::get('currencies.' . CART_PRIMARY_CURRENCY);
$settings['url_for_facebook'] = isset($addon_settings['url_for_facebook']) ? fn_twg_get_external_info_url($addon_settings['url_for_facebook']) : '';
$settings['url_for_twitter'] = isset($addon_settings['url_for_twitter']) ? fn_twg_get_external_info_url($addon_settings['url_for_twitter']) : '';
$settings['lang'] = array_merge(fn_twg_get_default_customer_langvars(), Lang::getCustomerLangVars());
// Countries/states
list($countries) = fn_get_countries(array('only_avail' => true));
$settings = array_merge($settings, Api::getAsList('countries', $countries));
$settings['states'] = fn_twg_get_states();
// Info pages
$pages_location = $addon_settings['home_page_content'] == 'tw_home_page_blocks' ? 'twigmo.post' : 'index.index';
$pages = TwigmoBlock::getBlocksForLocation($pages_location, array('pages'));
$settings['info_pages'] = array();
foreach ($pages as $page) {
$settings['info_pages'] = array_merge($settings['info_pages'], $page['pages']['page']);
}
// If page link begin with # then interpret this link as twigmo page
foreach ($settings['info_pages'] as $k => $page) {
if (preg_match('/^\\#.*$/', $page['link'])) {
$settings['info_pages'][$k]['twigmo_page'] = substr($page['link'], 1);
}
}
// Only required profile fields
$only_required = isset($addon_settings['only_req_profile_fields']) ? $addon_settings['only_req_profile_fields'] : 'N';
$settings['profileFields'] = fn_twg_prepare_profile_fields(fn_get_profile_fields(), $only_required);
$settings['profileFieldsCheckout'] = fn_twg_prepare_profile_fields(fn_get_profile_fields('O'), $only_required);
$settings['show_product_code'] = isset($addon_settings['show_product_code']) ? $addon_settings['show_product_code'] : 'N';
$settings['titles'] = array();
$settings['profile'] = fn_twg_get_user_info($_SESSION['auth']['user_id']);
$settings['cart'] = fn_twg_api_get_session_cart($_SESSION['cart']);
$settings['sortings'] = fn_twg_get_sortings();
$settings['security_hash'] = fn_generate_security_hash();
$settings['productType'] = PRODUCT_EDITION;
$settings['languages'] = array_values(Lang::getLanguages());
$settings['cart_language'] = CART_LANGUAGE;
$settings['cart_prices_w_taxes'] = Registry::get('settings.Appearance.cart_prices_w_taxes');
$settings['show_prices_taxed_clean'] = Registry::get('settings.Appearance.show_prices_taxed_clean');
$settings['no_image_path'] = Registry::get('config.no_image_path');
// Suppliers
$settings['suppliers_vendor'] = Registry::get('settings.Suppliers.apply_for_vendor');
$settings['display_supplier'] = Registry::get('settings.Suppliers.display_supplier') === 'Y' || Registry::get('settings.Vendors.display_vendor') === 'Y';
$settings['display_supplier'] = $settings['display_supplier'] ? 'Y' : 'N';
// General section
$fields = array('use_email_as_login', 'min_order_amount', 'min_order_amount_type', 'allow_negative_amount', 'inventory_tracking', 'allow_anonymous_shopping', 'tax_calculation');
foreach ($fields as $field) {
$settings[$field] = Registry::get('settings.General.' . $field);
}
$settings = array_merge($settings, fn_twg_get_checkout_settings());
if (version_compare(PRODUCT_VERSION, '4.0.2', '>=')) {
$anonymous_shopping_settings_map = array('allow_shopping' => 'Y', 'hide_price_and_add_to_cart' => 'P', 'hide_add_to_cart' => 'B');
$settings['allow_anonymous_shopping'] = $anonymous_shopping_settings_map[$settings['allow_anonymous_shopping']];
}
$settings['default_location'] = array('country' => Registry::get('settings.General.default_country'), 'state' => Registry::get('settings.General.default_state'));
$settings['show_modifiers'] = Registry::get('settings.General.display_options_modifiers');
$settings['SEOEnabled'] = Registry::get('addons.seo.status') == 'A';
$settings['GATrackEcommerce'] = Registry::get('addons.google_analytics.status') == 'A' && Registry::get('addons.google_analytics.track_ecommerce') == 'Y' && file_exists(Registry::get('config.dir.addons') . 'google_analytics/controllers/frontend/checkout.post.php');
if (fn_allowed_for('MULTIVENDOR')) {
$settings['company_data'] = !empty($_SESSION['auth']['company_id']) ? fn_get_company_data($_SESSION['auth']['company_id']) : array();
} else {
$settings['company_data'] = array();
}
$settings['checkout'] = Registry::get('settings.Checkout');
fn_set_hook('twg_get_all_settings', $settings);
$settings['lang'] = fn_twg_process_langvars($settings['lang']);
return $settings;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:74,代码来源:func.php
示例7: content_55e01fce03b6c4_57891956
//.........这里部分代码省略.........
</td>
</tr>
<?php
}
?>
<?php
}
?>
</table>
</td>
<?php
$_block_content = ob_get_clean();
$_block_repeat = false;
echo smarty_block_hook(array('name' => "orders:invoice_order_status_info"), $_block_content, $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_tag_stack);
?>
</tr>
</table>
<?php
$_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:invoice_customer_info"));
$_block_repeat = true;
echo smarty_block_hook(array('name' => "orders:invoice_customer_info"), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();
?>
<?php
if (!$_smarty_tpl->tpl_vars['profile_fields']->value) {
?>
<?php
$_smarty_tpl->tpl_vars["profile_fields"] = new Smarty_variable(fn_get_profile_fields('I'), null, 0);
?>
<?php
}
?>
<?php
if ($_smarty_tpl->tpl_vars['profile_fields']->value) {
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 32px 0px 24px 0px;">
<tr valign="top">
<?php
if ($_smarty_tpl->tpl_vars['profile_fields']->value['C']) {
?>
<?php
$_smarty_tpl->tpl_vars["profields_c"] = new Smarty_variable(fn_fields_from_multi_level($_smarty_tpl->tpl_vars['profile_fields']->value['C'], "field_name", "field_id"), null, 0);
?>
<td width="33%" style="font-size: 12px; font-family: Arial;">
<h3 style="font: bold 17px Tahoma; padding: 0px 0px 3px 1px; margin: 0px;"><?php
echo $_smarty_tpl->__("customer");
?>
:</h3>
<p style="margin: 2px 0px 3px 0px;"><?php
if ($_smarty_tpl->tpl_vars['profields_c']->value['firstname']) {
echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['firstname'], ENT_QUOTES, 'UTF-8');
?>
<?php
}
if ($_smarty_tpl->tpl_vars['profields_c']->value['lastname']) {
echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['lastname'], ENT_QUOTES, 'UTF-8');
}
?>
</p>
<?php
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:944ccedd81edb7ecaba81d12eb7c5bff32bf5786.tygh.invoice.tpl.php
示例8: fn_array_merge
if ($restored_user_data) {
$user_data = fn_array_merge($user_data, $restored_user_data);
}
Registry::set('navigation.tabs.general', array('title' => __('general'), 'js' => true));
$show_usergroups = true;
if (Registry::get('settings.General.allow_usergroup_signup') != 'Y') {
$show_usergroups = fn_user_has_active_usergroups($user_data);
}
if ($show_usergroups) {
$usergroups = fn_get_usergroups('C');
if (!empty($usergroups)) {
Registry::set('navigation.tabs.usergroups', array('title' => __('usergroups'), 'js' => true));
Registry::get('view')->assign('usergroups', $usergroups);
}
}
$profile_fields = fn_get_profile_fields();
// echo 'profile fields:'; var_dump($profile_fields);
//check if the user has uploaded a image
$target_dir = "/images/user_profile/";
//insert user id here
$base_url = $_SERVER['DOCUMENT_ROOT'];
$ls_image_name = $auth['user_id'] . '.jpg';
//replace with user id
$target_file = $base_url . $target_dir . $ls_image_name;
if (file_exists($target_file)) {
$ls_user_image = 'file exists';
// $view->assign('ls_user_image', $ls_user_image);
Registry::get('view')->assign('ls_user_profile_image', $ls_user_image);
}
Registry::get('view')->assign('profile_fields', $profile_fields);
Registry::get('view')->assign('user_data', $user_data);
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:profiles.php
示例9: fn_calculate_tax_rates
function fn_calculate_tax_rates($taxes, $price, $amount, $auth, &$cart)
{
static $destination_id;
static $tax_description;
static $user_data;
$taxed_price = $price;
if (!empty($cart['user_data'])) {
$profile_fields = fn_get_profile_fields('O', $auth);
$billing_population = fn_check_profile_fields_population($cart['user_data'], 'B', $profile_fields);
$shipping_population = fn_check_profile_fields_population($cart['user_data'], 'S', $profile_fields);
}
if (empty($auth['user_id']) && (empty($cart['user_data']) || fn_is_empty($cart['user_data']) || $billing_population != true || $shipping_population != true) && defined('CHECKOUT') && Registry::get('settings.Appearance.taxes_using_default_address') !== 'Y') {
return false;
}
if (empty($destination_id) || $user_data != @$cart['user_data']) {
// Get billing location
$location = fn_get_customer_location($auth, $cart, true);
$destination_id['B'] = fn_get_available_destination($location);
// Get shipping location
$location = fn_get_customer_location($auth, $cart);
$destination_id['S'] = fn_get_available_destination($location);
}
if (!empty($cart['user_data'])) {
$user_data = $cart['user_data'];
}
$_tax = 0;
$previous_priority = 0;
foreach ($taxes as $key => $tax) {
if (empty($tax['tax_id'])) {
$tax['tax_id'] = $key;
}
if (empty($tax['priority'])) {
$tax['priority'] = 1;
}
$_is_zero = floatval($taxed_price);
if (empty($_is_zero)) {
continue;
}
if (!empty($cart['stored_taxes']) && $cart['stored_taxes'] == 'Y' && !empty($tax['rate_type'])) {
$rate = array('rate_value' => $tax['rate_value'], 'rate_type' => $tax['rate_type']);
} else {
if (!isset($destination_id[$tax['address_type']])) {
continue;
}
$rate = db_get_row("SELECT destination_id, apply_to, rate_value, rate_type FROM ?:tax_rates WHERE tax_id = ?i AND destination_id = ?i", $tax['tax_id'], $destination_id[$tax['address_type']]);
if (!@floatval($rate['rate_value'])) {
continue;
}
}
$base_price = $tax['priority'] == $previous_priority ? $previous_price : $taxed_price;
if ($rate['rate_type'] == 'P') {
// Percent dependence
// If tax is included into the price
if ($tax['price_includes_tax'] == 'Y') {
$_tax = fn_format_price($base_price - $base_price / (1 + $rate['rate_value'] / 100));
// If tax is NOT included into the price
} else {
$_tax = fn_format_price($base_price * ($rate['rate_value'] / 100));
$taxed_price += $_tax;
}
} else {
$_tax = fn_format_price($rate['rate_value']);
// If tax is NOT included into the price
if ($tax['price_includes_tax'] != 'Y') {
$taxed_price += $_tax;
}
}
$previous_priority = $tax['priority'];
$previous_price = $base_price;
if (empty($tax_description[$tax['tax_id']])) {
$tax_description[$tax['tax_id']] = db_get_field("SELECT tax FROM ?:tax_descriptions WHERE tax_id = ?i AND lang_code = ?s", $tax['tax_id'], CART_LANGUAGE);
}
$taxes_data[$tax['tax_id']] = array('rate_type' => $rate['rate_type'], 'rate_value' => $rate['rate_value'], 'price_includes_tax' => $tax['price_includes_tax'], 'regnumber' => @$tax['regnumber'], 'priority' => @$tax['priority'], 'tax_subtotal' => fn_format_price($_tax * $amount), 'description' => $tax_description[$tax['tax_id']]);
}
return empty($taxes_data) ? false : $taxes_data;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:76,代码来源:fn.cart.php
示例10: content_55d5c7593563b3_67108128
function content_55d5c7593563b3_67108128($_smarty_tpl)
{
if (!is_callable('smarty_block_hook')) {
include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
}
fn_preload_lang_vars(array('enter_data', 'edit', 'section_is_not_completed', 'address_type', 'section_is_not_completed', 'ip_address', 'phone', 'fax', 'company', 'website', 'attention', 'notice_update_customer_details', 'update_customer_info', 'section_is_not_completed', 'select_customer', 'user_data_required', 'customer_information', 'shipping_address', 'billing_address'));
$_smarty_tpl->tpl_vars["profile_fields"] = new Smarty_variable(fn_get_profile_fields($_smarty_tpl->tpl_vars['location']->value), null, 0);
?>
<?php
if (!function_exists('smarty_template_function_profile_enter_data_link')) {
function smarty_template_function_profile_enter_data_link($_smarty_tpl, $params)
{
$saved_tpl_vars = $_smarty_tpl->tpl_vars;
foreach ($_smarty_tpl->smarty->template_functions['profile_enter_data_link']['parameter'] as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
}
foreach ($params as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
}
?>
<div class="btn-group"><a class="btn cm-dialog-opener" data-ca-target-id="customer_info" data-ca-scroll="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['scroll_to']->value, ENT_QUOTES, 'UTF-8');
?>
"><?php
echo $_smarty_tpl->__("enter_data");
?>
</a></div>
<?php
$_smarty_tpl->tpl_vars = $saved_tpl_vars;
foreach (Smarty::$global_tpl_vars as $key => $value) {
if (!isset($_smarty_tpl->tpl_vars[$key])) {
$_smarty_tpl->tpl_vars[$key] = $value;
}
}
}
}
?>
<?php
if (!function_exists('smarty_template_function_profile_edit_link')) {
function smarty_template_function_profile_edit_link($_smarty_tpl, $params)
{
$saved_tpl_vars = $_smarty_tpl->tpl_vars;
foreach ($_smarty_tpl->smarty->template_functions['profile_edit_link']['parameter'] as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
}
foreach ($params as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);
}
?>
<?php
if ($_smarty_tpl->tpl_vars['is_edit']->value) {
?>
<div class="pull-right">
<a class="hand cm-tooltip icon-edit cm-dialog-opener<?php
if ($_smarty_tpl->tpl_vars['click_to']->value) {
?>
cm-external-click<?php
}
?>
" data-ca-target-id="customer_info" data-ca-scroll="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['scroll_to']->value, ENT_QUOTES, 'UTF-8');
?>
" <?php
if ($_smarty_tpl->tpl_vars['click_to']->value) {
?>
data-ca-external-click-id="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['click_to']->value, ENT_QUOTES, 'UTF-8');
?>
"<?php
}
?>
title="<?php
echo $_smarty_tpl->__("edit");
?>
"></a>
</div>
<?php
}
$_smarty_tpl->tpl_vars = $saved_tpl_vars;
foreach (Smarty::$global_tpl_vars as $key => $value) {
if (!isset($_smarty_tpl->tpl_vars[$key])) {
$_smarty_tpl->tpl_vars[$key] = $value;
}
}
}
}
?>
<?php
$_smarty_tpl->_capture_stack[0][] = array("billing_address", null, null);
ob_start();
?>
<?php
$_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "order_management:profile_billing_address"));
$_block_repeat = true;
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:cff66015dc38034dc48d1f193569094281361eab.tygh.profiles_info.tpl.php
示例11: fn_checkout_get_display_steps
function fn_checkout_get_display_steps($profile_fields = array())
{
if (!$profile_fields) {
$profile_fields = fn_get_profile_fields('O');
}
$display_steps = array('step_one' => true, 'step_two' => true, 'step_three' => true, 'step_four' => true);
if (Registry::get('settings.Checkout.configure_sign_in_step') == 'hide') {
// Need to check profile fields
$required_fields = fn_get_profile_fields('O', array(), CART_LANGUAGE, array('get_checkout_required' => true));
if (empty($required_fields['C']) && Registry::get('settings.Checkout.disable_anonymous_checkout') != 'Y') {
$display_steps['step_one'] = false;
}
}
if (empty($profile_fields['B']) && empty($profile_fields['S'])) {
$display_steps['step_two'] = false;
}
if (Registry::get('settings.Checkout.display_shipping_step') != 'Y' && fn_allowed_for('ULTIMATE')) {
$display_steps['step_three'] = false;
}
if (Registry::get('settings.Checkout.display_payment_step') != 'Y') {
$display_steps['step_four'] = false;
}
return $display_steps;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:24,代码来源:fn.cart.php
示例12: fn_update_user
//.........这里部分代码省略.........
$user_data['lastname'] = empty($user_data['lastname']) && !empty($user_data[$address_zone . '_lastname']) ? $user_data[$address_zone . '_lastname'] : $user_data['lastname'];
}
if (!empty($user_data['phone']) || !empty($user_data[$address_zone . '_phone'])) {
$user_data['phone'] = empty($user_data['phone']) && !empty($user_data[$address_zone . '_phone']) ? $user_data[$address_zone . '_phone'] : $user_data['phone'];
}
// reset company_id for root admin
if ($user_id == 1) {
$user_data['company_id'] = 0;
}
if (!empty($user_id)) {
db_query("UPDATE ?:users SET ?u WHERE user_id = ?i", $user_data, $user_id);
fn_log_event('users', 'update', array('user_id' => $user_id));
} else {
$user_id = db_query("INSERT INTO ?:users ?e", $user_data);
fn_log_event('users', 'create', array('user_id' => $user_id));
}
$user_data['user_id'] = $user_id;
// Set/delete insecure password notification
if (AREA == 'A' && Registry::get('config.demo_mode') != true && !empty($user_data['user_login']) && !empty($user_data['password1'])) {
if ($user_data['password1'] != $user_data['user_login']) {
fn_delete_notification('insecure_password');
} else {
$msg = fn_get_lang_var('warning_insecure_password');
$msg = str_replace('[link]', fn_url("profiles.update?user_id=" . $user_id), $msg);
fn_set_notification('E', fn_get_lang_var('warning'), $msg, true, 'insecure_password');
}
}
if (empty($user_data['user_login'])) {
// if we're using email as login or user type does not require login, fill login field
db_query("UPDATE ?:users SET user_login = 'user_?i' WHERE user_id = ?i AND user_login = ''", $user_id, $user_id);
}
// Fill shipping info with billing if needed
if (empty($ship_to_another)) {
$profile_fields = fn_get_profile_fields($user_data['user_type']);
$use_default = AREA == 'A' ? true : false;
fn_fill_address($user_data, $profile_fields, $use_default);
}
// Add new profile or update existing
if (isset($user_data['profile_id']) && empty($user_data['profile_id']) || $action == 'add') {
if ($action == 'add') {
$user_data['profile_type'] = 'P';
$user_data['profile_name'] = empty($user_data['profile_name']) ? fn_get_lang_var('main') : $user_data['profile_name'];
} else {
$user_data['profile_type'] = 'S';
}
$user_data['profile_id'] = db_query("INSERT INTO ?:user_profiles ?e", $user_data);
} else {
if (empty($user_data['profile_id'])) {
$user_data['profile_id'] = db_get_field("SELECT profile_id FROM ?:user_profiles WHERE user_id = ?i AND profile_type = 'P'", $user_id);
}
db_query("UPDATE ?:user_profiles SET ?u WHERE profile_id = ?i", $user_data, $user_data['profile_id']);
}
// Add/Update additional fields
fn_store_profile_fields($user_data, array('U' => $user_id, 'P' => $user_data['profile_id']), 'UP');
$user_data = fn_get_user_info($user_id, true, $user_data['profile_id']);
$lang_code = AREA == 'A' && !empty($user_data['lang_code']) ? $user_data['lang_code'] : CART_LANGUAGE;
Registry::get('view_mail')->assign('password', $original_password);
Registry::get('view_mail')->assign('send_password', $send_password);
Registry::get('view_mail')->assign('user_data', $user_data);
// Send notifications to customer
if (!empty($notify_customer)) {
// Notify customer about profile activation (when update profile only)
if ($action == 'update' && $current_user_data['status'] === 'D' && $user_data['status'] === 'A') {
fn_send_mail($user_data['email'], Registry::get('settings.Company.company_users_department'), 'profiles/profile_activated_subj.tpl', 'profiles/profile_activated.tpl', '', $lang_code);
}
// Notify customer about profile add/update
开发者ID:diedsmiling,项目名称:busenika,代码行数:67,代码来源:fn.users.php
示例13: content_55d2f363d17ad1_09586894
function content_55d2f363d17ad1_09586894($_smarty_tpl)
{
if (!is_callable('smarty_modifier_replace')) {
include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/modifier.replace.php';
}
if (!is_callable('smarty_function_set_id')) {
include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
}
fn_preload_lang_vars(array('billing_address', 'shipping_address', 'shipping_method', 'billing_address', 'shipping_address', 'shipping_method'));
if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
$_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
ob_start();
if ($_smarty_tpl->tpl_vars['completed_steps']->value['step_two']) {
?>
<div class="ty-order-info">
<?php
$_smarty_tpl->tpl_vars["profile_fields"] = new Smarty_variable(fn_get_profile_fields("I"), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['profile_fields']->value['B']) {
?>
<h4 class="ty-order-info__title"><?php
echo $_smarty_tpl->__("billing_address");
?>
:</h4>
<ul id="tygh_billing_adress" class="ty-order-info__profile-field clearfix">
<?php
$_smarty_tpl->tpl_vars["field"] = new Smarty_Variable();
$_smarty_tpl->tpl_vars["field"]->_loop = false;
$_from = $_smarty_tpl->tpl_vars['profile_fields']->value['B'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars["field"]->key => $_smarty_tpl->tpl_vars["field"]->value) {
$_smarty_tpl->tpl_vars["field"]->_loop = true;
?>
<?php
$_smarty_tpl->tpl_vars["value"] = new Smarty_variable(fn_get_profile_field_value($_smarty_tpl->tpl_vars['cart']->value['user_data'], $_smarty_tpl->tpl_vars['field']->value), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['value']->value) {
?>
<li class="ty-order-info__profile-field-item <?php
echo htmlspecialchars(smarty_modifier_replace($_smarty_tpl->tpl_vars['field']->value['field_name'], "_", "-"), ENT_QUOTES, 'UTF-8');
?>
"><?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['value']->value, ENT_QUOTES, 'UTF-8');
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<hr class="shipping-adress__delim" />
<?php
}
?>
<?php
if ($_smarty_tpl->tpl_vars['profile_fields']->value['S']) {
?>
<h4 class="ty-order-info__title"><?php
echo $_smarty_tpl->__("shipping_address");
?>
:</h4>
<ul id="tygh_shipping_adress" class="ty-order-info__profile-field clearfix">
<?php
$_smarty_tpl->tpl_vars["field"] = new Smarty_Variable();
$_smarty_tpl->tpl_vars["field"]->_loop = false;
$_from = $_smarty_tpl->tpl_vars['profile_fields']->value['S'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars["field"]->key => $_smarty_tpl->tpl_vars["field"]->value) {
$_smarty_tpl->tpl_vars["field"]->_loop = true;
?>
<?php
$_smarty_tpl->tpl_vars["value"] = new Smarty_variable(fn_get_profile_field_value($_smarty_tpl->tpl_vars['cart']->value['user_data'], $_smarty_tpl->tpl_vars['field']->value), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['value']->value) {
?>
<li class="ty-order-info__profile-field-item <?php
echo htmlspecialchars(smarty_modifier_replace($_smarty_tpl->tpl_vars['field']->value['field_name'], "_", "-"), ENT_QUOTES, 'UTF-8');
?>
"><?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['value']->value, ENT_QUOTES, 'UTF-8');
?>
</li>
<?php
}
?>
<?php
}
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:5030594fd35965ced46079e167ee3cdc1233b86a.tygh.order_info.tpl.php
示例14: fn_twg_get_admin_settings
|
请发表评论