Monday, February 10, 2014

Virtuemart 2 - How to remove SEO Suffix from Product Details aka -detail

If your using Virtuemart 2+ it requires you to use a -detail or .html  as a suffix for product pages.  Which really sucks if you are use to using SH404sef or some other plugin that will correctly re-route your URLs and make them nice. SH404sef no longer works with Virtuemart thus we are stuck with the default router. Here is how I fixed the router.php (included at the bottom for your downloading pleasuere)


Since there is not a plugin I dove into the router.php and made some simple quick fixes to ignore the SEO_Suffix and load products.

Around line 633
Code looked for categories in the last segment

$vars['virtuemart_category_id'] = $helper->getCategoryId (end($segments) ,$helper->activeMenu->virtuemart_category_id);
    $vars['view'] = 'category' ;

Changed to
$product = $helper->getProductId($segments ,$helper->activeMenu->virtuemart_category_id);
    $vars['virtuemart_product_id'] = $product['virtuemart_product_id'];
   $vars['virtuemart_category_id'] = $product['virtuemart_category_id'];


//codepyro - removed suffix from router 
  //check if the last segment is a product. 
  //if so then load the product details page instead of category 
 if(isset($vars['virtuemart_product_id']))
  {
   $vars['view'] = 'productdetails';
  }
  else
  { 
   $vars['virtuemart_category_id'] = $helper->getCategoryId (end($segments) ,$helper->activeMenu->virtuemart_category_id);
   $vars['view'] = 'category' ;
  }

Around line 943
//codepyro hack to remove suffix  
  if($this->seo_sufix_size >0)
   $productName =  substr($productName, 0, -(int)$this->seo_sufix_size );



You can download the updated router.php for Virtuemart 2.0.26d  

upload and replace the file
/components/com_virtuemart/router.php

updated 3.14.14 - I didn't realize that the site I had made these adjustments to all of the categories were set as menu items which of course makes a big difference. Anyway the zip file has been updated with the latest router.


Stumble Upon CodePyro

70 comments:

Anonymous said...

Hu,
Thank u for very helpful post!:) Can u help me a bit?
I need a suffix word, but I would like this order:
#suffix word - product title

I would be very grateful if you could help, thank you!

Josh Tischer :: CodePyro said...

Can you explain further what you are looking for? Is it something like
/category/SUFFIX-product

Josh Tischer :: CodePyro said...

Just got another comment and it appears to have been deleted. If you need help fixing this on your site, let me know.

Unknown said...

Hi, Josh

Thanks for your fix, but it's doesn't work for Joomla 2.5.19 VM 2.0.26

I'll be very glad for your help



Josh Tischer :: CodePyro said...

send me your router file i would be happy to take a look. info at codepyro.com

Anonymous said...

Thenk you form Russia.

Unknown said...

Hi, Josh
Thank you for help!!!
Your router.php is what I was looking for.
Best regards

Anonymous said...

