function zen_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { global $gBitDb; $address_query = "SELECT `entry_firstname` as `firstname`, `entry_lastname` as `lastname`,\n `entry_company` as `company`, `entry_street_address` as `street_address`,\n `entry_suburb` as `suburb`, `entry_city` as `city`, `entry_postcode` as `postcode`,\n `entry_state` as `state`, `entry_zone_id` as `zone_id`,\n `entry_country_id` as `country_id`\n FROM " . TABLE_ADDRESS_BOOK . "\n WHERE `customers_id` = ? AND `address_book_id` = ?"; $address = $gBitDb->query($address_query, array((int) $customers_id, (int) $address_id)); $format_id = zen_get_address_format_id($address->fields['country_id']); return zen_address_format($format_id, $address->fields, $html, $boln, $eoln); }
function zen_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { global $db; $address_query = "select entry_firstname as firstname, entry_lastname as lastname,\n entry_company as company, entry_street_address as street_address,\n entry_suburb as suburb, entry_city as city, entry_postcode as postcode,entry_phone as phone,\n entry_state as state, entry_zone_id as zone_id,\n entry_country_id as country_id\n from " . TABLE_ADDRESS_BOOK . "\n where customers_id = '" . (int) $customers_id . "'\n and address_book_id = '" . (int) $address_id . "'"; $address = $db->Execute($address_query); $format_id = zen_get_address_format_id($address->fields['country_id']); return zen_address_format($format_id, $address->fields, $html, $boln, $eoln); }
} // set cheapest last $selected_shipping = $shipping_modules->cheapest(); $shipping = $selected_shipping; if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') { $show_in = FILENAME_POPUP_SHIPPING_ESTIMATOR; } else { $show_in = FILENAME_SHOPPING_CART; } // if(sizeof($quotes)) { if ($_SESSION['customer_id']) { $addresses = $db->execute("select address_book_id, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'"); // only display addresses if more than 1 if ($addresses->RecordCount() > 1) { while (!$addresses->EOF) { $addresses_array[] = array('id' => $addresses->fields['address_book_id'], 'text' => zen_address_format(zen_get_address_format_id($addresses->fields['country_id']), $addresses->fields, 0, ' ', ' ')); $addresses->MoveNext(); } } } else { if ($_SESSION['cart']->get_content_type() != 'virtual') { $state_array[] = array('id' => '', 'text' => PULL_DOWN_SHIPPING_ESTIMATOR_SELECT); $state_values = $db->Execute("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int) $selected_country . "' order by zone_country_id DESC, zone_name"); while (!$state_values->EOF) { $state_array[] = array('id' => $state_values->fields['zone_id'], 'text' => $state_values->fields['zone_name']); $state_values->MoveNext(); } } } // } // This is done after quote-calcs in order to include Tare info accurately. NOTE: tare values are *not* included in weights shown on-screen.
$origin_href = zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']); // $origin_href = zen_back_link_only(true); $_SESSION['navigation']->clear_snapshot(); zen_redirect($origin_href); } zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL')); } if (sizeof($_SESSION['navigation']->snapshot) > 0) { $origin_href = zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']); //$_SESSION['navigation']->clear_snapshot(); } else { $origin_href = zen_href_link(FILENAME_DEFAULT); } // redirect customer to where they came from if their cart is not empty and they didn't click on create-account specifically if ($_SESSION['cart']->count_contents() > 0) { if ($origin_href != zen_href_link(FILENAME_DEFAULT)) { zen_redirect($origin_href); } } /* prepare address list */ $addresses_query = "SELECT address_book_id, entry_firstname as firstname, entry_lastname as lastname,\n entry_company as company, entry_street_address as street_address,\n entry_suburb as suburb, entry_city as city, entry_postcode as postcode,\n entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id\n FROM " . TABLE_ADDRESS_BOOK . "\n WHERE customers_id = :customersID\n ORDER BY firstname, lastname"; $addresses_query = $db->bindVars($addresses_query, ':customersID', $_SESSION['customer_id'], 'integer'); $addresses = $db->Execute($addresses_query); $addressArray = array(); while (!$addresses->EOF) { $format_id = zen_get_address_format_id($addresses->fields['country_id']); $addressArray[] = array('firstname' => $addresses->fields['firstname'], 'lastname' => $addresses->fields['lastname'], 'address_book_id' => $addresses->fields['address_book_id'], 'format_id' => $format_id, 'address' => $addresses->fields); $addresses->MoveNext(); } // This should be last line of the script: $zco_notifier->notify('NOTIFY_HEADER_END_CREATE_ACCOUNT_SUCCESS');
if ($addresses->fields['address_book_id'] == $_SESSION['sendto']) { echo '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"><div id="defaultSelected" class="moduleRowSelected">' . "\n"; } else { echo ' <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"><div class="moduleRow">' . "\n"; } ?> <div class="back"> <?php echo zen_draw_radio_field('address', $addresses->fields['address_book_id'], $addresses->fields['address_book_id'] == $_SESSION['sendto'], 'id="name-' . $addresses->fields['address_book_id'] . '"'); ?> <span class="add_title" style="margin-left:5px"> <label for="name-<?php echo $addresses->fields['address_book_id']; ?> "><?php echo zen_output_string_protected($addresses->fields['firstname'] . ' ' . $addresses->fields['lastname']); ?> </label> </span> </div> <address> <?php echo zen_address_format(zen_get_address_format_id($addresses->fields['country_id']), $addresses->fields, true, ' ', '<br />'); ?> </address> </div> </div> <!--end of divs in while loop --> <?php $addresses->MoveNext(); } ?> </div>
// totals info $totalsDisplay = ''; switch (true) { case (SHOW_TOTALS_IN_CART == '1'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; case (SHOW_TOTALS_IN_CART == '2'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; case (SHOW_TOTALS_IN_CART == '3'): $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total()); break; } */ $country_info = zen_get_countries($_POST['zone_country_id'], true); $order->delivery = array('postcode' => $zip_code, 'country' => array('id' => $_POST['zone_country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $_POST['zone_country_id'], 'zone_id' => $state_zone_id, 'format_id' => zen_get_address_format_id($_POST['zone_country_id'])); // weight and count needed for shipping ! $total_weight = $_SESSION['cart']->show_weight(); $shipping_estimator_display_weight = $total_weight; $total_count = $_SESSION['cart']->count_contents(); require DIR_WS_CLASSES . 'shipping.php'; $shipping_modules = new shipping(); $quotes = $shipping_modules->quote(); //4px shipping if (EXTRA_HOST_NOT_OURS) { //get services supply by 4px $dsf_shipping_query = "SELECT `dsf_shipping_id` FROM `dsf_shipping` WHERE `status`=1 order by `sort_index` desc,`dsf_shipping_code`"; $dsf_shipping_opens = $db->Execute($dsf_shipping_query); $data = array('countries_iso_code_2' => $country_info['countries_iso_code_2'], 'total_weight' => $total_weight); if (!$dsf_shipping_opens->EOF) { $dsf_shipping_open = '';
</div> </div> </li> <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT ** if (!$payment_modules->in_special_checkout()) { // ** END PAYPAL EXPRESS CHECKOUT ** ?> <li> <div id="checkoutBillto" class="margin_t big_"> <ul> <?php $billToArray = zen_get_address_fields($_SESSION['customer_id'], $_SESSION['billto']); echo '<b>' . $billToArray['firstname'] . ' ' . $billToArray['lastname'] . '</b>'; $billToArrayFiltered = filterName($billToArray); $format_id_bill = zen_get_address_format_id($billToArrayFiltered['country_id']); echo zen_address_format($format_id_bill, $billToArrayFiltered, true, ' ', '<br />'); echo '<br/>Phone: ' . $billToArray['phone']; ?> </ul> <?php if (MAX_ADDRESS_BOOK_ENTRIES >= 2) { ?> <ul class="pad_l_90px margin_t"><?php echo '<a href="' . zen_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'url=checkout_shipping&edit=' . $_SESSION['billto'], 'SSL') . '">' . zen_image($template->get_template_dir('btn_edit.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/button') . '/btn_edit.gif', '', '', '', ' border="0"') . '</a>'; ?> </ul> <?php } ?> </div>
<?php $gBitSystem->verifyPermission('p_bitcommerce_retailer'); require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceCommission.php'; if (count($_GET) > 2 || count($_POST) > 2) { $gBitUser->verifyTicket(); } $commissionManager = new CommerceCommission(); if (!empty($_REQUEST['save_commission_settings'])) { $gBitUser->storePreference('commissions_payment_method', $_REQUEST['commissions_payment_method']); if (!empty($_REQUEST['commissions_' . $_REQUEST['commissions_payment_method'] . '_address'])) { $gBitUser->storePreference('commissions_' . $_REQUEST['commissions_payment_method'] . '_address', $_REQUEST['commissions_' . $_REQUEST['commissions_payment_method'] . '_address']); } } $gBitSmarty->assign_by_ref('commissionList', $commissionManager->getHistory(array('user_id' => $gBitCustomer->mCustomerId))); if ($addresses = $gBitCustomer->getAddresses()) { foreach ($addresses as $addrId => $addr) { $addressList[$addr['address_book_id']] = zen_address_format(zen_get_address_format_id($addr['country_id']), $addr, 0, ' ', ' '); } $gBitSmarty->assign_by_ref('addressList', $addressList); $gBitSmarty->assign('defaultAddressId', $gBitUser->getPreference('commissions_check_address', $gBitCustomer->getDefaultAddress())); } $paymentOptions[''] = tra('Please Select Below...'); $paymentOptions['storecredit'] = tra('Store Credit'); $paymentOptions['paypal'] = tra('PayPal'); $paymentOptions['worldpay'] = tra('WorldPay'); $paymentOptions['check'] = tra('Check'); $gBitSmarty->assign('paymentOptions', $paymentOptions); define('HEADING_TITLE', tra('Commissions')); $gBitSmarty->display('bitpackage:bitcommerce/commissions.tpl');