Support from Acquia helps fund testing for Drupal Acquia logo

Comments

czigor created an issue. See original summary.

czigor’s picture

Status: Active » Needs work
FileSize
24.62 KB

"Shipping service upgrade" and "% off shipping" discounts are both included in the patch.

TODO: do manual tests and write automatic ones.

czigor’s picture

Did some manual tests combining all 3 shipping discount offer types and this patch seems to work. We still need automated tests.

czigor’s picture

Status: Needs work » Needs review
FileSize
47.18 KB

Added tests. Only 2 assertions fail when using shipping_upgrade discount combined with a 20% shipping discount. The shipping_upgrade discount's source service costs $5 (without the 20% discount), the target service originally costs $25 (without any discounts). When we are in the checkout shipping step, the 20% discount is applied on the source service, so $4 is displayed correctly. The target service obtains $4 too, also correctly.

However, when arriving at the review, there's no discount calculation for the source service, so the target service is set to $5 instead of $4.

Added a @todo to the appropriate part of the rules action, not sure yet how to solve this.

Setting it to 'Needs review' to trigger the testbot.

Status: Needs review » Needs work

The last submitted patch, 4: commerce_discount-2913292-percentage_shipping-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

czigor’s picture

Fixed the bug described in #4. Not the nicest fix ever, but don't know how else to get the discounted shipping rate inside the discount rules action.

czigor’s picture

Removing an obsolete rules action.

The reason for only having one rules action (commerce_discount_shipping_service()) handling all three shipping offer types instead of having one action for each offer type is that the actions start the same (and I thought they would end the same too, but they don't).

czigor’s picture

Making the code a bit more compact by outfactoring the price component addition and order saving into a helper function.

  • jsacksick committed 83c4d0c on 7.x-1.x authored by czigor
    Issue #2913292 by czigor: Fix percentage off shipping discounts.
    
jsacksick’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.