hi, for J 2.5.20. no work :-( sorry can you upgrade it? thanks

Anonymous said...

this solution does not work on Virtuemart 2.6

Unknown said...

Any company claiming to be an affordable Dallas Affordable SEO Services solution included, really should be adding value to your company

Unknown said...

very unique blog

Affordable Search Engine Optimization

Anonymous said...

Hi Josh
Thank you for this hint...
But I'm now migrating to Virtuemart 3.x, and this hack seems not working anymore: do you have some suggestions to get it working again on new 3.x VM series? Thank you in advance for any help.
Regards

Unknown said...

We provide white-hat SEO services that deliver long-term results to companies in the Dallas/Fort Worth area. Contact us now for a FREE SEO site audit affordable SEO Dallas.

Unknown said...

You could have increased the very important concern.. thank you intended for revealing.. my spouse and i should browse much more provide problems with this weblog.. maintain putting up.. Web optimization Baclinks  Blog Commenting Service And Seo Services.

markson said...

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! dallas seo

Unknown said...

Wonderful!! this is really one of the most beneficial blogs I’ve ever browsed on this subject. I am very glad to read such a great blog and thank you for sharing this good info with us. http://www.john-pierres.com/seo/why-is-search-engine-optimization-so-huge-for-your-business-success/

Seo said...

Hello there, My spouse and i discover scanning this article a new enjoyment. It is quite very helpful and useful and extremely considerably looking forward to examining more of your do the job. All In One Seo Backlinks To Rank You In 5$

Richard C. Lambert said...

Which really sucks if you are use to using SH404sef or some other plugin that will correctly re-route your URLs and make them nice seo

Adiba Alam said...

Real part of the total populace is getting to web for host of purposes. Be that as it may, of these reason, the need to accumulate more data holds the need. whakki-media.co.uk

mind.it said...

I love this blog!! The flash up the top is awesome!! www.rankible.com

mayazoe said...

How do you promote your business with backlinks? There are of course several ways to promote your business and promoting it with backlinks is one of the very best.
link building services

devidmiller5060 said...

Technical writing blog is a virtual content on any technical concept, including, engineering, aeronautics, marine, geographical surveys, oil explorations, advertising, media, sound or for that matter anything which has a scientific relation.
fashion school

Anna Schafer said...

I couldn't have asked for a simpler read with great tips like this... Thanks! What do Internet Marketing services include

Owais Raza said...

If you have ever dreamed of working on Wall Street, then you might be an ideal candidate for a job with an SEO agency. That may seem like quite a stretch to go from stocks to search engine optimization, but both industries are quite chaotic and involve a lot of risk. link of my website

Unknown said...

Web Honkers is Canada’s leading digital marketing firm, with top rated SEO Experts who are committed to our client’s success with offices in Toronto, Canada and in London, UK.
SEO Company

Anonymous said...

It’s amazing to visit again n again coming to your blogs the superb effort is here packro.com.

Roman lesnar said...
This comment has been removed by the author.
Roman lesnar said...

I'm not shure, because I never used sh404sef with Joomla 2.x. But my assumption is that the Joomla redirect manager will not catch a 404 page not found error, because VirtueMart will probably automatically redirect to your homepage. However, it should be possible to add the old url and the new url manually into the Joomla redirect manager. If you click on 'New' in the Joomla redirect Manager, a form with old url/new url shows up.
blog comments services

Owais Raza said...

To have a brilliant start in your online business, it is very important to have the assistance of an SEO Company. For getting tied with the best SEO Company you can have a small research about the SEO services and then craft your pick. Do you think the task simple as it is? No, it is not. To choose a dependable Company is a tiring task. properpbn.com

Owais Raza said...

Planning to get SEO Services to make out your website and help you earn and market! The business is not going online. With the help of a website even small businesses are getting a chance to market their product online and sale. josh

Unknown said...

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. High Trust Flow

Unknown said...

What?s Taking place i am new to this, I stumbled upon this I’ve discovered It positively helpful and it has aided me out loads. I hope to contribute & assist other customers like its aided me. Good job. blog marketing digital

Unknown said...

Thanks a ton for this, I am greatful for the info blog marketing digital

Unknown said...

I conceive you have noted some very interesting details , regards for the post. blog de seo

Robert said...

useful information on topics that plenty are interested on for this wonderful post.Admiring the time and effort you put into your b!.. best seo company in nepal

James jones said...

I found your site thanks a Google search. You have done a fine work. And it’s really nice to read you. I’ll definitely be back! Neo E-Marketing

Jessica Schweizer said...

Your article has piqued a lot of positive interest. I can see why since you have done such a good job of making it interesting. internet marketing

Tree removal near me said...

You have written a good article.
Tree removal near me

electrician red deer said...

This is a good post. This post gives truly quality information. I’m definitely going to look into it. Keep up the good work.

Pest Control Red Deer said...

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!

landscaping-henderson-nv.com said...

Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info. Fantastic nice. I appreciate this post.

https://rdmassage.com said...

Valuable information and insights here. I've seen so many articles, but definitely, this has been the best I’ve read! 

Painters Red Deer said...

Wow! It's a really great experience sharing with us. I like your post, it's really interesting.

mtom said...

Just a smiling visitant here to share the love btw outstanding style . email marketing

Furnace Cleaning Red Deer said...

Valuable information and insights here. I've seen so many articles, but definitely, this has been the best I’ve read!
Furnace Cleaning Red Deer

Home remodeling in Riverside said...

Nice blog! I've seen so many articles, but definitely this has been the best I've read! I like your post, it's really interesting.
Home remodeling in Riverside

Home Remodeling Riverside said...

Valuable information and insights here. I've seen so many articles, but definitely, this has been the best I’ve read!
Home Remodeling Riverside

Electrican Regina said...

I really enjoy reading all of your work.Great post and right to the point. You rock and please keep up the good work!
Electrician Regina

Massage Therapy Red Deer said...

Great post and right to the point.I really enjoy reading all of your work.
Massage Therapy Red Deer

brittanymlemay said...

Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck. seo link building

Furnace Repair Regina Sk said...

Posts are great. Thank you for sharing this ideas. Keep up the good work!
Furnace Repair Regina Sk

https://concrete-saskatoon.ca said...

Posts are great. Thank you for sharing this ideas. This post gives truly quality information. https://concrete-saskatoon.ca

Masonry Edmonton Contractors said...

Thanks for sharing this quality information with us. Masonry Edmonton Contractors

Towing-Las-Vegas-NV said...

A well written and informative blog post.

Towing-Las-Vegas-NV

petterson said...

Great information you shared through this blog. Keep it up and best of luck for your future blogs and posts
cheap dissertation writing service uk

Swetha K said...


I simply go through your article, which a very interesting article looking for more updates. Thank you for sharing.
Oracle Training in Chennai
Oracle Training
Social Media Marketing Courses in Chennai
Tableau Training in Chennai
Primavera Training in Chennai
Unix Training in Chennai
Job Openings in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
Power BI Training in Chennai
Oracle Training in Velachery

Eliza said...

Great knowledge, do anyone mind merely reference back to it Sökmotoroptimering Kungsbacka

Backpage-Cincinnati said...

it's really great to know about how to remove SEO suffix from product details. I have found out that this article have very important details. Though anyone want to know more about classified like Backpage Charleston then please visit harlothub.com

codeaze said...

Hmm it appears like your website ate my first comment (it was super long) so I guess I'll just sum it up what I had written and say, I'm thoroughly enjoying your blog. I as well am an aspiring blog blogger but I'm still new to everything. Do you have any points for novice blog writers? I'd certainly appreciate it. branding agency

Eliza Beth said...

This is actually the kind of information I have been trying to find. Thank you for writing this information. consultor de marketing digital

SEO optimization said...

I found your site thanks a Google search. You have done a fine work. And it’s really nice to read you. https://siglerdigitalmarketing.com/principales-estrategias-de-marketing-digital/

viktoria said...
This comment has been removed by the author.
viktoria said...

Female Escorts in United States without fake, many reviews, only real profiles Visit here: - Escorts usa

DSP SEO said...

I am glad to read your blog. your blog is really awesome and cool. your blog is really great and cool. thanks for sharing the nice and cool post 먹튀안전사이트

DSP SEO said...

Nice post mate, keep up the great work, just shared this with my friendz 먹튀사이트

Puertas de interior said...

nice job

Jeff L. Ventura said...

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! SEO Service on Fiverr

Flora said...

Good article. I liked to read your article, valuable information.
use of python
most paid programming language
benefits of learning python
hadoop career
java interview questions for experienced
selenium interview questions and answers for experienced

Anonymous said...

I would also motivate just about every person to save this web page for any favorite assistance to assist posted the appearance. https://www.sandeepmehta.co.in/affordable-seo-services-delhi/

poojasharma said...

Webgross offers outstanding SEO services Delhi that mould themselves according to the traverse needs of audiences.
SEO Services Delhi

Post a Comment