Hi Jan and Everyone
I want to know is it possible to display the alias in the item view of a product in the frontend.
Please let me know and thanks in advance.
Showing the alias in the frontend (Help Please)
-
- Phoca Member
- Posts: 36
- Joined: 07 Jan 2021, 15:41
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Showing the alias in the frontend (Help Please)
Hi, the alias is not displayed in item view but it is loaded there. The product object includes this value:
so if you need to display it, you can create template override of the item output view:
components\com_phocacart\views\item\tmpl\default.php
The variable is included in foreach as $x->alias
Jan
so if you need to display it, you can create template override of the item output view:
components\com_phocacart\views\item\tmpl\default.php
The variable is included in foreach as $x->alias
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 36
- Joined: 07 Jan 2021, 15:41
Re: Showing the alias in the frontend (Help Please)
Hi Everyone
if added this code to show the alias in item view.
if (isset($x->alias) && $x->alias != '') {
echo '<div class="ph-item-alias-box">';
echo '<div class="ph-alias-txt">'.JText::_('COM_PHOCACART_alias').':</div>';
echo '<div class="ph-alias">';
echo PhocacartRenderFront::displayLink($x->alias, $x->aliaslink);
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
in public_html/components/com_phocacart/views/item/tmpl/default.php
And it works fine but it shows it incorrectly.
Alias:
99210
My question is how can I get the code or alias to appear next to it like this.
Alias: 99210
Please let me know
Thanks in advance
if added this code to show the alias in item view.
if (isset($x->alias) && $x->alias != '') {
echo '<div class="ph-item-alias-box">';
echo '<div class="ph-alias-txt">'.JText::_('COM_PHOCACART_alias').':</div>';
echo '<div class="ph-alias">';
echo PhocacartRenderFront::displayLink($x->alias, $x->aliaslink);
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
in public_html/components/com_phocacart/views/item/tmpl/default.php
And it works fine but it shows it incorrectly.
Alias:
99210
My question is how can I get the code or alias to appear next to it like this.
Alias: 99210
Please let me know
Thanks in advance
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Showing the alias in the frontend (Help Please)
Hi, I don't understand your code? I don't see any:
echo $x->alias;
in your code?
echo $x->alias;
in your code?
If you find Phoca extensions useful, please support the project