You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi
On my site I have several schematic diagrams with associated part lists. The parts that I keep in stock I have hard-coded the appropriate link to the parts product page. The obvious disadvantage to this is if I then change the url then the link will not work.
Could some kind person point me in the direction of getting the url from, say, the product id and seourl? My thoughts are that if I associate the product id on the scematic diagram/parts list, then i should be able to get the seourl for it. Then I wouldn't have to worry about any changes that I make in the future - providing I continue to use seourl of course.
Many thanks
Terry
Offline
$this->link_namespace('ecom','prodshow', array('ref' => 'product_id_here'));should do the job.
Offline
zanart wrote:
Code:
$this->link_namespace('ecom','prodshow', array('ref' => 'product_id_here'));
I've tried this with the following code -
<?php
$this->link_namespace('ecom','prodshow', array('ref' => 'id51954'));
print '<td><a href="' . $this . '">23739</a></td>';
?>but all it is returning is wwwcaracamp.co.uk (my product id is correct) and not with the seourl added. I've obviously missed something!
Terry
Last edited by tguswell (09-02-2015 05:54:52)
Offline
Change to:
<?php
$link = $this->link_namespace('ecom','prodshow', array('ref' => 'id51954'));
print '<td><a href="' . $link . '">23739</a></td>';
?>
Or cleaner:
<?php
print '<td><a href="' . $this->link_namespace('ecom','prodshow', array('ref' => 'id51954')) . '">23739</a></td>';
?>
Offline
Nick
From a previous message I found:
<a href="<?php print $this->link_namespace('ecom','prodshow',array('ref'=>'PRODUCTID')); ?>">link</a>which I've adjusted to
<td><a href="<?php print $this->link_namespace('ecom','prodshow',array('ref'=>'id51954')); ?>">23739</a></td>and it appears to be working.
Thanks
Terry
Offline
I've just come to implement this for mobile devices (I'd forgotten that the tabs were not available).
Where I've entered the code:
<a href="<?php print $this->link_namespace('ecom','prodshow',array('ref'=>'id51653')); ?>">23847</a>within the mobile long product description, it is being interpreted by mobile devices as:
rather than
that the full site is showing.
Have I forgotten to enable/disable something on my site or just made a mistake elsewhere?
Many thanks
Terry
Caracamp
Last edited by tguswell (07-19-2016 04:48:45)
Offline
Look at the mobile product detail display (Product Detail Displays). You'll need to transform the description using the include_phptext() function just as is being done in the desktop product detail display.
Offline
Nick
Sorry I'm probably being a bit thick but I've looked in Store:Product Details Displays and I can't find any reference to the include_phptext() function.
Where should I be looking?
Terry
Offline
Sorry, I misled you assuming you had that mod in the Default display as you indicated your link worked there. In both the Default and Mobile displays, where you see:
print $proddesc . $eol;
Replace with:
$this->include_phptext($proddesc);
Offline
Nick
A follow-up question that is slightly off-topic.
In my mobile display I would like to do similar with sub-Category listings. Where in the mobile display would I edit to have the include_phptext() function for categories?
I would like
<a href="<?php print $this->link_namespace('ecom','catshow',array('ref'=>'MISC-001')); ?>">Gifts & Giftware</a>to become
<a href="http://caracamp.co.uk/Category/gifts-and-giftware">Gifts & Giftware</a>
Many thanks
Terry
Last edited by tguswell (08-08-2016 13:08:42)
Offline