本文整理汇总了PHP中formatprice函数的典型用法代码示例。如果您正苦于以下问题:PHP formatprice函数的具体用法?PHP formatprice怎么用?PHP formatprice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatprice函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getsdcrprice
/**
+----------------------------------------------------------
* 获取商品单价
*
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @param string $agencyid 机构id
* @param string $sdcrid 商家id
* @param string $produreid 商品id
* @param string $producetype 商品类型id
* @param string $storageid 商品仓库id
* @param string $pricetype 价格类型 (0=本位价格,20=令价,21=吨价)
+----------------------------------------------------------
* @return string
+----------------------------------------------------------
*/
function getsdcrprice($agencyid, $sdcrid, $produreid, $producetype, $storageid, $pricetype = 0)
{
global $g_lprice_point;
global $g_dprice_point;
$db = new DB_test();
$query = "select fd_nbsepe_sdcrid,fd_nbsepe_produreid,fd_produre_catalog,fd_nbsepe_lingprice,fd_nbsepe_dunprice,fd_produre_unit\n\t\t\t from tb_websaleprice left join tb_produre on fd_produre_id = fd_nbsepe_produreid\n\t\t\t where fd_nbsepe_iskc = '1' and fd_nbsepe_sdcrid = '" . $sdcrid . "'\n\t\t\t and fd_nbsepe_produreid = '" . $produreid . "' and fd_nbsepe_producetype = '" . $producetype . "' \n\t\t\t and fd_nbsepe_isshow='1'";
// echo $query;
$db->query($query);
if ($db->nf()) {
while ($db->next_record()) {
$areaid = $db->f(fd_nbsepe_sdcrid);
$produreid = $db->f(fd_nbsepe_produreid);
$boxprocaid = $db->f(fd_produre_catalog);
$unitid = $db->f(fd_produre_unit);
if ($unitid == 20) {
$returnvalue = round($db->f(fd_nbsepe_lingprice) * 1.04, 3);
}
if ($unitid == 21) {
$returnvalue = round($db->f(fd_nbsepe_dunprice) * 1.04, 0);
}
if ($pricetype == 20) {
$returnvalue = round($db->f(fd_nbsepe_lingprice) * 1.04, 3);
}
if ($pricetype == 21) {
$returnvalue = round($db->f(fd_nbsepe_dunprice) * 1.04, 0);
}
}
}
$dbshop = new DB_shop();
$query = "select fd_skqy_lingprice ,fd_skqy_dunprice,fd_skqy_unitid,\n\t\t\tfd_skqy_shopid,fd_skqy_commid ,fd_skqy_rate \n\t\t\tfrom tb_shopkcquantity where fd_skqy_shopid = '{$sdcrid}' and fd_skqy_commid= '{$produreid}'\n\t\t\tand fd_skqy_producetype = '{$producetype}' and fd_skqy_storageid= '{$storageid}'\n\t\t\t";
$dbshop->query($query);
if ($dbshop->nf()) {
while ($dbshop->next_record()) {
$unitid = $dbshop->f(fd_skqy_unitid);
$vlingprice = $dbshop->f(fd_skqy_lingprice);
$vdunprice = $dbshop->f(fd_skqy_dunprice);
$rate = $dbshop->f(fd_skqy_rate);
if ($unitid == 20) {
$returnvalue = formatprice($vlingprice * $rate, $g_lprice_point);
}
if ($unitid == 21) {
$returnvalue = formatprice($vdunprice * $rate, $g_dprice_point);
}
if ($pricetype == 20) {
$returnvalue = formatprice($vlingprice * $rate, $g_lprice_point);
}
if ($pricetype == 21) {
$returnvalue = formatprice($vdunprice * $rate, $g_dprice_point);
}
}
}
return $returnvalue + 0;
}
开发者ID:Xiaoyuyexi,项目名称:client-server,代码行数:70,代码来源:ProPrice.class.php
示例2: ajax_attrib_select_and_price
/**
* get attributes html selects, price for select attribute
*/
function ajax_attrib_select_and_price()
{
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
$product_id = JRequest::getInt('product_id');
$change_attr = JRequest::getInt('change_attr');
if ($jshopConfig->use_decimal_qty) {
$qty = floatval(str_replace(",", ".", JRequest::getVar('qty', 1)));
} else {
$qty = JRequest::getInt('qty', 1);
}
if ($qty < 0) {
$qty = 0;
}
$attribs = JRequest::getVar('attr');
if (!is_array($attribs)) {
$attribs = array();
}
$freeattr = JRequest::getVar('freeattr');
if (!is_array($freeattr)) {
$freeattr = array();
}
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib', array(&$product_id, &$change_attr, &$qty, &$attribs, &$freeattr));
$product = JSFactory::getTable('product', 'jshop');
$product->load($product_id);
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib2', array(&$product));
$attributesDatas = $product->getAttributesDatas($attribs);
$product->setAttributeActive($attributesDatas['attributeActive']);
$attributeValues = $attributesDatas['attributeValues'];
$product->setFreeAttributeActive($freeattr);
$attributes = $product->getBuildSelectAttributes($attributeValues, $attributesDatas['attributeSelected']);
$rows = array();
foreach ($attributes as $k => $v) {
$rows[] = '"id_' . $k . '":"' . json_value_encode($v->selects, 1) . '"';
}
$pricefloat = $product->getPrice($qty, 1, 1, 1);
$price = formatprice($pricefloat);
$available = intval($product->getQty() > 0);
$displaybuttons = intval(intval($product->getQty() > 0) || $jshopConfig->hide_buy_not_avaible_stock == 0);
$ean = $product->getEan();
$weight = formatweight($product->getWeight());
$basicprice = formatprice($product->getBasicPrice());
$min_kolichestvo = $product->min_kolichestvo;
$rows[] = '"price":"' . json_value_encode($price) . '"';
$rows[] = '"pricefloat":"' . $pricefloat . '"';
$rows[] = '"available":"' . $available . '"';
$rows[] = '"min_kolichestvo":"' . $min_kolichestvo . '"';
$rows[] = '"ean":"' . json_value_encode($ean) . '"';
if ($jshopConfig->admin_show_product_basic_price) {
$rows[] = '"basicprice":"' . json_value_encode($basicprice) . '"';
}
if ($jshopConfig->product_show_weight) {
$rows[] = '"weight":"' . json_value_encode($weight) . '"';
}
if ($jshopConfig->product_list_show_price_default && $product->product_price_default > 0) {
$rows[] = '"pricedefault":"' . json_value_encode(formatprice($product->product_price_default)) . '"';
}
if ($jshopConfig->product_show_qty_stock) {
$qty_in_stock = getDataProductQtyInStock($product);
$rows[] = '"qty":"' . json_value_encode(sprintQtyInStock($qty_in_stock)) . '"';
}
$product->updateOtherPricesIncludeAllFactors();
if (is_array($product->product_add_prices)) {
foreach ($product->product_add_prices as $k => $v) {
$rows[] = '"pq_' . $v->product_quantity_start . '":"' . json_value_encode(formatprice($v->price)) . '"';
}
}
if ($product->product_old_price) {
$old_price = formatprice($product->product_old_price);
$rows[] = '"oldprice":"' . json_value_encode($old_price) . '"';
}
$rows[] = '"displaybuttons":"' . $displaybuttons . '"';
if ($jshopConfig->hide_delivery_time_out_of_stock) {
$rows[] = '"showdeliverytime":"' . $product->getDeliveryTimeId() . '"';
}
if ($jshopConfig->use_extend_attribute_data) {
$template_path = $jshopConfig->template_path . $jshopConfig->template . "/product";
$images = $product->getImages();
$videos = $product->getVideos();
$demofiles = $product->getDemoFiles();
$tmp = array();
foreach ($images as $img) {
$tmp[] = '"' . $img->image_name . '"';
}
if (!file_exists($template_path . "/block_image_thumb.php")) {
$displayimgthumb = intval(count($images) > 1 || count($videos) && count($images));
$rows[] = '"images":[' . implode(",", $tmp) . '],"displayimgthumb":"' . $displayimgthumb . '"';
}
$view_name = "product";
$view_config = array("template_path" => $template_path);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
$view->setLayout("demofiles");
$view->assign('config', $jshopConfig);
$view->assign('demofiles', $demofiles);
$demofiles = $view->loadTemplate();
$rows[] = '"demofiles":"' . json_value_encode($demofiles, 1) . '"';
//.........这里部分代码省略.........
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:101,代码来源:product.php
示例3: formatprice
print _JSHOP_EAN;
?>
: <span id="product_code"><?php
print $this->product->getEan();
?>
</span>
</div>
<div class="prod_price" style="margin-bottom:20px;">
<?php
print _JSHOP_PRICE;
?>
:
<span id="block_price">
<?php
print formatprice($this->product->getPriceCalculate());
?>
</span>
</div>
<div class="jshop_prod_attributes jshop">
<?php
foreach ($this->attributes as $attribut) {
?>
<div class = "row-fluid">
<div class="span2 attributes_title">
<span class="attributes_name" id="attr_name_id_<?php
print $attribut->attr_id;
?>
"><?php
print $attribut->attr_name;
开发者ID:olegverstka,项目名称:monax.dev,代码行数:31,代码来源:product_attribute_select.php
示例4: sprintBasicPrice
print sprintBasicPrice($prod);
?>
</span></div>
<?php
}
?>
</td>
<td>
<?php
print $prod['quantity'];
print $prod['_qty_unit'];
?>
</td>
<td>
<?php
print formatprice($prod['price'] * $prod['quantity']);
?>
<?php
print $prod['_ext_price_total_html'];
?>
<?php
if ($this->config->show_tax_product_in_cart && $prod['tax'] > 0) {
?>
<span class="taxinfo"><?php
print productTaxInfo($prod['tax']);
?>
</span>
<?php
}
?>
</td>
开发者ID:Tommar,项目名称:vino2,代码行数:31,代码来源:wishlist.php
示例5: formatprice
</th>
<th style="text-align:right;">
<?php
echo formatprice($total_sum_m);
?>
</th>
<th style="text-align:right;">
<?php
echo $total_y;
?>
</th>
<th style="text-align:right;">
<?php
echo formatprice($total_sum_y);
?>
</th>
</tr>
</table>
</fieldset>
</div>
<div style="width:40%; float:left;">
<div style="padding-left:5px;">
<fieldset class="adminform">
<legend><?php
echo _JSHOP_INVENTORY;
?>
</legend>
<table style="width:100%;">
开发者ID:JexyRu,项目名称:jshop-updates,代码行数:31,代码来源:default.php
示例6: formatprice
?>
<td>
<?php
if ($row->unlimited) {
print _JSHOP_UNLIMITED;
} else {
echo $row->qty;
}
?>
</td>
<?php
}
?>
<td>
<?php
echo formatprice($row->product_price, sprintCurrency($row->currency_id));
?>
</td>
<td>
<?php
echo $row->hits;
?>
</td>
<td>
<?php
echo formatdate($row->product_date_added, 1);
?>
</td>
<?php
if ($category_id) {
?>
开发者ID:olegverstka,项目名称:monax.dev,代码行数:31,代码来源:default.php
示例7: formatprice
</tr>
<?php
}
?>
<?php
if ($this->free_discount > 0) {
?>
<tr class="free_discount">
<td colspan="2" align="right">
<span class="free_discount"><?php
print _JSHOP_FREE_DISCOUNT;
?>
: <?php
print formatprice($this->free_discount);
?>
</span>
</td>
</tr>
<?php
}
?>
</table>
<?php
} else {
?>
<div class="cart_empty_text"><?php
print _JSHOP_CART_EMPTY;
?>
开发者ID:aldegtyarev,项目名称:vip-kvartira,代码行数:31,代码来源:cart.php
示例8: formatweight
- <?php
print formatweight($price->shipping_weight_to);
?>
<?php
} else {
?>
<?php
print _JSHOP_FROM . " " . formatweight($price->shipping_weight_from);
?>
<?php
}
?>
</td>
<td class="price">
<?php
print formatprice($price->shipping_price);
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
<div class="shipping_descr"><?php
print $shipping->description;
?>
</div>
开发者ID:olegverstka,项目名称:monax.dev,代码行数:31,代码来源:shippings.php
示例9: formatprice
?>
</td>
</tr>
<?php
}
}
?>
<tr class="bold">
<td colspan="4" class="right">
<?php
echo _JSHOP_TOTAL;
?>
</td>
<td class="left">
<?php
echo formatprice($order->order_total, $order->currency_code);
print $this->_tmp_ext_total;
?>
</td>
</tr>
<?php
print $this->_tmp_html_after_total;
?>
</table>
<?php
}
?>
<br/>
<table class="adminlist">
<thead>
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:show.php
示例10: formatweight
- <?php
echo formatweight($price->shipping_weight_to);
?>
<?php
} else {
?>
<?php
echo _JSHOP_FROM . " " . formatweight($price->shipping_weight_from);
?>
<?php
}
?>
</div>
<div class="price">
<?php
echo formatprice($price->shipping_price);
?>
</div>
<?php
}
?>
</div>
<?php
}
?>
<div class="shipping_descr"><?php
echo $shipping->description;
?>
</div>
<div id="shipping_form_<?php
print $shipping->shipping_id;
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:shippings.php
示例11: formatprice
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
}
?>
<div class="myorders_total">
<?php
print _JSHOP_TOTAL;
?>
: <span><?php
print formatprice($this->total, getMainCurrencyCode());
?>
</span>
</div>
<?php
} else {
?>
<div class="myorders_no_orders">
<?php
print _JSHOP_NO_ORDERS;
?>
</div>
<?php
}
?>
<?php
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:listorder.php
示例12: getBuildSelectAttributes
function getBuildSelectAttributes($attributeValues, $attributeActive, $displayonlyattrtype = null)
{
$jshopConfig = JSFactory::getConfig();
if (!$jshopConfig->admin_show_attributes) {
return array();
}
$dispatcher = JDispatcher::getInstance();
$attrib = JSFactory::getAllAttributes();
$userShop = JSFactory::getUserShop();
$selects = array();
foreach ($attrib as $k => $v) {
$attr_id = $v->attr_id;
if ($displayonlyattrtype) {
$v->attr_type = $displayonlyattrtype;
}
if (isset($attributeValues[$attr_id]) && $attributeValues[$attr_id]) {
if (isset($attributeActive[$attr_id])) {
$_firstval = $attributeActive[$attr_id];
} else {
$_firstval = 0;
}
$selects[$attr_id] = new stdClass();
$selects[$attr_id]->attr_id = $attr_id;
$selects[$attr_id]->attr_name = $v->name;
$selects[$attr_id]->attr_description = $v->description;
$selects[$attr_id]->groupname = $v->groupname;
$selects[$attr_id]->firstval = $_firstval;
$options = $attributeValues[$attr_id];
$attrimage = array();
foreach ($options as $k2 => $v2) {
$attrimage[$v2->val_id] = $v2->image;
$addPrice = $v2->addprice;
$addPrice = getPriceFromCurrency($addPrice, $this->currency_id);
$addPrice = getPriceCalcParamsTax($addPrice, $this->product_tax_id);
if ($userShop->percent_discount) {
$addPrice = getPriceDiscount($addPrice, $userShop->percent_discount);
}
$options[$k2]->addprice = $addPrice;
}
if ($v->attr_type == 1) {
// attribut type select
if ($jshopConfig->attr_display_addprice) {
foreach ($options as $k2 => $v2) {
if (($v2->price_mod == "+" || $v2->price_mod == "-" || $jshopConfig->attr_display_addprice_all_sign) && $v2->addprice > 0) {
$ext_price_info = " (" . $v2->price_mod . formatprice($v2->addprice, null, 0, -1) . ")";
$options[$k2]->value_name .= $ext_price_info;
}
}
}
if ($jshopConfig->product_attribut_first_value_empty) {
$first = array();
$first[] = JHTML::_('select.option', '0', _JSHOP_SELECT, 'val_id', 'value_name');
$options = array_merge($first, $options);
}
if (isset($attributeActive[$attr_id]) && isset($attrimage[$attributeActive[$attr_id]])) {
$_active_image = $attrimage[$attributeActive[$attr_id]];
} else {
$_active_image = '';
}
if (isset($attributeActive[$attr_id])) {
$_select_active = $attributeActive[$attr_id];
} else {
$_select_active = '';
}
$html_select_attribute_param = 'class="' . $jshopConfig->frontend_attribute_select_class_css . '" size = "' . $jshopConfig->frontend_attribute_select_size . '" onchange="setAttrValue(\'' . $attr_id . '\', this.value);"';
$selects[$attr_id]->selects = JHTML::_('select.genericlist', $options, 'jshop_attr_id[' . $attr_id . ']', $html_select_attribute_param, 'val_id', 'value_name', $_select_active) . "<span class='prod_attr_img'>" . $this->getHtmlDisplayProdAttrImg($attr_id, $_active_image) . "</span>";
$selects[$attr_id]->selects = str_replace(array("\n", "\r", "\t"), "", $selects[$attr_id]->selects);
} else {
// attribut type radio
foreach ($options as $k2 => $v2) {
if ($v2->image) {
$options[$k2]->value_name = "<img src='" . $jshopConfig->image_attributes_live_path . "/" . $v2->image . "' alt='' /> " . $v2->value_name;
}
}
if ($jshopConfig->attr_display_addprice) {
foreach ($options as $k2 => $v2) {
if (($v2->price_mod == "+" || $v2->price_mod == "-" || $jshopConfig->attr_display_addprice_all_sign) && $v2->addprice > 0) {
$ext_price_info = " (" . $v2->price_mod . formatprice($v2->addprice) . ")";
$options[$k2]->value_name .= $ext_price_info;
}
}
}
$radioseparator = '';
if ($jshopConfig->radio_attr_value_vertical) {
$radioseparator = "<br/>";
}
foreach ($options as $k2 => $v2) {
$options[$k2]->value_name = "<span class='radio_attr_label'>" . $v2->value_name . "</span>";
}
$selects[$attr_id]->selects = sprintRadioList($options, 'jshop_attr_id[' . $attr_id . ']', 'onclick="setAttrValue(\'' . $attr_id . '\', this.value);"', 'val_id', 'value_name', $attributeActive[$attr_id], $radioseparator);
$selects[$attr_id]->selects = str_replace(array("\n", "\r", "\t"), "", $selects[$attr_id]->selects);
}
$dispatcher->trigger('onBuildSelectAttribute', array(&$attributeValues, &$attributeActive, &$selects, &$options, &$attr_id, &$v));
}
}
$grname = '';
foreach ($selects as $k => $v) {
if ($v->groupname != $grname) {
$grname = $v->groupname;
$selects[$k]->grshow = 1;
//.........这里部分代码省略.........
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:101,代码来源:product.php
示例13: getCheckoutListPayments
public function getCheckoutListPayments()
{
$jshopConfig = JSFactory::getConfig();
$cart = $this->getCart();
$paymentmethod = JSFactory::getTable('paymentmethod', 'jshop');
$shipping_id = $cart->getShippingId();
$all_payment_methods = $paymentmethod->getAllPaymentMethods(1, $shipping_id);
$i = 0;
$paym = array();
foreach ($all_payment_methods as $pm) {
$paym[$i] = new stdClass();
if ($pm->scriptname != '') {
$scriptname = $pm->scriptname;
} else {
$scriptname = $pm->payment_class;
}
$paymentmethod->load($pm->payment_id);
$paymentsysdata = $paymentmethod->getPaymentSystemData($scriptname);
if ($paymentsysdata->paymentSystem) {
$paym[$i]->existentcheckform = 1;
$paym[$i]->payment_system = $paymentsysdata->paymentSystem;
} else {
$paym[$i]->existentcheckform = 0;
}
$paym[$i]->name = $pm->name;
$paym[$i]->payment_id = $pm->payment_id;
$paym[$i]->payment_class = $pm->payment_class;
$paym[$i]->scriptname = $pm->scriptname;
$paym[$i]->payment_description = $pm->description;
$paym[$i]->price_type = $pm->price_type;
$paym[$i]->image = $pm->image;
$paym[$i]->price_add_text = '';
if ($pm->price_type == 2) {
$paym[$i]->calculeprice = $pm->price;
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . $paym[$i]->calculeprice . '%';
} else {
$paym[$i]->price_add_text = $paym[$i]->calculeprice . '%';
}
}
} else {
$paym[$i]->calculeprice = getPriceCalcParamsTax($pm->price * $jshopConfig->currency_value, $pm->tax_id, $cart->products);
if ($paym[$i]->calculeprice != 0) {
if ($paym[$i]->calculeprice > 0) {
$paym[$i]->price_add_text = '+' . formatprice($paym[$i]->calculeprice);
} else {
$paym[$i]->price_add_text = formatprice($paym[$i]->calculeprice);
}
}
}
$s_payment_method_id = $cart->getPaymentId();
if ($s_payment_method_id == $pm->payment_id) {
$params = $cart->getPaymentParams();
} else {
$params = array();
}
$parseString = new parseString($pm->payment_params);
$pmconfig = $parseString->parseStringToParams();
if ($paym[$i]->existentcheckform) {
$paym[$i]->form = $paymentmethod->loadPaymentForm($paym[$i]->payment_system, $params, $pmconfig);
} else {
$paym[$i]->form = "";
}
$i++;
}
return $paym;
}
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:68,代码来源:checkoutpayment.php
示例14: formatprice
&shipping_id_back=<?php
print $this->shipping_id_back;
?>
"><?php
echo $sh_price->name;
?>
</a>
</td>
<td>
<?php
print $sh_price->countries;
?>
</td>
<td>
<?php
print formatprice($sh_price->shipping_stand_price);
?>
</td>
<td align="center">
<a href='index.php?option=com_jshopping&controller=shippingsprices&task=edit&sh_pr_method_id=<?php
echo $sh_price->sh_pr_method_id;
?>
&shipping_id_back=<?php
print $this->shipping_id_back;
?>
'><img src='components/com_jshopping/images/icon-16-edit.png'></a>
</td>
<td align="center">
<?php
print $sh_price->sh_pr_method_id;
?>
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:list.php
示例15: confirm
print $prod['href_delete'];
?>
" class="cart-delete" onclick="return confirm('<?php
print _JSHOP_CONFIRM_REMOVE;
?>
')"><i class="fa fa-trash-o"></i></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="text-right">
Сумма <span class="product-card-price"><?php
print formatprice($this->summ);
?>
</span><br><br>
<input type="submit" class="btn btn-success" value="Оформить заказ">
</div>
<?php
print $this->_tmp_html_after_buttons;
} else {
?>
<div class="alert alert-info text-center" role="alert">
<?php
print _JSHOP_CART_EMPTY;
?>
</div>
<?php
}
开发者ID:arkane0906,项目名称:lasercut-bootstrap,代码行数:31,代码来源:cart.php
示例16: generatePDF
//.........这里部分代码省略.........
$pdf->MultiCell($width_filename, 4, $prod->product_name, 0, 'L');
if ($prod->manufacturer != '') {
$pdf->SetXY(20, $pdf->getY());
$pdf->MultiCell($width_filename, 4, _JSHOP_MANUFACTURER . ": " . $prod->manufacturer, 0, 'L');
}
if ($prod->product_attributes != "" || $prod->product_freeattributes != "" || $prod->delivery_time || $prod->extra_fields != '') {
if ($prod->delivery_time) {
$pdt = _JSHOP_DELIVERY_TIME . ": " . $prod->delivery_time;
} else {
$pdt = "";
}
$pdf->SetXY(23, $pdf->getY());
$pdf->SetFont('freesans', '', 6);
$attribute = sprintAtributeInOrder($prod->product_attributes, "pdf");
$attribute .= sprintFreeAtributeInOrder($prod->product_freeattributes, "pdf");
$attribute .= sprintExtraFiledsInOrder($prod->extra_fields, "pdf");
$attribute .= $prod->_ext_attribute;
$attribute .= $pdt;
$pdf->MultiCell(62, 4, $attribute, 0, 'L');
$pdf->SetFont('freesans', '', 7);
}
$y2 = $pdf->getY() + 2;
if ($jshopConfig->show_product_code_in_order) {
$pdf->SetXY(85, $y + 2);
$pdf->MultiCell(22, 4, $prod->product_ean, 0, 'L');
$y3 = $pdf->getY() + 2;
} else {
$y3 = $pdf->getY();
}
$pdf->SetXY(107, $y + 2);
$pdf->MultiCell(18, 4, formatqty($prod->product_quantity) . $prod->_qty_unit, 0, 'L');
$y4 = $pdf->getY() + 2;
$pdf->SetXY(125, $y + 2);
$pdf->MultiCell(25, 4, formatprice($prod->product_item_price, $order->currency_code), 0, 'L');
if ($prod->_ext_price) {
$pdf->SetXY(125, $pdf->getY());
$pdf->MultiCell(25, 4, $prod->_ext_price, 0, 'R');
}
if ($jshopConfig->show_tax_product_in_cart && $prod->product_tax > 0) {
$pdf->SetXY(125, $pdf->getY());
$pdf->SetFont('freesans', '', 6);
$text = productTaxInfo($prod->product_tax, $order->display_price);
$pdf->MultiCell(25, 4, $text, 0, 'L');
}
if ($jshopConfig->cart_basic_price_show && $prod->basicprice > 0) {
$pdf->SetXY(125, $pdf->getY());
$pdf->SetFont('freesans', '', 6);
$text = _JSHOP_BASIC_PRICE . ": " . sprintBasicPrice($prod);
$pdf->MultiCell(25, 4, $text, 0, 'L');
}
$y5 = $pdf->getY() + 2;
$pdf->SetFont('freesans', '', 7);
$pdf->SetXY(150, $y + 2);
$pdf->MultiCell(40, 4, formatprice($prod->product_quantity * $prod->product_item_price, $order->currency_code), 0, 'R');
if ($prod->_ext_price_total) {
$pdf->SetXY(150, $pdf->getY());
$pdf->MultiCell(40, 4, $prod->_ext_price_total, 0, 'R');
}
if ($jshopConfig->show_tax_product_in_cart && $prod->product_tax > 0) {
$pdf->SetXY(150, $pdf->getY());
$pdf->SetFont('freesans', '', 6);
$text = productTaxInfo($prod->product_tax, $order->display_price);
$pdf->MultiCell(40, 4, $text, 0, 'R');
}
$y6 = $pdf->getY() + 2;
$yn = max($y2, $y3, $y4, $y5, $y6);
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:67,代码来源:generete_pdf_order.php
示例17: ajax_attrib_select_and_price
function ajax_attrib_select_and_price()
{
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
$display_price = JRequest::getVar('display_price');
$jshopConfig->setDisplayPriceFront($display_price);
$product_id = JRequest::getInt('product_id');
$change_attr = JRequest::getInt('change_attr');
if ($jshopConfig->use_decimal_qty) {
$qty = floatval(str_replace(",", ".", JRequest::getVar('qty', 1)));
} else {
$qty = JRequest::getInt('qty', 1);
}
if ($qty < 0) {
$qty = 1;
}
$attribs = JRequest::getVar('attr');
if (!is_array($attribs)) {
$attribs = array();
}
$freeattr = array();
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib', array(&$product_id, &$change_attr, &$qty, &$attribs, &$freeattr));
$product = JSFactory::getTable('product', 'jshop');
$product->load($product_id);
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib2', array(&$product));
$attributesDatas = $product->getAttributesDatas($attribs);
$product->setAttributeActive($attributesDatas['attributeActive']);
$attributeValues = $attributesDatas['attributeValues'];
$product->setFreeAttributeActive($freeattr);
$attributes = $product->getBuildSelectAttributes($attributeValues, $attributesDatas['attributeSelected'], 1);
$rows = array();
foreach ($attributes as $k => $v) {
$rows[] = '"id_' . $k . '":"' . json_value_encode($v->selects, 1) . '"';
}
$pricefloat = $product->getPrice($qty, 1, 1, 1);
$price = formatprice($pricefloat);
$available = intval($product->getQty() > 0);
$ean = $product->getEan();
$weight = $product->getWeight();
$rows[] = '"price":"' . json_value_encode($price) . '"';
$rows[] = '"pricefloat":"' . $pricefloat . '"';
$rows[] = '"available":"' . $available . '"';
$rows[] = '"ean":"' . json_value_encode($ean) . '"';
$rows[] = '"weight":"' . json_value_encode($weight) . '"';
$qty_in_stock = getDataProductQtyInStock($product);
$rows[] = '"qty":"' . json_value_encode(sprintQtyInStock($qty_in_stock)) . '"';
$product->updateOtherPricesIncludeAllFactors();
$dispatcher->trigger('onBeforeDisplayAjaxAttrib', array(&$rows, &$product));
print '{' . implode(",", $rows) . '}';
die;
}
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:52,代码来源:products.php
示例18: ajax_attrib_select_and_price
/**
* get attributes html selects, price for select attribute
*/
function ajax_attrib_select_and_price()
{
$db = JFactory::getDBO();
$jshopConfig = JSFactory::getConfig();
$product_id = JRequest::getInt('product_id');
$change_attr = JRequest::getInt('change_attr');
if ($jshopConfig->use_decimal_qty) {
$qty = floatval(str_replace(",", ".", JRequest::getVar('qty', 1)));
} else {
$qty = JRequest::getInt('qty', 1);
}
if ($qty < 0) {
$qty = 0;
}
$attribs = JRequest::getVar('attr');
if (!is_array($attribs)) {
$attribs = array();
}
$freeattr = JRequest::getVar('freeattr');
if (!is_array($freeattr)) {
$freeattr = array();
}
JPluginHelper::importPlugin('jshoppingproducts');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib', array(&$product_id, &$change_attr, &$qty, &$attribs, &$freeattr));
$product = JTable::getInstance('product', 'jshop');
$product->load($product_id);
$dispatcher->trigger('onBeforeLoadDisplayAjaxAttrib2', array(&$product));
$attributesDatas = $product->getAttributesDatas($attribs);
$product->setAttributeActive($attributesDatas['attributeActive']);
$attributeValues = $attributesDatas['attributeValues'];
$product->setFreeAttributeActive($freeattr);
$attributes = $product->getBuildSelectAttributes($attributeValues, $attributesDatas['attributeSelected']);
$rows = array();
foreach ($attributes as $k => $v) {
$v->selects = str_replace(array("\n", "\r", "\t"), "", $v->selects);
$rows[] = '"id_' . $k . '":"' . str_replace('"', '\\"', $v->selects) . '"';
}
$pricefloat = $product->getPrice($qty, 1, 1, 1);
$price = formatprice($pricefloat);
$available = intval($product->getQty() > 0);
$displaybuttons = intval(intval($product->getQty() > 0) || $jshopConfig->hide_buy_not_avaible_stock == 0);
$ean = $product->getEan();
$weight = formatweight($product->getWeight());
$basicprice = formatprice($product->getBasicPrice());
$rows[] = '"price":"' . $price . '"';
$rows[] = '"pricefloat":"' . $pricefloat . '"';
$rows[] = '"available":"' . $available . '"';
$rows[] = '"ean":"' . $ean . '"';
if ($jshopConfig->admin_show_product_basic_price) {
$rows[] = '"basicprice":"' . $basicprice . '"';
}
if ($jshopConfig->product_show_weight) {
$rows[] = '"weight":"' . $weight . '"';
}
if ($jshopConfig->product_list_show_price_default && $product->product_price_default > 0) {
$rows[] = '"pricedefault":"' . formatprice($product->product_price_default) . '"';
}
if ($jshopConfig->product_show_qty_stock) {
$qty_in_stock = getDataProductQtyInStock($product);
$rows[] = '"qty":"' . sprintQtyInStock($qty_in_stock) . '"';
}
$product->updateOtherPricesIncludeAllFactors();
if (is_array($product->product_add_prices)) {
foreach ($product->product_add_prices as $k => $v) {
$rows[] = '"pq_' . $v->product_quantity_start . '":"' . str_replace('"', '\\"', formatprice($v->price)) . '"';
}
}
if ($product->product_old_price) {
$old_price = formatprice($product->product_old_price);
$rows[] = '"oldprice":"' . $old_price . '"';
}
$rows[] = '"displaybuttons":"' . $displaybuttons . '"';
if ($jshopConfig->use_extend_attribute_data) {
$images = $product->getImages();
$videos = $product->getVideos();
$demofiles = $product->getDemoFiles();
$tmp = array();
foreach ($images as $img) {
$tmp[] = '"' . $img->image_name . '"';
}
$displayimgthumb = intval(count($images) > 1 || count($videos) && count($images));
$rows[] = '"images":[' . implode(",", $tmp) . '],"displayimgthumb":"' . $displayimgthumb . '"';
$view_name = "product";
$view_config = array("template_path" => JPATH_COMPONENT . "/templates/" . $jshopConfig->template . "/" . $view_name);
$view = $this->getView($view_name, getDocumentType(), '', $view_config);
$view->setLayout("demofiles");
$view->assign('config', $jshopConfig);
$view->assign('demofiles', $demofiles);
$demofiles = $view->loadTemplate();
$demofiles = str_replace(array("\n", "\r", "\t"), "", $demofiles);
$rows[] = '"demofiles":"' . str_replace('"', '\\"', $demofiles) . '"';
}
$dispatcher->trigger('onBeforeDisplayAjaxAttrib', array(&$rows, &$product));
print '{' . implode(",", $rows) . '}';
die;
}
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:100,代码来源:product.php
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1291|2022-08-30
-
OpenTeknik LLC OSSN OPEN SOURCE SOCIAL NETWORK v6.3 LTS was discovered to contai
阅读:867|2022-07-29
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1205|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1002|2022-11-06
-
一、电脑软硬件基础知识 1、CPU型号怎么看? CPU是一台电脑的核心,而目前笔记本市场
阅读:802|2022-07-30
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1404|2022-08-18
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:519|2022-08-16
-
当数据集已处于插入状态时,如何确定数据感知组件字段是否已被修改?我想知道一个字段
阅读:621|2022-07-18
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:669|2022-11-06
-
A vulnerability has been identified in Mendix Excel Importer Module (Mendix 8 co
阅读:787|2022-07-29
|
请发表评论