hello Martyn, most of our software and extensions expect products to be associated with full path of the categories, so if you have a product assigned to "top->sub1->sub2->sub3" it should be also associated to to+sub1+sub2+sub3 (i.e. all of them)
for this to work fluently you'd need to:
- use canonical categories in product config, so that URL is always constant and there is just one canonical path (and canonical category) to the product
- possibly use our software to associate all products to their parent categories:
-- there is a button for this in OPC Utilities (All products to all of their parent categories -> click Action... )
-- there is asystme ready for cron to do this automatically:
for cpanel - you can create an executable in your /home/{user}/cron.sh
- Code: Select all
#!/bin/bash
STAGINGPATH="/home/{your user}/public_html"
URL=https://www.{domain}/
/usr/local/bin/php $STAGINGPATH/administrator/components/com_onepage/cli.php --task=to_parent_cats --override_jroot=$STAGINGPATH --debug=1 --return_status_json=0 --myurl=$URL --lang=en
or just use the above line in cron to run every hour to associate them automatically
the main reason for this is performance. if system was to collect all child categories and then iterate them and find all associated products, this would be many many times slower compared to just having them associated to every single node in their category path.
best regards, stan