Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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;

david.corn
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

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.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10093
Newest User:
lamanaudio
Members Online:
0
Guests Online:
108

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