News:

Looking for documentation? Take a look on our wiki

Main Menu

Show full category tree in all url's

Started by chimairax, May 24, 2019, 12:46:12 PM

Previous topic - Next topic

chimairax

#15
Quote from: GJC Web Design 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?
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

Is this even a VM shop ?

ALL your URLS are totally wrong, end up 404.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

chimairax

Quote from: Jörgen 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
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

Quote from: chimairax on May 27, 2019, 16:56:40 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.

chimairax

Quote from: PRO on May 29, 2019, 22:00:43 PM
Quote from: chimairax on May 27, 2019, 16:56:40 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.
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

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

chimairax

Quote from: jenkinhill on May 30, 2019, 11:21:42 AM
Quote from: chimairax on May 30, 2019, 09:23:03 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
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

Quote from: chimairax 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.

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'));