Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Wish to link from product page to category page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-03-2008, 07:56 PM
 
pepperlibido pepperlibido is offline
 

Advanced Member
  
Join Date: Dec 2007
Location: Queensland Australia
Posts: 39
 

Default Wish to link from product page to category page?

Hi,

For good link strategy would like to put the following links on the bottom of my product pages: -

Link from product page back to its respective category page. E.g.
⌠Go from widget No 1 page (product) to widget page (category)■

The code can be put at the bottom of modules/upselling products/related products however; I have no idea what code to use. Any ideas please?

For linking back to home page have used HTML but obviously Smarty will be required for the above link.
The use of a ⌠go back■ button is not an alternative.
__________________
Gerard
Version 4.1.8 Gold
Linux
Server Zeus
Australia
Reply With Quote
  #2  
Old 04-05-2008, 09:29 AM
 
fotodog13 fotodog13 is offline
 

Senior Member
  
Join Date: Sep 2007
Posts: 126
 

Default Re: Wish to link from product page to category page?

Pepperlibido-
I am looking for a solution to this as well, and have had no luck.If anyone out there has a solution or a mod would love to know.
Thanks

Scott
4.18
Apache
__________________
scott v
x cart version 4.1.8 (Unix)
Reply With Quote
  #3  
Old 04-05-2008, 01:29 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Wish to link from product page to category page?

Try adding this, it's untested but looks to be working. So you might want to polish it off...

{math assign="up_one" equation="x-2" x=$location|@count}
<a href="{$location[$up_one].1|amp}">{$location[$up_one].0}</a>

Hope this helps you somewhere.
__________________
Doms
kube v4.1.9
Reply With Quote
  #4  
Old 04-05-2008, 07:50 PM
 
pepperlibido pepperlibido is offline
 

Advanced Member
  
Join Date: Dec 2007
Location: Queensland Australia
Posts: 39
 

Default Re: Wish to link from product page to category page?

kube, it works spot on. Thank you so much.

And for those that might be interested it is important for SEO purposes to have the following link structure.

Linking down, link: -
Home page to tier 2 pages (best to avoid linking your home page any deeper than tier 2 pages).
Tier 2 pages to tier 3 pages
Tier 3 pages to tier 4 pages (best to avoid going deeper then tier 3 if possible)

Linking back up link: -
Tier 2 pages to tier 1 (home) page
Tier 3 pages to tier 1 and tier2 pages
Tier 4 pages to tier 1 tier 2 and tier 3 pages


Search engines very seldom go beyond tier 3 pages so it is best to avoid going deeper than tier 3 if possible, however definitely no deeper than tier 4.



If possible it is best to place the links in the content (text) of the page otherwise just place them at the bottom of the page.
__________________
Gerard
Version 4.1.8 Gold
Linux
Server Zeus
Australia
Reply With Quote
  #5  
Old 04-08-2008, 10:11 AM
 
fotodog13 fotodog13 is offline
 

Senior Member
  
Join Date: Sep 2007
Posts: 126
 

Default Re: Wish to link from product page to category page?

HiKube,

Thanks for the code
It worked great but really wanted to have a button on the site for ease of use so I did this

in the skin1/customer/main/products.tpl
I added the following

<td>

{include file="buttons/go_back.tpl" style="button"}

</td>


I added this new go back button right next to the add to cart and a wish-list button I have on this page.

I have the three buttons lined up in a row the last one being the one that throws the visitor back to the category page.

I placed the code ( shown above) right after this line

{if ($login ne "" || $config.Wishlist.add2wl_unlogged_user eq 'Y') && $active_modules.Wishlist ne ""}
{include file="customer/add2wl.tpl"}

<td>&nbsp;&nbsp;&nbsp;</td>


I just put this on now but seems to work perfectly. It lets me go from the product page back to the catalog page. Hopefully it lets me help someone else out and start to payback all the help I have gotten from these forums.

Scott V
__________________
scott v
x cart version 4.1.8 (Unix)
Reply With Quote
  #6  
Old 04-08-2008, 10:51 AM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Wish to link from product page to category page?

cool fotodog13 ;D

Just one note I had to add: the context of the button isn't really a go-back button. It actually goes up one level/category. So if you were to deliberately jump to a deeper levelled subcategory it will pick the subcategory above. Anyways, you probably already knew that (but had to state it just in case).

It should work in most parts of the store if there are similar category structures in place via the location array. It appears to fail at the home page (or any top levels) which could be easily resolved by including the appropriate IF NOT statement.
__________________
Doms
kube v4.1.9
Reply With Quote
  #7  
Old 04-08-2008, 01:03 PM
 
fotodog13 fotodog13 is offline
 

Senior Member
  
Join Date: Sep 2007
Posts: 126
 

Default Re: Wish to link from product page to category page?

yup - I go that
In my case I only need to go up one sub-category but seem what you mean-
wroks ok for the application I have at hand but with a but more tweaking - as you have described it would be even better.
Not a coder but will try to take a peek at this and adding that to the forums for others
S
4.18
__________________
scott v
x cart version 4.1.8 (Unix)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:27 PM.

   

 
X-Cart forums © 2001-2020