News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

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

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

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




chimairax

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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

Tried this already but don't work unfortunately. Maybe bugged?
Joomla 3.8.13
Virtuemart 3.4.2

Studio 42


chimairax

I have an earlier version of VM because of lots of customizations (3.2.12)

Joomla 3.8.13
Virtuemart 3.4.2

jenkinhill

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

GJC Web Design

QuoteTried 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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

Quote from: GJC Web Design on May 27, 2019, 23:01:45 PM
QuoteTried 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

@ 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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

#11
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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chimairax

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

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 https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation