-
Couldn't load subscription status.
- Fork 40
adding gift card support for underarmour #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: magic_integration_latest
Are you sure you want to change the base?
adding gift card support for underarmour #504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Missing handling for translations.
| $giftCardDiscountAmount = 0; | ||
| //Check if the customer has applied GiftCards | ||
| if($quote->getMageworxGiftcardsAmount()) { | ||
| $giftCardDiscountAmount = abs($quote->getMageworxGiftcardsAmount()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified with:
| $giftCardDiscountAmount = 0; | |
| //Check if the customer has applied GiftCards | |
| if($quote->getMageworxGiftcardsAmount()) { | |
| $giftCardDiscountAmount = abs($quote->getMageworxGiftcardsAmount()); | |
| } | |
| // Check if the customer has applied GiftCards | |
| $giftCardDiscountAmount = !empty($quote->getMageworxGiftcardsAmount()) | |
| ? abs($quote->getMageworxGiftcardsAmount()) | |
| : 0; |
| if($giftCardDiscountAmount > 0) | ||
| { | ||
| $totalAmount = $totalAmount - $giftCardDiscountAmount; | ||
| $giftCardDiscount = [ | ||
| 'gift_card_discount'=> $giftCardDiscountAmount, | ||
| ]; | ||
| $orderNotes = array_merge($orderNotes, $giftCardDiscount); | ||
| } | ||
| $promotions = [ | ||
| 'type' => 'gift_card', | ||
| 'code' => 'gift_card_number', | ||
| 'value' => $giftCardDiscountAmount, | ||
| 'description' => 'applied', | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there's no Gift Card Discount applied, I believe the $promotions should be empty
| if($giftCardDiscountAmount > 0) | |
| { | |
| $totalAmount = $totalAmount - $giftCardDiscountAmount; | |
| $giftCardDiscount = [ | |
| 'gift_card_discount'=> $giftCardDiscountAmount, | |
| ]; | |
| $orderNotes = array_merge($orderNotes, $giftCardDiscount); | |
| } | |
| $promotions = [ | |
| 'type' => 'gift_card', | |
| 'code' => 'gift_card_number', | |
| 'value' => $giftCardDiscountAmount, | |
| 'description' => 'applied', | |
| ]; | |
| $promotions = []; | |
| if($giftCardDiscountAmount > 0) | |
| { | |
| $totalAmount = $totalAmount - $giftCardDiscountAmount; | |
| $giftCardDiscount = [ | |
| 'gift_card_discount'=> $giftCardDiscountAmount, | |
| ]; | |
| $orderNotes = array_merge($orderNotes, $giftCardDiscount); | |
| $promotions = [ | |
| 'type' => 'gift_card', | |
| 'code' => 'gift_card_number', | |
| 'value' => $giftCardDiscountAmount, | |
| 'description' => 'applied', | |
| ]; | |
| } |
| 'rzp_order_id' => $razorpay_order->id, | ||
| 'items' => $items, | ||
| 'message' => 'Razorpay Order created successfully' | ||
| 'message' => 'Razorpay Order created successfully', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered using __() for translation support?
Note :- Please follow the below points while attaching test cases document link below:
- If label
Testedis added then test cases document URL is mandatory.- Link added should be a valid URL and accessible throughout the org.
- If the branch name contains hotfix / revert by default the BVT workflow check will pass.