Conyx Group
Total Posts: 60
Joined: 2008-03-19
I coded my own method and now the product pages always point to the original URL...there still might be some bugs, but i will fix that (if any).
let me know if im right: http://www.dogbedmall.com/magento/dog-beds/extra-small-dog-beds
most of the items on this site are in 5 or more different categories, but the product pages all point to the orignal URL.
Any thoughts would be great..
Posted: May 15 2008
| top
Conyx Group
Total Posts: 60
Joined: 2008-03-19
found a bug...hmmmmmm...almost there ill figure it out...i was so excited sorry folks…
Posted: May 15 2008
| top
| # 1
Conyx Group
Total Posts: 60
Joined: 2008-03-19
FIXED! I think it works perfect now!
Posted: May 15 2008
| top
| # 2
Conyx Group
Total Posts: 60
Joined: 2008-03-19
I told the script to always re-direct to the original URL, so no matter now many items u add to whatever amount of categories it will always go to the original url of the product.
Posted: May 15 2008
| top
| # 3
dan_w
Total Posts: 245
Joined: 2008-01-04
nice work...any plans to share the changes with the peanut gallery?
Posted: May 15 2008
| top
| # 5
NickL
Total Posts: 188
Joined: 2007-08-31
I’m also curious...as I’m moving into some SEO work. Post your methods if you can Conyx. Thanks!
Signature
nickL ~ i build stuff
Twitter me: twitter.com/ibuildstuff
My Blog: ibuildstuff .wordpress.com
Posted: May 15 2008
| top
| # 6
Conyx Group
Total Posts: 60
Joined: 2008-03-19
You only need to edit “list.phtml" inside “catalog” > “product” folder
edit the bold href(link) part, which is the image link (note: theis is not the modified line):
<a href=”<?php echo $_product->getProductUrl() ?> ” title="<?php echo $this->htmlEscape($_product->getName()) ?>">
edit the bold href(link) part, which is the product link (note: theis is not the modified line):
<a href=”<?php echo $_product->getProductUrl() ?> ” title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a>
If you guys cant solve it PM me, im pointing you in the right direction so you should be able to solve it.
Posted: May 15 2008
| top
| # 7
Greatmedia
Total Posts: 109
Joined: 2008-05-15
The Netherlands
i to would like this mod, let me know if you are going to share it with us
Posted: May 15 2008
| top
| # 8
Conyx Group
Total Posts: 60
Joined: 2008-03-19
NOTE: The code I posted doesn’t fix the problem, I stated somewhere in the post that this is not the code fix, but the spot you modify to fix the url issue (thats were I made my modification and it works).
I am going to release the code, but once it’s determined its the best approach.
Posted: May 16 2008
| top
| # 9
Dustin
Total Posts: 117
Joined: 2008-03-13
Columbus, OH
Conyx Group - 15 May 2008 10:47 AM
You only need to edit “list.phtml" inside “catalog” > “product” folder
edit the bold href(link) part, which is the image link (note: theis is not the modified line):
<a href=”<?php echo $_product->getProductUrl() ?> ” title="<?php echo $this->htmlEscape($_product->getName()) ?>">
edit the bold href(link) part, which is the product link (note: theis is not the modified line):
<a href=”<?php echo $_product->getProductUrl() ?> ” title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a>
If you guys cant solve it PM me, im pointing you in the right direction so you should be able to solve it.
Here is what I did to get this to work.
The place he has bolded I replaced with this:
<?php echo $this->getBaseUrl() . $_product->getUrlKey() . '.html' ?>
I know there is a field in the db that stores the url key with the .html on the end, but I have not figured out how to make a call to get that yet, but this works great for me for now.
Conyx Group
Total Posts: 60
Joined: 2008-03-19
had the same approach but as you notice you have to cheat the system with the .html inclusion (which works so its fine), but i do think there is a more efficient way (cleaner I should say).
But get job on figuring it out!!!! Wasnt so hard at all!
Conyx Group
Total Posts: 60
Joined: 2008-03-19
I mean great* on figuring it out!!!!
bloggleme
Total Posts: 90
Joined: 2008-05-06
This is pretty limited. There are tons of files and pages that may link to your product. Make sure you go through all of your pages to replace the old code with the new.
Ronny Lange
Total Posts: 18
Joined: 2008-02-03
Munich
Yes you are right - cause of the internal link structure you also have to replace the code in upsell.phtml, crossell.phtl and related.phtml.
How are you dealing with the main category - is it the first one the product linked to? I didn’t see any possibility to assign a main category.
Signature
http://www.livac.de
bloggleme
Total Posts: 90
Joined: 2008-05-06
They are not dealing with the main category at all. The way they are doing it is basically disabling category rewrites all together. You do not have http://www.yoursite.com/maincategory/product.html - its just http://www.yoursite.com/product.html
Also, I went deep into one of the Url.php files (handles rewrites) and found the getProductUrl function. That function is called any time you link to a product, so you can simply change that function.