当前位置: 首页>>代码示例>>PHP>>正文


PHP producthelper::getAccessoryPrice方法代码示例

本文整理汇总了PHP中producthelper::getAccessoryPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getAccessoryPrice方法的具体用法?PHP producthelper::getAccessoryPrice怎么用?PHP producthelper::getAccessoryPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在producthelper的用法示例。


在下文中一共展示了producthelper::getAccessoryPrice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: replaceAccessoryData

 public function replaceAccessoryData($product_id = 0, $accessory = array(), $user_id = 0, $uniqueid = "")
 {
     $uri = JURI::getInstance();
     $url = $uri->root();
     $redconfig = new Redconfiguration();
     $producthelper = new producthelper();
     $product = $producthelper->getProductById($product_id);
     $totalAccessory = count($accessory);
     $accessorylist = "";
     if ($totalAccessory > 0) {
         $accessorylist .= "<tr><th>" . JText::_('COM_REDSHOP_ACCESSORY_PRODUCT') . "</th></tr>";
         for ($a = 0; $a < count($accessory); $a++) {
             $ac_id = $accessory[$a]->child_product_id;
             $c_p_data = $producthelper->getProductById($ac_id);
             $accessory_name = $redconfig->maxchar($accessory[$a]->product_name, ACCESSORY_PRODUCT_TITLE_MAX_CHARS, ACCESSORY_PRODUCT_TITLE_END_SUFFIX);
             // Get accessory final price with VAT rules
             $accessorypricelist = $producthelper->getAccessoryPrice($product_id, $accessory[$a]->newaccessory_price, $accessory[$a]->accessory_main_price);
             $accessory_price = $accessorypricelist[0];
             $accessoryprice_withoutvat = $producthelper->getAccessoryPrice($product_id, $accessory[$a]->newaccessory_price, $accessory[$a]->accessory_main_price, 1);
             $accessory_price_withoutvat = $accessoryprice_withoutvat[0];
             $accessory_price_vat = $accessory_price - $accessory_price_withoutvat;
             $commonid = $product_id . '_' . $accessory[$a]->accessory_id . $uniqueid;
             // Accessory attribute  Start
             $attributes_set = array();
             if ($c_p_data->attribute_set_id > 0) {
                 $attributes_set = $producthelper->getProductAttribute(0, $c_p_data->attribute_set_id);
             }
             $attributes = $producthelper->getProductAttribute($ac_id);
             $attributes = array_merge($attributes, $attributes_set);
             $accessory_checkbox = "<input onClick='calculateOfflineTotalPrice(\"" . $uniqueid . "\");' type='checkbox' name='accessory_id_" . $product_id . $uniqueid . "[]' totalattributs='" . count($attributes) . "' accessoryprice='" . $accessory_price . "' accessorypricevat='" . $accessory_price_vat . "' id='accessory_id_" . $commonid . "' value='" . $accessory[$a]->accessory_id . "' />";
             $accessorylist .= "<tr><td>" . $accessory_checkbox . "&nbsp;" . $accessory_name . ' : ' . $producthelper->getProductFormattedPrice($accessory_price) . "</td></tr>";
             $accessorylist .= $this->replaceAttributeData($product_id, $accessory[$a]->accessory_id, $attributes, $user_id, $uniqueid);
         }
     }
     return $accessorylist;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:36,代码来源:product.php

示例2:

echo JText::_('COM_REDSHOP_DEFAULT_SELECTED');
?>
</th>-->
						<th width="50"><?php 
echo JText::_('COM_REDSHOP_DELETE');
?>
</th>
					</tr>
					</thead>
					<tbody>
					<?php 
$accessory_product = $this->lists['categroy_accessory_product'];
for ($f = 0; $f < count($accessory_product); $f++) {
    $accessory_main_price = 0;
    if ($accessory_product[$f]->product_id && $accessory_product[$f]->accessory_id) {
        $accessory_main_price = $producthelper->getAccessoryPrice($accessory_product[$f]->product_id, $accessory_product[$f]->newaccessory_price, $accessory_product[$f]->accessory_main_price, 1);
    }
    $checked = $accessory_product[$f]->setdefault_selected ? "checked" : "";
    ?>
						<tr>
							<td><?php 
    echo $accessory_product[$f]->product_name;
    ?>
								<input type="hidden" value="<?php 
    echo $accessory_product[$f]->child_product_id;
    ?>
"
								       name="product_accessory[<?php 
    echo $f;
    ?>
][child_product_id]">
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:31,代码来源:default.php


注:本文中的producthelper::getAccessoryPrice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。