Custom field show label parameter

Phoca Cart - complex e-commerce extension
mino182
Phoca Professional
Phoca Professional
Posts: 188
Joined: 12 Feb 2015, 13:30

Custom field show label parameter

Post 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 : '';
						}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom field show label parameter

Post by Jan »

Ahoj, díky za info, podívám se na to.
If you find Phoca extensions useful, please support the project
adm
Phoca Enthusiast
Phoca Enthusiast
Posts: 58
Joined: 19 Nov 2008, 12:12

Re: Custom field show label parameter

Post 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.='

';

}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom field show label parameter

Post by Jan »

Hi, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply