Author Topic: Show full category tree in all url's  (Read 1152 times)

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Show full category tree in all url's
« on: May 24, 2019, 12:46:12 pm »
At this moment if I copy a link from the root category menu the URL link will look like this:

www.mywebsite.com/parent-category/product

If I browse in all subcategories in the same product the link will look like this:

www.mywebsite.com/parent-category/subcategory1/subcategory2/product

How can I set the URL to be with the full category tree (like the 2nd example) in all the links in my website?
Joomla 3.8.13
Virtuemart 3.4.2

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10358
  • VirtueMart Version: 3+
Re: Show full category tree in all url's
« Reply #1 on: May 25, 2019, 01:44:18 am »
This will make breadcrumbs etc show incorrectly

BACKUP YOUR FILE BEFORE DOING AN OVERRIDE

sublayouts/products.php


AFTER

foreach ($products as $product ) {

ADD
// start canonical only links
          $min_cat = min(array_column($product->categoryItem, 'virtuemart_category_id'));
          $product->virtuemart_category_id=$min_cat;
          if ($product->product_canon_category_id >0){
        $product->virtuemart_category_id=$product->product_canon_category_id;
        }
        $product->link= JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id.'');
        // end canonical link



J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #2 on: May 27, 2019, 10:36:13 am »
Thank you for your answer. Breadcrumbs are not really a big problem, but  Unfortunately it didn't fixed the links issue. The links still refer the parent category. I applied your code both in components->com_virtuemart folder and in my template's products.php.
Joomla 3.8.13
Virtuemart 3.4.2

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #3 on: May 27, 2019, 11:49:53 am »
VM config->Configuration->Configuration->SEO Tab->Use full category tree for product links

gives me e.g.

http://virtuemartshop.eu/shop/wear/mister/dress-shirt-with-tie-detail
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #4 on: May 27, 2019, 14:46:47 pm »
Tried this already but don't work unfortunately. Maybe bugged?
Joomla 3.8.13
Virtuemart 3.4.2

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3978
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Show full category tree in all url's
« Reply #5 on: May 27, 2019, 15:49:01 pm »
Perhaps the problem is same here : http://forum.virtuemart.net/index.php?topic=142667.msg503644
Do you use same release ?

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #6 on: May 27, 2019, 16:56:40 pm »
I have an earlier version of VM because of lots of customizations (3.2.12)

Joomla 3.8.13
Virtuemart 3.4.2

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27501
  • Always on vacation
    • Jenkin Hill Internet
Re: Show full category tree in all url's
« Reply #7 on: May 27, 2019, 18:45:13 pm »
VM3.2.12 is nearly 18 months old - AKAIK it does not work with current Joomla versions, 3.9+, and yes, it certainly had bugs which have long been corrected.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.1.10121 on Joomla 3.9.11 PHP 7.0.33
Testing 3.6.1.10129 on Joomla 3.9.11

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #8 on: May 27, 2019, 23:01:45 pm »
Quote
Tried this already but don't work unfortunately. Maybe bugged?

It is annoying when posters complain about bugs yet won't update..  :(
That's what updates are there for!
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #9 on: May 28, 2019, 08:59:54 am »
Quote
Tried this already but don't work unfortunately. Maybe bugged?

It is annoying when posters complain about bugs yet won't update..  :(
That's what updates are there for!
First of all I didn't complain. I asked for help. If somebody faced a silimar problem or if somebody knows the issue and give a the solution. If there is no a solution, no problems, I will search it further.
FIY I updated yesterday virtuemart in order to see if this problem exists and in newer versions. The result was a wasted hour of restoring backups. Not all websites or companies are able to update frequently for various reasons. I have dozens of important plugins that does not work with all versions of joomla or virtuemart.
Joomla 3.8.13
Virtuemart 3.4.2

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #10 on: May 28, 2019, 10:32:53 am »
@ chimairax

1. you never posted any versions initially  - if u had our first response would have been update and try again
http://forum.virtuemart.net/index.php?topic=79799.0
http://forum.virtuemart.net/index.php?topic=104795.0

2. you only had to do a quick install and test on the latest release to see if it works - this way you waste your time - not ours
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #11 on: May 28, 2019, 11:11:22 am »
I just set a virtual server with joomla 3.8.12 and   VirtueMart 3.4.5 10063 and the problem still here.
Tried on all templates (mine and default) but no luck. Links still refers the parent directory.

I am not here to waste your time. I am here because this community knows virtuemart better than I do. I asked  if this problem is something that developers or members are aware of. If not, then no one is obligated to waste their time on me.

PS: You are right about not saying my versions.
Joomla 3.8.13
Virtuemart 3.4.2

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #12 on: May 28, 2019, 11:25:41 am »
on https://test.gjcwebdesign.com/reviews/the-shop/man/hats/safety-helmet-detail it is working

this is the last stable  VirtueMart 3.4.2  ( http://dev.virtuemart.net/attachments/1144/com_virtuemart.3.4.2.9966_package_or_extract.zip) & Joomla! 3.9.6   
I don't know what the "problems" are running 3.4.2 on J3.9 - I haven't experienced any yet

Try the above versions till the 3.4.5 10063 is fixed

also please report your findings here:  http://forum.virtuemart.net/index.php?topic=142667.msg503644

GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #13 on: May 28, 2019, 11:41:42 am »
on https://test.gjcwebdesign.com/reviews/the-shop/man/hats/safety-helmet-detail it is working

this is the last stable  VirtueMart 3.4.2  ( http://dev.virtuemart.net/attachments/1144/com_virtuemart.3.4.2.9966_package_or_extract.zip) & Joomla! 3.9.6   
I don't know what the "problems" are running 3.4.2 on J3.9 - I haven't experienced any yet

Try the above versions till the 3.4.5 10063 is fixed

also please report your findings here:  http://forum.virtuemart.net/index.php?topic=142667.msg503644
I saw your website, mine doesn't work this way.
Example, if I check the "PC Hardware" category, in the next page visitor can see all the hardware products. If the visitor click in the next category, example "Hard Drives" he will see just the hard drives etc.
The problem is when my visitor is in the "Hardware" category, when he clicks to a product the url link contains only the parent category, as a result custom filters doesn't display right.

The only way my visitor see the page correctly, is to navigate till the last category and click to the product. But:
1. He cannot see all of the available products (example: Hard Disk category contains subcategories: SSD - HDD - Ext HDD . An undecided customer would see all the available hard drives, not only SSD's or HDD's)
2. External links (example modules on my website such as top products, latest products etc) uses the parent category to their links.

If I manually change the category in the link (example it's pc-hardare-100 and manually write hard-disks-120) it will display the correct filters and the correct breadcrumbs. That's what I need. All of my links to grab the last category and not the parent.

I tried and with the version you mentioned, still, it grabs the parent category in url.
Joomla 3.8.13
Virtuemart 3.4.2

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #14 on: May 28, 2019, 12:02:24 pm »
if I understand u correctly this is correct .. the hard drives are only in the hard drive category so viewing hardware ( above hard drives) you won't see hard drives

I think you need to add the hard drives also in the hardware cat .. this is what this plugin does

http://www.open-tools.net/virtuemart/auto-parent-categories.html

re-reading your post though I still don't get what you mean -- how about some live urls???

what do u mean by filters?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation