Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Need Parent Product Category IDs
Need Parent Product Category IDs
Need Parent Product Category IDs
Hi,
Is there a way to get the categories of a parent product? In my VM2 setup I have parent products that are assigned categories and stockable generic child variants that do not have any categories assigned.
The recipe below works great when viewing the parent product, but when you switch to a child product (by using the drop-down box on the product details page which refreshes the page) the module disappears.
Code:
$vm = JomGenius("virtuemart");
// Product Info
$category_id = $vm->info("category_id");
$ancestor_categories = $vm->info("ancestor_category_ids");
// Parent Product Info... not sure where to go from here.
$parent_product_id = $vm->info("product_parent_id");
// Display the module
if (in_array("119", $ancestor_categories)) return 110;
Re: Need Parent Product Category IDs
Hi David,
thanks for this bug report. I'll take a look at this today and will let you know about progress. When I created the category detection I did not take into account child items so it looks like I need to work on that feature.
Best regards,
Stephen
Re: Need Parent Product Category IDs
ok, a question for you (and anyone else) about how to handle this best:
If a child product is not in any specific categories, it's pretty clear that it should be considered to be in the same category or categories as its parent product.
However, if a child product has specific categories assigned to it, should we consider these as replacing the parent item's categories, or to be additional to them?
For now I'm going to code this as "additional to the parent item's categories" but would be interested in any feedback to the contrary.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Need Parent Product Category IDs
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7633
- Newest User:
- mingle7855
- Members Online:
- 0
- Guests Online:
- 77
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked