本文整理汇总了PHP中comquick2cartHelper::getAttributeOptionCurrPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP comquick2cartHelper::getAttributeOptionCurrPrice方法的具体用法?PHP comquick2cartHelper::getAttributeOptionCurrPrice怎么用?PHP comquick2cartHelper::getAttributeOptionCurrPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comquick2cartHelper
的用法示例。
在下文中一共展示了comquick2cartHelper::getAttributeOptionCurrPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttrFieldTypeHtml
function getAttrFieldTypeHtml($data)
{
$parent = '';
if (isset($data['parent'])) {
$parent = $data['parent'];
}
$product_id = $data['product_id'];
$comquick2cartHelper = new comquick2cartHelper();
// $atri_options = comquick2cartHelper::getAttributeOption($attribute->itemattribute_id);// commented during multicurrency
$atri_options = $comquick2cartHelper->getAttributeOptionCurrPrice($data['itemattribute_id']);
$select_opt = array();
$userData = array();
$userData[] = 'Textbox';
if (!$data['attribute_compulsary'] && !in_array($data['fieldType'], $userData)) {
$select_opt[] = JHtml::_('select.option', "", "");
}
$returnHtml = '';
foreach ($atri_options as $atri_option) {
$attOp_price = (int) $atri_option->itemattributeoption_currency_price;
// IF 0 ATT PRIVE THEN DONT ADD +0 USD
if (!empty($attOp_price)) {
$priceText = $comquick2cartHelper->getFromattedPrice($atri_option->itemattributeoption_currency_price, NULL, 0);
$opt_str = $atri_option->itemattributeoption_name . ": " . $atri_option->itemattributeoption_prefix . " " . $priceText;
} else {
// If no price than dont append like +00.0 USD
$opt_str = $atri_option->itemattributeoption_name;
}
// Generate op according to datatype
if (in_array($data['fieldType'], $userData)) {
$returnHtml = "<input type='text' name='qtcUserField_" . $atri_option->itemattributeoption_id . "' class='input input-small " . $parent . '-' . $product_id . '_UserField' . "' >";
} else {
/* Amol change*/
$default_value = '';
if (isset($data['default_value'])) {
$default_value = $data['default_value'];
}
$field_name = 'attri_option';
if (isset($data['field_name'])) {
$field_name = $data['field_name'];
}
// user data
$select_opt[] = JHtml::_('select.option', $atri_option->itemattributeoption_id, $opt_str);
$returnHtml = JHtml::_('select.genericlist', $select_opt, $field_name, " class='q2c_AttoptionsMaxWidth {$parent}-{$product_id}_options'", 'value', 'text', $default_value, false);
}
}
return $returnHtml;
/* if (!in_array($data['fieldType'],$userData)) {
echo JHtml::_('select.genericlist', $select_opt, 'attri_option', " class='span2 {$parent}-{$product_id}_options'", 'value', 'text', '',false);
}*/
}