Jump to content

The Parent Service Id Already Exists As A Child To Another Service.


Timothy

Recommended Posts

Hello,

I am trying to build a order form to sell a single product plus multiple addon products. I have run into some errors and I'm hoping you guys can tell me what I'm doing wrong or confirm this as a bug.

 

I have created 3 basic product definitions with the universal module. I then created the groups, packages and order form as follows.

 

1: Group Creation:
Create Standard group called standard_example. Create two Addon Groups called addon_example1 and addon_example2. Add the two addon_example groups to the standard_example group.

 

2:Package Creation: All 3 packages used different products from the universal module.

  • Create a package and call it 'example_product'. Assign the package to the 'Standard_example' group.
  • Create a package called example_addon1 and assign it to the addon_example1 group.
  • Create a package called example_addon2 and assign it to the addon_example2 group

 

3:Order Form Creation:
Add a order form and call it 'Example_order'. I left all options at default for this test and added the 'Standard_example' to the assigned group field.

 

4: Testing.

I have tried 3 test cases.

  • Buy the example_product with no addons.
  • Buy the example_product with 1 of the two addons selected.
  • Buy the example_product with both addons selected.

 

5: Results

Case 1 and 2 work fine. In the case of test 3 the system has the error 'The parent service ID already exists as a child to another service.' This blocks checkout from happening.

 

Additional Notes:
When on the review order screen, you can click to remove the primary product and it will remove the first selected addon with it. This leaves the second selected addon product still on the order screen. I would think that if you remove the primary product, all addons would go with it.

 

The error happens independently of the payment module. I've tried with no payment module and stripe. Same error either way.

 

I have tested this on 3.0.1, 3.0.2, and 3.0.3. The issue is identical on all 3.

 

This is the same error as indicated at http://www.blesta.com/forums/index.php?/topic/1020-child-exists-to-another-service. However, in my case it only happens with multiple addon products.

 

Is anybody else able to shed any light on this issues?

Link to comment
Share on other sites

Have you checked that your service and addons are not following a grandfather scheme? e.g. example_product is the parent of example_addon1 and example_addon1 is the parent of example_addon2

 

That error indicates this is what's going on.

Link to comment
Share on other sites

I may not understand fully, but I do not think I am doing that. I have the groups setup like this.

Standard group (parent)
 - Addon group1 (child of standard group)
 - Addon group2 (child of standard group)

Then I have the 3 packages. Each package goes to only one group. The order form then references the standard group. The order form looks correct
and appears to function correctly until the final steps of the checkout where I receive the error.

Is there something else I should be looking for or a different way to set it up?

Link to comment
Share on other sites

As a test, I changed the two addon products to use the same addon group which is then assigned to the standard group. This makes the order form show the two addon products as 'or' options. I can select one or the other, but not both. Doing it this way does not show the error during checkout.

If I have the two addon products in separate addon groups with both addon groups assigned to the standard group,
then the products show up as a 'and' option. I am able to buy addon products in any combination associated to the main product.
This is what I am trying to achieve and the error shows when doing it this way. Any addons past the first selected one do not appear
to be linked to the primary product. This can be demonstrated on the product review screen by removing the primary product. Only the
first addon product is removed with the primary. Additional addons are not removed.


Should multiple addons to a single product work as stated above? Is there a different way to achieve selling multiple addon products associated to a single parent product?

Is there anything else I can do to test, or information I can provide to help solve this?

Link to comment
Share on other sites

This is indeed a bug. Fixed in CORE-798 for v3.0.4.

 

The error you received is legitimate--the addons were being incorrectly added following a grandfather scheme, rather than just as children to a single parent.

 

The issue resides only with the Order plugin. If you want to pre-patch your install, then:

 

Update /plugins/order/models/order_orders.php and change:

$service_id = $this->addService($details, $addon, $packages, $coupon_id);

if ($service_id)
	$service_ids[] = $service_id;

to:

$addon_service_id = $this->addService($details, $addon, $packages, $coupon_id);

if ($addon_service_id)
	$service_ids[] = $addon_service_id;
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...