- Create multiple products with varying configurations:
- Product 1: Tracks inventory only.
- Product 2: Taxable only.
- Product 3: Both taxable and tracks inventory.
- Product 4: Non-tracking and non-taxable.
- Define tax classes based on location:
- Example: Create a tax class "VAT 15%", specifying applicable states, cities, or countries.
- Rules:
- If a state and city are specified, the tax applies only to that city.
- If only a country is specified, the tax applies to the entire country.
- If multiple tax classes match, the most specific one (e.g., state-level) takes precedence.
- Ensure taxes and delivery rates depend on the shipping address provided during checkout.
- Place an order with a non-tracking product that is taxable.
- Test with multiple orders across different locations.
- Verify:
- Tax rates are applied as per the shipping address.
- Total calculations (subtotal, tax, and shipping) are accurate.
- Create an order using a tracking and taxable product.
- Apply a discount code during checkout.
- Verify:
- Discount is applied correctly.
- Tax and total calculations are accurate.
- Inventory is updated properly.
- Place an order and apply a flat discount (e.g., $200 or 10%).
- Do not use a discount code for this test.
- Verify:
- Discount amount is subtracted correctly.
- Tax and shipping calculations remain accurate.
- The final total reflects the discount properly.
- Test different discount code configurations:
- Customer-specific: Restricted to specific customers.
- Product-specific: Applies only to specific products.
- Time-limited: Valid for specific periods.
- New Customers: Applicable only to first-time buyers.
- Redemption Limits: Limited number of uses.
- Inactive Codes: Ensure inactive codes cannot be applied.
- Test both flat-rate and percentage-based discounts.
- Place at least 6 orders with varied scenarios:
- Verify all validations and calculations (excluding tax and shipping) work as expected.
- Confirm the discount logic aligns with your configurations.
- Set up various shipping rates:
- Flat rates (e.g., $10 per order).
- Percentage-based rates (e.g., 5% of the order total).
- Location-specific rates (e.g., different rates for Dhaka vs. Chattogram).
- Test by placing at least 6 orders with different scenarios:
- Example 1: Location Dhaka, taxable product, no discount.
- Example 2: Location Chattogram, non-taxable product.
- Example 3: Location X with a discount and a taxable product.
- Verify:
- Shipping rates are calculated as per location.
- Combined tax, discount, and shipping calculations are accurate.
- Place an order with a stock-tracking product.
- Simulate delivering a part of the order (e.g., deliver 3 items out of 6 in stock).
- Verify:
- The current stock quantity is reduced only after the product status is marked as delivered.
- Example:
- Initial stock: 6.
- Delivered: 3.
- Remaining stock: 3.
- Test with multiple products and ensure:
- Products that do not track inventory remain unaffected.
- All stock changes are reflected accurately.
- Place orders and verify that both shipping address and billing address are populated correctly in the database.
- Ensure:
- The addresses match what was entered during checkout.
- Address fields such as state, city, and postal code are stored properly.
- Use a customer currency different from the base currency:
- Send the currency via the header named
Accept-Currency
. - Ensure:
- Customer currency is stored in the order table under the correct field.
- Base currency remains the default for the platform.
- Currency conversion works accurately.
- Amounts in customer currency are stored correctly and validated.
- Send the currency via the header named
- Verify all costs are stored with accurate amounts and currencies:
- Shipping cost.
- Discount.
- Total tax.
- Total price.
- Ensure:
- Data integrity is maintained.
- Proper currency fields are used for validation and storage.
- Refer to the Nxtbn discount and tax models for detailed logic behind calculations.
- Cover edge cases and unexpected inputs to ensure robust testing.
- Ensure validation logic for tax, discount, shipping, and inventory updates is working seamlessly across all scenarios.