AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

AppliedDiscount.php 506B

12345678910111213141516171819
  1. <?php
  2. namespace App\Commerce;
  3. use App\Models\DiscountCode;
  4. /**
  5. * The discount code in a cart and what it is worth right now. Amounts are in sen.
  6. */
  7. final readonly class AppliedDiscount
  8. {
  9. public function __construct(
  10. public DiscountCode $code,
  11. /** What comes off the products. Zero while the code cannot be used. */
  12. public int $amount,
  13. /** Why the code cannot be used yet (a StorefrontText key), or null when it works. */
  14. public ?string $problem,
  15. ) {}
  16. }