Kryptronic Software Support Forum

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.

#1 08-28-2015 08:59:27

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Product URLs look-up

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

 

#2 08-28-2015 09:07:47

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1733

Re: Product URLs look-up

Code:

$this->link_namespace('ecom','prodshow', array('ref' => 'product_id_here'));

should do the job.


Rob

Offline

 

#3 08-28-2015 11:41:17

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

Zanart

Many thanks. I'll go away and have a play!

Terry

Offline

 

#4 09-02-2015 05:54:04

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

zanart wrote:

Code:

$this->link_namespace('ecom','prodshow', array('ref' => 'product_id_here'));

I've tried this with the following code -

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

 

#5 09-02-2015 07:06:25

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product URLs look-up

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>';
?>


Nick Hendler

Offline

 

#6 09-02-2015 07:17:20

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

Nick

From a previous message I found:

Code:

<a href="<?php print $this->link_namespace('ecom','prodshow',array('ref'=>'PRODUCTID')); ?>">link</a>

which I've adjusted to

Code:

<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

 

#7 07-19-2016 04:47:22

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

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:

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

 

#8 07-19-2016 08:18:18

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product URLs look-up

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.


Nick Hendler

Offline

 

#9 07-19-2016 12:06:23

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

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

 

#10 07-20-2016 04:39:34

olagist
Member
From: Nigeria
Registered: 07-20-2016
Posts: 1
Website

Re: Product URLs look-up

am having the same similar issues on my store, but with the above solution, i got it fixed, thanks alot.


|  |

Offline

 

#11 07-20-2016 08:25:53

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product URLs look-up

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:

Code:

print $proddesc . $eol;

Replace with:

Code:

$this->include_phptext($proddesc);

Nick Hendler

Offline

 

#12 07-20-2016 09:28:29

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

Nick

Now working - many thanks.

Terry

Offline

 

#13 08-08-2016 13:07:54

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

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

Code:

<a href="<?php print $this->link_namespace('ecom','catshow',array('ref'=>'MISC-001')); ?>">Gifts & Giftware</a>

to become

Code:

<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

 

#14 08-09-2016 07:43:23

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product URLs look-up

That should work just fine for a category description.  They already parse for PHP code and execute it.


Nick Hendler

Offline

 

#15 08-10-2016 03:05:49

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product URLs look-up

I had to change

Code:

print $catdesc;

to

Code:

$this->include_phptext($catdesc);

within the mobile category display

Last edited by tguswell (08-10-2016 03:06:09)

Offline

 

Board footer