Это уже зависит от того что вы напишите вместо строки "// ваш код"
Зависимость от каталога можно сделать так
if ($this->getItem()->application->id == 1) {
// один тип каталога
} else if ($this->getItem()->application->id == 2) {
// другой тип каталога
}
Таким образом?
<?php
/**
* JBZoo is universal CCK based Joomla! CMS and YooTheme Zoo component
* @category JBZoo
* @author smet.denis <admin@joomla-book.ru>
* @copyright Copyright © 2009-2013, Joomla-book.ru
* @license http://joomla-book.ru/info/disclaimer
* @link http://joomla-book.ru/projects/jbzoo JBZoo project page
*/
defined('_JEXEC') or die('Restricted access');
// register ElementRepeatable class
App::getInstance('zoo')->loader->register('ElementRepeatable', 'elements:repeatable/repeatable.php');
/**
* The Price element for JBZoo
*/
class ElementJBPrice extends ElementRepeatable implements iRepeatSubmittable
{
/**raznie artikuli
*/
public function bindData($data = array()) {
if ($this->getItem()->application->id == 12 && 13) {
// KV
} else if ($this->getItem()->application->id == 24 && 25) {
// OF
}else if ($this->getItem()->application->id == 18 && 19) {
// SK
}else if ($this->getItem()->application->id == 16 && 17) {
// GR
}else if ($this->getItem()->application->id == 20 && 21) {
// DA
}else if ($this->getItem()->application->id == 14 && 15) {
// DO
}else if ($this->getItem()->application->id == 22 && 23) {
// MA
}
parent::bindData($data);
}
/**
* Element constructor
*/
public function __construct()
{
parent::__construct();
$this->registerCallback('ajaxAddToCart');
$this->registerCallback('ajaxRemoveFromCart');
$this->registerCallback('ajaxModalWindow');
}
Edited by SmetDenis, 16 July 2013 - 07:58.
Отличный тег [code] !