本文整理汇总了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 . " " . $accessory_name . ' : ' . $producthelper->getProductFormattedPrice($accessory_price) . "</td></tr>";
$accessorylist .= $this->replaceAttributeData($product_id, $accessory[$a]->accessory_id, $attributes, $user_id, $uniqueid);
}
}
return $accessorylist;
}
示例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]">