private function processData($products) { if (!empty($products)) { $total = 0; foreach ($products as $aRow) { $row = array(); $row['id'] = $aRow['id']; $row['description'] = $aRow['description']; $row['amount'] = osc_format_price(1000000 * $aRow['amount'], osc_get_preference('currency', 'payment_pro')); $row['quantity'] = $aRow['quantity']; $row['total'] = osc_format_price(1000000 * $aRow['amount'] * $aRow['quantity'], osc_get_preference('currency', 'payment_pro')); $row['delete'] = '<a href="' . osc_route_url('payment-pro-cart-delete', array('id' => $aRow['id'])) . '" >' . __('Delete', 'payment_pro') . '</a>'; $row = osc_apply_filter('payment_pro_processing_row', $row, $aRow); $this->addRow($row); $this->rawRows[] = $aRow; $total += $aRow['amount'] * $aRow['quantity']; } $row = array(); $row['id'] = ''; $row['description'] = ''; $row['amount'] = ''; $row['quantity'] = '<b>' . __('Total', 'payment_pro') . '</b>'; $row['total'] = '<b>' . osc_format_price(1000000 * $total, osc_get_preference('currency', 'payment_pro')) . '</b>'; $row['delete'] = ''; $this->addRow($row); //$this->rawRows[] = $row; } }
public static function button($products, $extra = null) { if (count($products) == 1) { $p = current($products); $amount = $p['amount'] * $p['quantity']; $description = $p['description']; $product_id = $p['id']; //$ids = array(array('id' => $product_id)); } else { $amount = 0; //$ids = array(); foreach ($products as $p) { $amount += $p['amount'] * $p['quantity']; //$ids[] = array('id' => $p['id']); } $description = sprintf(__('%d products', 'payment_pro'), count($products)); $product_id = 'SVR_PRD'; } $r = rand(0, 1000); $extra['random'] = $r; //$extra['ids'] = $ids; $extra['items'] = $products; $extra['amount'] = $amount; $extra = payment_pro_set_custom($extra); echo '<li class="payment authorize-btn"><a href="javascript:authorize_pay(\'' . osc_format_price($amount * 1000000) . '\',\'' . $description . '\',\'' . $product_id . '\',\'' . $extra . '\');" ><img src="' . PAYMENT_PRO_URL . 'payments/authorize/button.gif" ></a></li>'; }
private function _invoiceRows($id, $currency) { $items = ModelPaymentPro::newInstance()->itemsByInvoice($id); $rows = ''; foreach ($items as $item) { $rows .= '<li>' . osc_format_price($item['i_amount'], $currency) . ' - ' . $item['i_product_type'] . ' - ' . $item['s_concept'] . '</li>'; } return '<ul>' . $rows . '</ul>'; }
} else { echo osc_item_contact_name(); } ?> </p> <p class="description"><?php echo osc_highlight(strip_tags(osc_item_description()), 110); ?> </p> <div class="row"> <div class="col-md-5 col-sm-5 col-xs-5 price"> <?php if (osc_price_enabled_at_items()) { ?> <span><?php echo osc_format_price(osc_item_price()); ?> </span><?php } ?> </div> <div class="col-md-7 col-sm-7 col-xs-7 location"> <i class="glyphicon glyphicon-map-marker"></i><?php if (osc_item_region()) { ?> <?php echo osc_item_region(); } else { ?> <?php echo osc_item_country();
/** * Gets formated price of current premium * * @return string */ function osc_premium_formated_price() { return (string) osc_format_price(osc_premium_field("i_price")); }
if (osc_premium_region() != '') { ?> (<?php echo osc_premium_region(); ?> )<?php } ?> </span> <span class="g-hide">-</span> <?php echo osc_format_date(osc_premium_pub_date()); ?> <?php if (osc_price_enabled_at_items()) { ?> <span class="currency-value"><?php echo osc_format_price(osc_premium_price()); ?> </span><?php } ?> </div> <p><?php echo osc_highlight(osc_premium_description(), 250); ?> </p> </div> <?php if ($admin) { ?> <span class="admin-options"> <a href="<?php
(<?php echo osc_premium_region(); ?> ) <?php } ?> </span> <span class="date"> <i class="fa fa-clock-o"></i> <?php echo osc_format_date(osc_premium_pub_date()); ?> </span> </article> <?php if (osc_price_enabled_at_items()) { ?> <span class="currency-value"><?php echo osc_format_price(osc_premium_price(), osc_premium_currency_symbol()); ?> </span> <?php } ?> <?php $admin = false; ?> <?php if ($admin) { ?> <span class="admin-options"> <a href="<?php echo osc_premium_edit_url(); ?> " rel="nofollow">
function fn_email_item_validation_non_register_user($item) { View::newInstance()->_exportVariableToView('item', $item); $mPages = new Page(); $aPage = $mPages->findByInternalName('email_item_validation_non_register_user'); $locale = osc_current_user_locale(); if(isset($aPage['locale'][$locale]['s_title'])) { $content = $aPage['locale'][$locale]; } else { $content = current($aPage['locale']); } $item_url = osc_item_url(); $item_url = '<a href="'.$item_url.'" >'.$item_url.'</a>'; $edit_url = osc_item_edit_url( $item['s_secret'], $item['pk_i_id'] ); $delete_url = osc_item_delete_url( $item['s_secret'], $item['pk_i_id'] ); $all = ''; if (isset($item['locale'])) { foreach ($item['locale'] as $locale => $data) { $locale_name = OSCLocale::newInstance()->findByCode($locale); $all .= '<br/>'; if (isset($locale_name[0]) && isset($locale_name[0]['s_name'])) { $all .= __('Language') . ': ' . $locale_name[0]['s_name'] . '<br/>'; } else { $all .= __('Language') . ': ' . $locale . '<br/>'; } $all .= __('Title') . ': ' . $data['s_title'] . '<br/>'; $all .= __('Description') . ': ' . $data['s_description'] . '<br/>'; $all .= '<br/>'; } } else { $all .= __('Title') . ': ' . $item['s_title'] . '<br/>'; $all .= __('Description') . ': ' . $item['s_description'] . '<br/>'; } // Format activation URL $validation_url = osc_item_activate_url( $item['s_secret'], $item['pk_i_id'] ); $words = array(); $words[] = array( '{ITEM_DESCRIPTION_ALL_LANGUAGES}', '{ITEM_DESCRIPTION}', '{ITEM_COUNTRY}', '{ITEM_PRICE}', '{ITEM_REGION}', '{ITEM_CITY}', '{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{ITEM_TITLE}', '{ITEM_URL}', '{VALIDATION_LINK}', '{VALIDATION_URL}', '{EDIT_LINK}', '{EDIT_URL}', '{DELETE_LINK}', '{DELETE_URL}' ); $words[] = array( $all, $item['s_description'], $item['s_country'], osc_format_price($item['i_price']), $item['s_region'], $item['s_city'], $item['pk_i_id'], $item['s_contact_name'], $item['s_contact_email'], $item['s_title'], $item_url, '<a href="' . $validation_url . '" >' . $validation_url . '</a>', $validation_url, '<a href="' . $edit_url . '">' . $edit_url . '</a>', $edit_url, '<a href="' . $delete_url . '">' . $delete_url . '</a>', $delete_url ); $title = osc_apply_filter('email_item_validation_non_register_user_title_after', osc_mailBeauty(osc_apply_filter('email_title', osc_apply_filter('email_item_validation_non_register_user_title', $content['s_title'], $item)), $words), $item); $body = osc_apply_filter('email_item_validation_non_register_user_description_after', osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_item_validation_non_register_user_description', $content['s_text'], $item)), $words), $item); $emailParams = array( 'subject' => $title, 'from' => _osc_from_email_aux(), 'to' => $item['s_contact_email'], 'to_name' => $item['s_contact_name'], 'body' => $body, 'alt_body' => $body ); osc_sendMail($emailParams); }
function osc_item_formated_price() { return osc_format_price(osc_item_field("f_price")); }
/** * Gets formated price of current item * * @return string */ function osc_item_formated_price() { return (string) osc_format_price(osc_item_price()); }
<h2><?php _e('Publish options', 'payment_pro'); ?> </h2> <div class="control-group"> <?php if ($payment_pro_premium_fee > 0) { ?> <div class="controls checkbox"> <input type="checkbox" name="payment_pro_make_premium" id="payment_pro_make_premium" value="1" checked="yes" /> <label><?php printf(__('Make this ad premium (+%s)', 'payment_pro'), osc_format_price($payment_pro_premium_fee * 1000000, osc_get_preference('currency', 'payment_pro'))); ?> </label> </div> <?php } if ($payment_pro_publish_fee > 0) { ?> <div class="controls checkbox"> <label><?php printf(__('Publishing this ad costs %s', 'payment_pro'), osc_format_price($payment_pro_publish_fee * 1000000, osc_get_preference('currency', 'payment_pro'))); ?> </label> </div> <?php } ?> </div>
/** * Gets formated price of current premium * * @return string */ function osc_premium_formated_price() { return (string) osc_format_price(osc_premium_field("i_price"), osc_premium_currency_symbol()); }
if (osc_get_preference("pack_price_2", 'payment_pro') != '' && osc_get_preference("pack_price_2", 'payment_pro') != '0') { $packs[] = osc_get_preference("pack_price_2", 'payment_pro'); } if (osc_get_preference("pack_price_3", 'payment_pro') != '' && osc_get_preference("pack_price_3", 'payment_pro') != '0') { $packs[] = osc_get_preference("pack_price_3", 'payment_pro'); } @($user = User::newInstance()->findByPrimaryKey(osc_logged_user_id())); $wallet = ModelPaymentPro::newInstance()->getWallet(osc_logged_user_id()); if (osc_get_preference('currency', 'payment_pro') == 'BTC') { $amount = isset($wallet['formatted_amount']) ? $wallet['formatted_amount'] : 0; $formatted_amount = payment_pro_format_btc($amount); $credit_msg = sprintf(__('Credit packs. Your current credit is %s', 'payment_pro'), $formatted_amount); } else { $amount = isset($wallet['i_amount']) ? $wallet['i_amount'] : 0; if ($amount != 0) { $formatted_amount = osc_format_price($amount / 1000000, osc_get_preference('currency', 'payment_pro')); $credit_msg = sprintf(__('Credit packs. Your current credit is %s', 'payment_pro'), $formatted_amount); } else { $credit_msg = __('Your wallet is empty. Buy some credits.', 'payment_pro'); } } ?> <h2><?php echo $credit_msg; ?> </h2> <?php $pack_n = 0; foreach ($packs as $pack) { $pack_n++;
/** * Gets formated price of current item * * @return string */ function osc_item_formated_price() { return (string) osc_format_price(osc_item_field("s_price")); }