Best Answer rihter2001 , 28 October 2014 - 16:48
Значится так.....
изменять надо 6 файлов
1
jbpriceadvance.php и jbpriceadvance.xml
из папки
media\zoo\applications\jbuniversal\elements\jbpriceadvance\
2
edit.php
из папки
media\zoo\applications\jbuniversal\elements\jbpriceadvance\tmpl
3
jbpriceadvance.php
из папки
media\zoo\applications\jbuniversal\framework\elements\user\
4
jquery.jbzootools.min.js
папка
media\zoo\applications\jbuniversal\assets\js
ну и дописать в файл
ru-RU.com_jbzoo.ini новые значения перевода
Если в кратце то через поиск ищем строки где упоминается param1
и дополняем их новыми например
public function edit() { $this->app->jbassets->admin(); if ($layout = $this->getLayout('edit.php')) { $variations = $this->_getVariations(); if (empty($variations) && (int)$this->config->get('mode', 0)) { $basic = $this->_getBasicData(); $basic['description'] = ''; $variations = array($basic); } return self::renderLayout($layout, array( 'config' => $this->config, 'currencyList' => $this->_getCurrencyList($this->config), 'variations' => $variations, 'basicData' => $this->_getBasicData(), 'param1' => $this->_getParamOptions(1, true), 'param2' => $this->_getParamOptions(2, true), 'param3' => $this->_getParamOptions(3, true), 'param4' => $this->_getParamOptions(4, true), 'param5' => $this->_getParamOptions(5, true), 'param6' => $this->_getParamOptions(6, true), 'param7' => $this->_getParamOptions(7, true), 'param8' => $this->_getParamOptions(8, true), 'param9' => $this->_getParamOptions(9, true), 'param10' => $this->_getParamOptions(10, true), 'param11' => $this->_getParamOptions(11, true), 'param12' => $this->_getParamOptions(12, true), 'param13' => $this->_getParamOptions(13, true), 'param14' => $this->_getParamOptions(14, true), 'param15' => $this->_getParamOptions(15, true), )); } return null; }
Так же находим p1- и дописываем
protected function _getHash(array $variant = array()) { $itemId = $this->_getItemId(); if (empty($variant)) { return (string)$itemId; } $paramsArr = array( 'p1-' . (isset($variant['param1']) ? $variant['param1'] : ''), 'p2-' . (isset($variant['param2']) ? $variant['param2'] : ''), 'p3-' . (isset($variant['param3']) ? $variant['param3'] : ''), 'p4-' . (isset($variant['param4']) ? $variant['param4'] : ''), 'p5-' . (isset($variant['param5']) ? $variant['param5'] : ''), 'p6-' . (isset($variant['param6']) ? $variant['param6'] : ''), 'p7-' . (isset($variant['param7']) ? $variant['param7'] : ''), 'p8-' . (isset($variant['param8']) ? $variant['param8'] : ''), 'p9-' . (isset($variant['param9']) ? $variant['param9'] : ''), 'p10-' . (isset($variant['param10']) ? $variant['param10'] : ''), 'p11-' . (isset($variant['param11']) ? $variant['param11'] : ''), 'p12-' . (isset($variant['param12']) ? $variant['param12'] : ''), 'p13-' . (isset($variant['param13']) ? $variant['param13'] : ''), 'p14-' . (isset($variant['param14']) ? $variant['param14'] : ''), 'p15-' . (isset($variant['param15']) ? $variant['param15'] : ''), ); if ((int)$this->config->get('adv_field_text', 0) == self::TEXT_FIELD_AS_PARAM) { if (isset($variant['description'])) { $paramsArr[] = 'd-' . $this->app->string->sluggify($variant['description']); } else { $paramsArr[] = 'd-'; } } $result = implode('_', $paramsArr); if ($result === implode('_', array('p1-', 'p2-', 'p3-','p4-','p5-','p6-', 'p7-', 'p8-','p9-','p10-','p11-', 'p12-', 'p13-','p14-','p15-', 'd-')) || $result === implode('_', array('p1-', 'p2-', 'p3-','p4-','p5-','p6-', 'p7-', 'p8-','p9-','p10-','p11-', 'p12-', 'p13-','p14-','p15-')) ) { return (string)$itemId; }
обязательно находим protected function _renderParamsControl($params)
и меняем значение $i На количество полей
protected function _renderParamsControl($params) { $jbhtml = $this->app->jbhtml; $paramsTmpl = (int)$params->get('params_tmpl', 0); $advFieldText = (int)$this->config->get('adv_field_text', 0); $advShowEmpty = (int)$this->config->get('adv_show_empty', 1); $html = array(); /// $i количество выводимых полей for ($i = 1; $i <= 15; $i++) {
и $html[3] меняем 3 на количество полей +1
$paramsList = $this->_getParamOptionsDesc(); if ($advFieldText == self::TEXT_FIELD_AS_PARAM && !empty($paramsList)) { if (self::PARAMS_TMPL_SELECT == $paramsTmpl) { $paramName = JString::trim($paramsList[''], '-'); $html[16] = $jbhtml->select($paramsList, uniqid('jbprice-'), 'class="jsParamDesc" data-index="d-"'); $html[16] = '<fieldset class="jbprice-param-select jbprice-param-list jbprice-param-list-desc">' . '<legend>' . $paramName . '</legend>' . $html[16] . '</fieldset>';
и главное дописать скрипт
дописываем там где p1-
b.text_start+'" /><input type="button" class="jsStop uk-button" value="'+b.text_stop+'" style="display:none;" />');var f=a("#jbprogressbar",l),s=a(".uk-progress-bar",l);a(".progress-label",l);var m=a(".jsStart",l),q=a(".jsStop",l),r=0,t=0,p=!0,n=0;m.bind("click",function(){confirm(b.text_start_confirm)&&d();return!1});q.bind("click",function(){confirm(b.text_stop_confirm)&&g();return!1});b.autoStart&&(d(),m.hide(),q.hide())};a.fn.JBZooPriceAdvance=function(b){b=a.extend({},{mainHash:"",itemId:0,identifier:"", prices:{},addToCartUrl:"",removeFromCartUrl:"",basketUrl:"",modalUrl:"",isInCart:0},b);b.params=a.extend({},{startValue:1,multipleValue:1,currencyDefault:"EUR",advFieldText:0,advAllExistShow:0},b.params);return a(this).each(function(){function c(c){if(p(b.prices))return!1;var d;d=l();var e=h(d);d="p1-_p2-_p3-_p4-_p5-p6-_p7-_p8-_p9-_p10-p11-_p12-_p13-_p14-_p15-_d-"==e||"p1-_p2-_p3-_p4-_p5-p6-_p7-_p8-_p9-_p10-p11-_p12-_p13-_p14-_p15"==e?b.mainHash:e=b.mainHash+"-"+h(d);var e=b.prices[b.mainHash].prices[c],g="";"undefined"!=typeof b.prices[d]?(e=b.prices[d].prices[c],g=a.trim(b.prices[d].description), 0==b.params.advAllExistShow&&a(".jbprice-buttons",f).removeClass("disabled")):(0==b.params.advAllExistShow&&a(".jbprice-buttons",f).addClass("disabled"),d=b.mainHash);a(".not-paid-box",f).show();0==e.totalNoFormat&&a(".not-paid-box",f).hide();a(".jsSave",f).text(e.save);a(".jsTotal",f).text(e.total);a(".jsPrice",f).html(" "+e.price+" ");a(".jbcurrency-"+c.toLowerCase(),f).addClass("active");a(".jsDescription",f).text(g);a(".jbprice-balance .balance",f).hide();a(".jbprice-balance ."+d,f).show(); a(".jbprice-sku .sku",f).hide();a(".jbprice-sku ."+d,f).show();n=c}function e(){var a=l();return a=2==b.params.advFieldText?{1:a["p1-"],2:a["p2-"],3:a["p3-"],4:a["p4-"],5:a["p5-"],6:a["p6-"],7:a["p7-"],8:a["p8-"],9:a["p9-"],10:a["p10-"],11:a["p11-"],12:a["p12-"],13:a["p13-"],4:a["p14-"],5:a["p15-"],desc:a["d-"]}:{1:a["p1-"],2:a["p2-"],3:a["p3-"],4:a["p4-"],5:a["p5-"],6:a["p6-"],7:a["p7-"],8:a["p8-"],9:a["p9-"],10:a["p10-"],11:a["p11-"],12:a["p12-"],13:a["p13-"],4:a["p14-"],5:a["p15-"]}}function d(c){var d=b.params.startValue;a(".jsCount",f).length&&(d=a(".jsCount",f).val());k({url:b.addToCartUrl,data:{args:{quantity:d,params:e()}},success:function(b){a.isFunction(c)&&c(b)},error:function(a){a.message&&alert(a.message)}})}function g(){k({url:b.removeFromCartUrl,success:function(b){f.removeClass("in-cart").addClass("not-in-cart"); a.fn.JBZooPriceReloadBasket()}})}function h(a){var b=[],c;for(c in a)b.push(c+a[c]);return b.join("_")}function l(){var c={},c=2==b.params.advFieldText?{"p1-":"","p2-":"","p3-":"","p4-":"","p5-":"","p6-":"","p7-":"","p8-":"","p9-":"","p10-":"","p11-":"","p12-":"","p13-":"","p14-":"","p15-":"","d-":""}:{"p1-":"","p2-":"","p3-":"","p4-":"","p5-":"","p6-":"","p7-":"","p8-":"","p9-":"","p10-":"","p11-":"","p12-":"","p13-":"","p14-":"","p15-":""};f.find(".jbprice-param-radio").length?a(".jbprice-param-radio input:checked",f).each(function(b,d){var e=a.trim(a(d).val()),f=a(d).closest(".jbprice-param-radio");c[f.data("index")]=e}):f.find(".jbprice-param-select").length&&(a(".jsParam",f).each(function(b,d){var e=a.trim(a(d).val())
прикрепил свои вариант на 15 полей https://yadi.sk/d/4wJ0vMIdcM3SP
знаю я маниак но так надо было
вопрос к более знающим, можно ли туда прикрутить проверку чтобы если в доп поле одна позиция он выводил не селект а текст
Go to the full post