Новости Joomla

Вышли релизы безопасности Joomla 5.3.4 и Joomla 4.4.14

Релиз безопасности Joomla 5.3.4

Проект Joomla спешит сообщить о выпуске Joomla 5.3.4 и Joomla 4.4.14. Это релиз безопасности для серии Joomla 5.3 и релиз безопасности для серии Joomla 4.4.

0 Пользователей и 1 Гость просматривают эту тему.
  • 3 Ответов
  • 2988 Просмотров
*

arm1n

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Доброго времени суток.Требуется помощь в выводе атрибута корзины selectom, сейчас вывод работает через radio button, собственно вот
http://cotelnay.com.ua/vodonagrevateli/boiler/ariston-sg-kupit
Помогите пожалуйста разобраться


Код
public function getProductCustomsFieldCart ($product) {

// group by virtuemart_custom_id
$query = 'SELECT C.`virtuemart_custom_id`, `custom_title`, C.`custom_value`,`custom_field_desc` ,`custom_tip`,`field_type`,field.`virtuemart_customfield_id`,`is_hidden`
FROM `#__virtuemart_customs` AS C
LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
Where `virtuemart_product_id` =' . (int)$product->virtuemart_product_id . ' and `field_type` != "G" and `field_type` != "R" and `field_type` != "Z"';
$query .= ' and is_cart_attribute = 1 group by virtuemart_custom_id ORDER BY field.`ordering`';

$this->_db->setQuery ($query);
$groups = $this->_db->loadObjectList ();

if (!class_exists ('VmHTML')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php');
}
$row = 0;
if (!class_exists ('CurrencyDisplay')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php');
}
$currency = CurrencyDisplay::getInstance ();

if (!class_exists ('calculationHelper')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php');
}
$calculator = calculationHelper::getInstance ();
if (!class_exists ('vmCustomPlugin')) {
require(JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php');
}

$free = JText::_ ('COM_VIRTUEMART_CART_PRICE_FREE');
// render select list
foreach ($groups as $group) {

// $query='SELECT  field.`virtuemart_customfield_id` as value ,concat(field.`custom_value`," :bu ", field.`custom_price`) AS text
$query = 'SELECT field.`virtuemart_product_id`, `custom_params`,`custom_element`, field.`virtuemart_custom_id`,
field.`virtuemart_customfield_id`,field.`custom_value`, field.`custom_price`, field.`custom_param`
FROM `#__virtuemart_customs` AS C
LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
Where `virtuemart_product_id` =' . (int)$product->virtuemart_product_id;
$query .= ' and is_cart_attribute = 1 and C.`virtuemart_custom_id`=' . (int)$group->virtuemart_custom_id;

// We want the field to be ordered as the user defined
$query .= ' ORDER BY field.`ordering`';

$this->_db->setQuery ($query);
$options = $this->_db->loadObjectList ();
//vmdebug('getProductCustomsFieldCart options',$options);
$group->options = array();
foreach ($options as $option) {
$group->options[$option->virtuemart_customfield_id] = $option;
}

if ($group->field_type == 'V') {
$default = current ($group->options);
foreach ($group->options as $productCustom) {
if ((float)$productCustom->custom_price) {
$price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price)));
}
else {
$price = ($productCustom->custom_price === '')? '' : $free;
}
$productCustom->text = $productCustom->custom_value . ' ' . $price;

}
$group->display = VmHTML::select ('customPrice[' . $row . '][' . $group->virtuemart_custom_id . ']', $group->options, $default->custom_value, '', 'virtuemart_customfield_id', 'text', FALSE);
}
else {
if ($group->field_type == 'G') {
$group->display .= ''; // no direct display done by plugin;
}
else {
if ($group->field_type == 'E') {
$group->display = '';

foreach ($group->options as $k=> $productCustom) {
if ((float)$productCustom->custom_price) {
$price = $currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price));
}
else {
$price = ($productCustom->custom_price === '')? '' : $free;
}
$productCustom->text = $productCustom->custom_value . ' ' . $price;
$productCustom->virtuemart_customfield_id = $k;
if (!class_exists ('vmCustomPlugin')) {
require(JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php');
}

//legacy, it will be removed 2.2
$productCustom->value = $productCustom->virtuemart_customfield_id;
JPluginHelper::importPlugin ('vmcustom');
$dispatcher = JDispatcher::getInstance ();
$fieldsToShow = $dispatcher->trigger ('plgVmOnDisplayProductVariantFE', array($productCustom, &$row, &$group));

// $group->display .= '<input type="hidden" value="' . $k . '" name="customPrice[' . $row . '][' . $group->virtuemart_custom_id . ']" /> ';
$group->display .= '<input type="hidden" value="' . $productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /> ';
if (!empty($currency->_priceConfig['variantModification'][0]) and $price !== '') {
$group->display .= '<div class="price-plugin">' . JText::_ ('COM_VIRTUEMART_CART_PRICE'). '<span class="price-plugin">' . $price . '</span></div>';
}
$row++;
}
$row--;
}
else {
if ($group->field_type == 'U') {
foreach ($group->options as $productCustom) {
if ((float)$productCustom->custom_price) {
$price = $currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price));
}
else {
$price = ($productCustom->custom_price === '')? '' : $free;
}
$productCustom->text = $productCustom->custom_value . ' ' . $price;

$group->display .= '<input type="text" value="' . JText::_ ($productCustom->custom_value). '" name="customPrice[' . $row . '][' . $group->virtuemart_custom_id . '][' . $productCustom->value . ']" /> ';
if (!empty($currency->_priceConfig['variantModification'][0]) and $price !== '') {
$group->display .= '<div class="price-plugin">' . JText::_ ('COM_VIRTUEMART_CART_PRICE'). '<span class="price-plugin">' . $price . '</span></div>';
}
}
}
else {
if ($group->field_type == 'A') {
$group->display = '';
foreach ($group->options as $productCustom) {
/* if ((float)$productCustom->custom_price) {
$price = $currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price));
}
else {
$price = ($productCustom->custom_price === '')? '' : $free;
}*/
$productCustom->field_type = $group->field_type;
$productCustom->is_cart = 1;
$group->display .= $this->displayProductCustomfieldFE ($product, $productCustom, $row);
$checked = '';
}
}
else {

$group->display = '';
$checked = 'checked="checked"';
foreach ($group->options as $productCustom) {
//vmdebug('getProductCustomsFieldCart',$productCustom);
if ((float)$productCustom->custom_price) {
$price = $currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($productCustom->custom_price));
}
else {
$price = ($productCustom->custom_price === '')? '' : $free;
}
$productCustom->field_type = $group->field_type;
$productCustom->is_cart = 1;
// $group->display .= '<input id="' . $productCustom->virtuemart_custom_id . '" ' . $checked . ' type="radio" value="' .
// $productCustom->virtuemart_custom_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_customfield_id . ']" /><label
// for="' . $productCustom->virtuemart_custom_id . '">' . $this->displayProductCustomfieldFE ($productCustom, $row). ' ' . $price . '</label>';
//MarkerVarMods
$group->display .= '<input id="' . $productCustom->virtuemart_custom_id . '" ' . $checked . ' type="radio" value="' .
$productCustom->virtuemart_customfield_id . '" name="customPrice[' . $row . '][' . $productCustom->virtuemart_custom_id . ']" /><label
for="' . $productCustom->virtuemart_custom_id . '">' . $this->displayProductCustomfieldFE ($product, $productCustom, $row). ' ' . $price . '</label>';

$checked = '';
}
}
}
}
}
}
$row++;
}

