You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're looking to import product prices, you'll need to interact with the classes mentioned in this document to make that work. The rough workflow would look like this:
282
282
@@ -347,11 +347,11 @@ $pricing->addPriceType(
347
347
```
348
348
349
349
350
-
## Removing a PriceType from a Pricing instance
350
+
## Updating or removing price types
351
351
352
-
It's not natively possible to remove a PriceType directly, as it does not have an ID or another unique key to target them by.
352
+
It's not natively possible to update, remove or replace a PriceType directly, as it does not have an ID or another unique key to target them by.
353
353
354
-
If you programmatically want to remove a PriceType, create a new ProductPricing input, add the PriceType's you want to keep, and save that to the product.
354
+
To programmatically update/remove/replace a PriceType, create a new (empty) ProductPricing instance, add the PriceType's you want to keep, and save that to the product.
355
355
356
356
```php
357
357
$currency = $commerce->getCurrency('EUR');
@@ -370,6 +370,16 @@ foreach ($currentPricing->getPriceTypes() as $priceType) {
370
370
$product->savePricing($newPricing);
371
371
```
372
372
373
+
If you want to find a specific price type, you can use instanceof to test the price type inside the `foreach` loop. For example to only keep a Sale price type:
374
+
375
+
```php
376
+
foreach ($currentPricing->getPriceTypes() as $priceType) {
377
+
if ($priceType instanceof \modmore\Commerce\Pricing\PriceType\Sale) {
378
+
$newPricing->addPriceType($priceType);
379
+
}
380
+
}
381
+
```
382
+
373
383
## Loading Price Types in a custom product
374
384
375
385
Prior to 1.0, you would override `getPrice` and return a simple price object. That has been deprecated and will be removed in 1.3.
Copy file name to clipboardExpand all lines: en/50_Open_Source/Gitify/01_Installation/01_Windows.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,12 @@ c:\xampp\php\php.exe
16
16
<ampps root>\php\php.exe
17
17
````
18
18
19
+
## MAMP Pro
20
+
21
+
If you use MAMP Pro make sure to enable "[Make this version available on the command line](https://documentation.mamp.info/en/MAMP-PRO-Windows/Languages/PHP/)":
22
+
23
+
> Check this option to add the current PHP version to the system path. You verify this by checking your System PATH in Advanced System Settings > Environment Variables > System Variables.
24
+
19
25
### Additional Dependencies
20
26
21
27
Here are the Windows dependencies in order to get the script to execute properly. They must be installed and their bin folders have to be added to the Windows PATH environment variable in the Advanced System Settings screen:
@@ -29,4 +35,4 @@ Here are the Windows dependencies in order to get the script to execute properly
29
35
* windows composer support (https://getcomposer.org)
0 commit comments