- Issue created by @tonytheferg
- Status changed to Needs review
over 1 year ago 3:49pm 14 September 2023 - last update
over 1 year ago 6 pass, 4 fail Here is this for starters. See if tests pass.
Not sure if something like this would be more explicit for the EventSubscriber:
$exclude_parent = $parent_variation->hasField('exclude_parent'); if ($sync_quantity && !$parent_variation->get('exclude_parent')->isEmpty()) { $exclude_parent = $parent_variation->get('exclude_parent')->value; } if ($exclude_parent) { $order_item->setData('commerce_vado_exclude_parent', TRUE); } if ($order_item->getData('commerce_vado_exclude_parent', TRUE)) { $order_item->delete(); }
- last update
over 1 year ago 6 pass, 4 fail - last update
over 1 year ago 3 pass, 5 fail per @ericchew via slack:
I suppose the first one is good in case someone wants to subscribe to delete events, they could know the reason for deleting
The last submitted patch, 2: 3387348-2.patch, failed testing. View results →
The last submitted patch, 3: 3387348-3.patch, failed testing. View results →
The last submitted patch, 4: 3387348-4.patch, failed testing. View results →
- last update
over 1 year ago 12 pass, 1 fail - last update
over 1 year ago 13 pass The last submitted patch, 8: 3387348-8.patch, failed testing. View results →
- last update
over 1 year ago 14 pass Not sure the best way to handle the deprecated: creation of dynamic property drupal\tests...
Might be nice to just extend the Cart browser test base for the products and variations.- last update
over 1 year ago 14 pass Here is an update hook for review.
After running the update and testing, You can reset your installed version to 8202 with this command:drush ev "\Drupal::service('update.update_hook_registry')->setInstalledVersion('commerce_vado', 8202);"
This works, but I'm not sure on the field name. We have
include_parent
which is about the parent variation being included in the discount, soexclude_parent
sounds like it would just be the opposite of that, but actually it's to exclude the variation.I'd prefer not having to change include_parent field name, so maybe we need to name this field
exclude_parent_variation
?Also I'll need to account for this in the order processor, and add test coverage, which will be easy.
- last update
10 months ago 11 pass, 2 fail - last update
10 months ago 11 pass, 1 fail - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass No clue why Stan is complaining about this:
------ ------------------------------------------------------------------- Line commerce_vado.install ------ ------------------------------------------------------------------- 67 Inner named functions are not supported by PHPStan. Consider refactoring to an anonymous function, class method, or a top-level-defined function. See issue #165 (https://github.com/phpstan/phpstan/issues/165) for more details. ------ -------------------------------------------------------------------
We might just have to add that to the baseline, as it's just an update hook.
- last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 11 pass, 2 fail - last update
10 months ago 11 pass, 2 fail - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 11 pass, 2 fail - last update
10 months ago 14 pass Notes of interest on the logic behind the exclude parent feature:
When the parent is excluded, children are added to the cart, with no other vado data. So no discounts, no links to parent data, no sync data, and no combo id.
https://git.drupalcode.org/project/commerce_vado/-/merge_requests/17/dif...The quantity for each child is multiplied off the parent order item to account for when a parent has more than one child:
https://git.drupalcode.org/project/commerce_vado/-/merge_requests/17/dif...The parent variation price is excluded because the variation itself is excluded.
https://git.drupalcode.org/project/commerce_vado/-/merge_requests/17/dif...- last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass - last update
10 months ago 14 pass -
tonytheferg →
committed ee0c72b1 on 2.0.x
Issue #3387348 by tonytheferg: Add option to exclude parent from cart
-
tonytheferg →
committed ee0c72b1 on 2.0.x
- Status changed to Fixed
10 months ago 1:49pm 28 February 2024 Automatically closed - issue fixed for 2 weeks with no activity.