return $groups;

}
« Последнее редактирование: 20.03.2013, 15:00:30 от arm1n »
*

arm1n

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Решено, можно закрывать тему
*

Inmixxx

  • Новичок
  • 1
  • 0 / 0
Расскажите пожалуйста. Какой код править, чтобы в атрибуте корзины выбрать select вместо radio. т.е. мне нужно выбрать комплектующие для мебели например ящик, полка дополнительная и т.д.
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Файл дополнительного поля изображения

Автор web3.0

Ответов: 0
Просмотров: 2619
Последний ответ 16.05.2020, 15:59:09
от web3.0
Как сменить изображение стандартной кнопки(зеленой) добавления корзины?

Автор Дмитрий Ф.

Ответов: 13
Просмотров: 11112
Последний ответ 23.01.2020, 15:30:09
от Amikta
При смене позиции модуля корзины, не добавляется товар

Автор Dolphin4ik_1

Ответов: 1
Просмотров: 949
Последний ответ 28.12.2018, 20:22:03
от fsv
Появление корзины в докбаре

Автор Dolphin4ik_1

Ответов: 5
Просмотров: 930
Последний ответ 27.12.2018, 22:19:22
от Dolphin4ik_1
Появление корзины после добавления товара

Автор Dolphin4ik_1

Ответов: 1
Просмотров: 894
Последний ответ 27.12.2018, 19:27:50
от Dolphin4ik_1