- Posts: 640
- Thank you received: 16
Need help obtaining a SEF URL in PHP view
- PeterChain
-
Topic Author
- Offline
Less
More
11 years 9 months ago #183538
by PeterChain
Need help obtaining a SEF URL in PHP view was created by PeterChain
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 2.5
-- PHP version -- : 5.5.18
Now to obtain the URL of a product I use this code which was suggested long ago by HikaShop suppor tTema:
Now is very necessary for me to obtain the same urls already 'SEFed'.
Please could you suggest me a code to do so?
-- Joomla version -- : 2.5
-- PHP version -- : 5.5.18
Now to obtain the URL of a product I use this code which was suggested long ago by HikaShop suppor tTema:
Code:
<?php echo '<a href="'.JURI::base().'index.php?option=com_hikashop&ctrl=product&task=show&cid='.$this->row->product_id.'&name='.$this->row->product_alias.'">'.$this->row->product_code.'</a>';?>
Now is very necessary for me to obtain the same urls already 'SEFed'.
Please could you suggest me a code to do so?
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183556
by Xavier
Replied by Xavier on topic Need help obtaining a SEF URL in PHP view
Hi,
The best way will be to create a product listing menu, it can be a hidden one, and then use the url
The best way will be to create a product listing menu, it can be a hidden one, and then use the url
Code:
<?php echo '<a href="/menu-alias/'.$this->row->product_id.'-'.$this->row->product_alias.'">'.$this->row->product_code.'</a>";
Please Log in or Create an account to join the conversation.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
11 years 9 months ago #183666
by PeterChain
Replied by PeterChain on topic Need help obtaining a SEF URL in PHP view
I'm trying this inside a product listing_div.
I can't get the value for this expresion:
I get a blank value. I wonder if inside a product listing this should be written slightly different.
Any clue?
I can't get the value for this expresion:
Code:
.$this->row->product_alias.
I get a blank value. I wonder if inside a product listing this should be written slightly different.
Any clue?
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183775
by Xavier
Replied by Xavier on topic Need help obtaining a SEF URL in PHP view
Hi,
In the view "product / listing_div" you have to use "$row" in the foreach instead of "$this->row".
"$this->row" is if you use the code in the view, for example, "product / listing_img_title".
In the view "product / listing_div" you have to use "$row" in the foreach instead of "$this->row".
"$this->row" is if you use the code in the view, for example, "product / listing_img_title".
Please Log in or Create an account to join the conversation.
Time to create page: 0.216 seconds