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

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #15 on: May 28, 2019, 12:24:19 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?
With filters I mean Custom Filters Pro plugin from breakdesigns.
It provides filters to products which it limits the result for products (example in hard drives visitor can select 1TB hard drives in order to see only the available 1TB HDD etc).

I will try to be as accurate as I can
Lets use an example item, Intel CPU i3 8100.
This CPU has 4 categories:

PC Hardare (Parent Category)
- CPU
-- Intel
--- 1151 Socket

If my visitor see this product in Best Sellers module in front page and click it, the url will be like this:
myexampleshop.com/pc-hardware-100/46545-8100i3-intel-core-i3-8100-detail
As a result, the breadcrumb will ignore other subcategories, and in my filters it will display irrelevant filters from other categories.

If I browse in all the subcategories manually, the link will look like this:
myexampleshop.com/pc-hardware-100/cpu-110/intel-1151/1151-socket-120/46545-8100i3-intel-core-i3-8100-detail
Which is correct and everything work fine (Breadcrumbs and filters)

On the other hand if I manually type in address bar the following url:
myexampleshop.com/1151-socket-120/46545-8100i3-intel-core-i3-8100-detail
again everything shows and work perfect.

My question is, how can I use the last category (in this example 1151 Socket) as default url route and not the parent category (PC Hardware) in all of my links.
Joomla 3.8.13
Virtuemart 3.4.2

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2473
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Show full category tree in all url's
« Reply #16 on: May 28, 2019, 12:43:03 pm »
Is this even a VM shop ?

ALL your URLS are totally wrong, end up 404.

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #17 on: May 28, 2019, 12:45:20 pm »
Is this even a VM shop ?

ALL your URLS are totally wrong, end up 404.

Jörgen @ Kreativ Fotografi
These are examples, not real url's.
I'm sorry but I am not allowed to post real links because of my manager's restrictions
Joomla 3.8.13
Virtuemart 3.4.2

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: Show full category tree in all url's
« Reply #18 on: May 29, 2019, 22:00:43 pm »
I have an earlier version of VM because of lots of customizations (3.2.12)



what type of customizations?

most customizations can be handled without hacking the core.
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 #19 on: May 30, 2019, 09:23:03 am »
I have an earlier version of VM because of lots of customizations (3.2.12)



what type of customizations?

most customizations can be handled without hacking the core.
As I mentioned I tried latest joomla and virtuemart versions, but my urls are exactly the same. An update will not solve my problem.
Joomla 3.8.13
Virtuemart 3.4.2

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27602
  • Always on vacation
    • Jenkin Hill Internet
Re: Show full category tree in all url's
« Reply #20 on: May 30, 2019, 11:21:42 am »
An update will not solve my problem.

Nope, but it might save your site from hackers!   http://forum.virtuemart.net/index.php?topic=118683.0
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.10.10211 on Joomla 3.9.13 PHP 7.0.33

chimairax

  • Beginner
  • *
  • Posts: 26
  • A beginner
  • VirtueMart Version: 3.4.2
Re: Show full category tree in all url's
« Reply #21 on: May 31, 2019, 13:35:00 pm »
An update will not solve my problem.

Nope, but it might save your site from hackers!   http://forum.virtuemart.net/index.php?topic=118683.0
Your post worked to me as a danger bell and I updated everything.
Thanks for this.

Now I have the latest VM and Joomla 3.8.12 working perfect.

The most difficult part was the unsupported plugins fixing, and the customizations I made in VM Core.

I hope to find also a solution for the url's
Joomla 3.8.13
Virtuemart 3.4.2

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: Show full category tree in all url's
« Reply #22 on: June 05, 2019, 14:18:06 pm »
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.

HAVE YOU USED THE FORCE CANONICAL URL OPTION IN CONFIGURATION?


also , if you want the url to be the subcategory,
then you need MAX instead of MIN in the code i posted.

this line takes the LOWEST category ID, if you want subcategory, you need the highest

 $min_cat = max(array_column($product->categoryItem, 'virtuemart_category_id'));


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