Skip to content

Commit

Permalink
Let's not document this for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Sep 18, 2024
1 parent c612554 commit 9f40c51
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions docs/dynamic-pricing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,6 @@ SimpleCommerce::productPriceHook(function (Order $order, Product $product) {

Remember that you'll need to return the price as an integer. The above example returns `£17.50` or `£15.00` as prices.

An alternative method is also available for [variant products](/product-variants).

```php
use DuncanMcClean\SimpleCommerce\Contracts\Order;
use DuncanMcClean\SimpleCommerce\Contracts\Product;
use DuncanMcClean\SimpleCommerce\Products\ProductVariant;

SimpleCommerce::productVariantPriceHook(function (Order $order, Product $product, ProductVariant $variant) {
if (now()->isWeekend()) {
return 1750;
}

return 1500;
});
```

Another alternative method is available to calculate from a lineItem perspective.

```php
Expand Down

0 comments on commit 9f40c51

Please sign in to comment.