Page 1 of 1

Custom field show label parameter

Posted: 14 Oct 2023, 16:55
by mino182
Ahoj, custom field má parameter "showlabel" (zobraziť/ukryť). Neuvažoval si, že dáš do zobrazenia custom fields pri tovare podmienku, pre zobrazenie názvu poľa podľa tohto parametru?

Napr. keď mám len textový editor ako custom field a chcel by som v tabe zobraziť len jeho obsah, momentálne to nejde a v tom tabe je zobrazený aj názov.

vo view item/default.php stačí upraviť:
toto:

Code: Select all

if (!empty($v2->value)) {
							$tabO .= '<div class="' . $this->s['c']['col.xs12.sm4.md4'] . ' ph-cf-title">';
							$tabO .= isset($v2->title) ? $v2->title : '';
							$tabO .= '</div>';

							$tabO .= '<div class="' . $this->s['c']['col.xs12.sm6.md6'] . ' ph-cf-value">';
							$tabO .= isset($v2->value) ? $v2->value : '';
							$tabO .= '</div>';
						}
na toto:

Code: Select all

if (!empty($v2->value) && $v2->params->get('showlabel')) {
							$tabO .= '<div class="' . $this->s['c']['col.xs12.sm4.md4'] . ' ph-cf-title">';
							$tabO .= isset($v2->title) ? $v2->title : '';
							$tabO .= '</div>';

							$tabO .= '<div class="' . $this->s['c']['col.xs12.sm6.md6'] . ' ph-cf-value">';
							$tabO .= isset($v2->value) ? $v2->value : '';
							$tabO .= '</div>';
						}
						elseif (!empty($v2->value)) {
							$tabO .= isset($v2->value) ? $v2->value : '';
						}

Re: Custom field show label parameter

Posted: 18 Oct 2023, 23:46
by Jan
Ahoj, díky za info, podívám se na to.

Re: Custom field show label parameter

Posted: 23 May 2024, 14:34
by adm
I have the same problem. At custom field label on "Hide" and the label is always displayed. In components/com_phocacart/views/item/tmpl/default.php behind line 929 should be added:

if (!empty($field->value)) {

if ($field->params->get('showlabel')) {

$tabO.='
.$this->s['c']['col.xs12.sm4.md4'] .' ph-cf-title">';

$tabO.=isset($field->title) ? $field->title : '';

$tabO.='

';

}

Re: Custom field show label parameter

Posted: 28 May 2024, 16:05
by Jan
Hi, thank you for the info.

Jan