- Issue created by @chrisscrumping
- Merge request !73436719: Only empty cart before adding first item to the cart → (Open) created by chrisscrumping
- last update
9 months ago Build Successful - 🇬🇧United Kingdom chrisscrumping
I also note that this also allows you to add multiple items of the same SKU to the cart rather than needing to use the alternative method. Eg
/direct-checkout-by-url?products=1234,5678,1234
Is the same as
/direct-checkout-by-url?products[0][quantity]=2&products[0][sku]=1234&products[1][quantity]=1&products[1][sku]=5678
- 🇳🇴Norway eiriksm Norway
Ouch that seems fairly obvious yeah
Are you able to write a quick test for this as well?
- 🇬🇧United Kingdom chrisscrumping
I am using https://github.com/ddev/ddev-drupal-contrib for testing and I needed to add a composer file to bring in Drupal commerce as obviously that's a dependency.
Shall I commit this as well?
{ "name": "drupal/direct_checkout_by_url", "type": "drupal-module", "description": "Direct checkout by URL in with Drupal Commerce.", "homepage": "https://www.drupal.org/project/direct_checkout_by_url", "license": "GPL-2.0-or-later", "repositories": [ { "type": "composer", "url": "https://packages.drupal.org/8" } ], "require": { "php": "^8.0", "drupal/commerce": "^2.0" }, "minimum-stability": "dev" }
- 🇳🇴Norway eiriksm Norway
That was actually very recently added in https://git.drupalcode.org/project/direct_checkout_by_url/-/commit/1fed4...
But please expand the file like you are suggesting here, sure! Awesome 👍😎
- 🇳🇴Norway eiriksm Norway
Amazing 😍
Could you also fix up the couple of coding standards issues reported?
- 🇬🇧United Kingdom chrisscrumping
Oops VS Code trying to be helpful! Sorted now
- Status changed to Needs work
9 months ago 4:59am 4 April 2024 - Status changed to Active
9 months ago 10:05am 4 April 2024 - 🇬🇧United Kingdom chrisscrumping
Doh yeah!
Now creates and array of available items and adds them to the cart later after a cart reset.
Also written a test that should cover this - when the first item in the array is unknown (and unknown skus are allowed) and we want to reset the cart.
- Status changed to Needs work
9 months ago 11:16am 4 April 2024 - 🇳🇴Norway eiriksm Norway
completely amazing work so far, thanks so much!
Just one last nitpick left on your PR
- 🇬🇧United Kingdom chrisscrumping
Unless I am miss understanding you I am not sure that would work?
That would move the cart reset after adding items to the cart so items would always get removed?
I have wrapped the whole section in an if cart > do this > else redirect. I will push now.
- Status changed to Needs review
9 months ago 2:27pm 4 April 2024 - 🇳🇴Norway eiriksm Norway
Sorry about the bad wording. That's more or less what I meant, thanks!
I will come back for a second look and commit. Changing to needs review in case someone else wants to test/review as well
Thanks again! Really stellar work 👌🚀
- Status changed to Needs work
9 months ago 3:14pm 4 April 2024 - Status changed to Needs review
9 months ago 3:23pm 4 April 2024 - 🇬🇧United Kingdom chrisscrumping
I somehow set it back to Needs work not sure how...