本文整理匯總了PHP中comquick2cartHelper::getAttributeDetails方法的典型用法代碼示例。如果您正苦於以下問題:PHP comquick2cartHelper::getAttributeDetails方法的具體用法?PHP comquick2cartHelper::getAttributeDetails怎麽用?PHP comquick2cartHelper::getAttributeDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類comquick2cartHelper
的用法示例。
在下文中一共展示了comquick2cartHelper::getAttributeDetails方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getItemCompleteAttrDetail
/**
* This function provides all info about item attributes ( id,att_name,options details, price ).
*
* @param integer $item_id item_id.
*
* @since 2.2.2
*
* @return boolean true or false.
*/
public function getItemCompleteAttrDetail($item_id)
{
if (empty($item_id)) {
return;
}
$comquick2cartHelper = new comquick2cartHelper();
$attributes = $this->getAttributes($item_id);
foreach ($attributes as $key => $att) {
$att->optionDetails = $comquick2cartHelper->getAttributeDetails($att->itemattribute_id);
}
return $attributes;
}
示例2: AddNewAttribute
function AddNewAttribute()
{
JHtml::_('behavior.modal', 'a.modal');
$lang = JFactory::getLanguage();
$lang->load('com_quick2cart', JPATH_ADMINISTRATOR);
$params = JComponentHelper::getParams('com_quick2cart');
$jinput = JFactory::getApplication()->input;
$pid = $jinput->get('pid');
// $attr_id = $jinput->get('attr_id');
$model = $this->getModel('attributes');
$quick2cartModelAttributes = new quick2cartModelAttributes();
$attributes = $quick2cartModelAttributes->getItemAttributes($pid);
// print_r($attributes );die;
$path = JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers.php';
if (!class_exists('comquick2cartHelper')) {
// require_once $path;
JLoader::register('comquick2cartHelper', $path);
JLoader::load('comquick2cartHelper');
}
$qtc_base_url = JUri::root();
$add_link = $qtc_base_url . 'index.php?option=com_quick2cart&view=attributes&layout=attribute&tmpl=component&pid=' . $pid;
// echo count($attributes_info);echo $jinput->get('count');
$del_link = $qtc_base_url . 'index.php?option=com_quick2cart&controller=attributes&task=delattribute';
$html = '';
$count = $jinput->get('count');
$count = $count - 1;
if (!empty($attributes)) {
$invalid_op_price = array();
// $i = 1;
for ($i = 0; $i < count($attributes); $i++) {
if ($i > $count) {
$html .= '<tr class="' . "att_" . $attributes[$i]->itemattribute_id . '">
<td>' . $attributes[$i]->itemattribute_name . '</td>
<td id="' . "att_list_" . $attributes[$i]->itemattribute_id . '">';
$comquick2cartHelper = new comquick2cartHelper();
$currencies = $params->get('addcurrency');
$curr = explode(',', $currencies);
$atri_options = $comquick2cartHelper->getAttributeDetails($attributes[$i]->itemattribute_id);
foreach ($atri_options as $atri_option) {
$html .= '<div>';
$noticeicon = "";
$opt_str = $atri_option->itemattributeoption_name . ": " . $atri_option->itemattributeoption_prefix;
$itemnotice = '';
foreach ($curr as $value) {
if (property_exists($atri_option, $value)) {
if ($atri_option->{$value}) {
$opt_str .= $atri_option->{$value} . " " . $value . ", ";
}
} else {
$invalid_op_price[$value] = $value;
// add current cur
if (empty($itemnotice)) {
$noticeicon = "<i class='icon-hand-right'></i> ";
}
}
}
$html .= $detail_str = $noticeicon . $opt_str;
$html .= '</div>';
}
$html .= '</td>';
$edit_link = $add_link . '&attr_id=' . $attributes[$i]->itemattribute_id . '&edit=1';
$del_link = $del_link . '&attr_id=' . $attributes[$i]->itemattribute_id;
$html .= '<td><a rel="{handler: \'iframe\', size: {x: 550, y: 470}, onClose: function(){EditAttribute(' . $attributes[$i]->itemattribute_id . ',' . $pid . ');}}" class="btn btn-mini btn-primary modal qtc_modal" href="' . $edit_link . '"> <i class="icon-pencil-2 icon-white"></i></a>
<button type="button" class="btn btn-mini btn-danger " onclick=\'deleteAttribute("' . $attributes[$i]->itemattribute_id . '","' . $pid . '" )\'><i class="icon-trash icon-white"></i></button>
</td>
</tr>';
}
// $i++;
}
// end of foreach($attributes as $attributes)
}
// echo $html;die;
$data['html'] = $html;
echo json_encode($html);
jexit();
}
示例3: explode
?>
">
<td> <?php
echo $attributes->itemattribute_name;
?>
</td>
<td id="<?php
echo "att_list_" . $attributes->itemattribute_id;
?>
">
<?php
$comquick2cartHelper = new comquick2cartHelper();
$currencies = $params->get('addcurrency');
$curr = explode(',', $currencies);
//$atri_options = $comquick2cartHelper->getAttributeOptionCurrPrice($attributes->itemattribute_id,implode($curr, "','"));
$atri_options = $comquick2cartHelper->getAttributeDetails($attributes->itemattribute_id);
foreach ($atri_options as $atri_option) {
?>
<div>
<?php
$noticeicon = "";
$opt_str = $atri_option->itemattributeoption_name . ": " . $atri_option->itemattributeoption_prefix;
$itemnotice = '';
foreach ($curr as $value) {
if (property_exists($atri_option, $value)) {
if ($atri_option->{$value}) {
$opt_str .= $atri_option->{$value} . " " . $value . ", ";
}
} else {
$invalid_op_price[$value] = $value;
// add current cur