5
votes
How to represent member discount for Commerce products?
Options #1 and #3 are the two options you'll want to decide between, and you've hit the nail on the head in terms of the pros and cons of each.
If a discount code being deleted / modified poses a ...
- 566
3
votes
Accepted
Delete All Products (and their variants)
This should do it:
\Craft::$app->getElements()->deleteElement($product);
Then run garbage collection.
- 6,757
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
plugin-craftcommerce × 819plugin-development × 72
craft3 × 63
ecommerce × 50
plugin-craftcommerce2 × 40
templating × 36
order × 28
plugin-craftcommerce3 × 27
shipping × 25
plugins × 21
products × 19
discounts × 19
payment-methods × 19
adjusters × 17
categories × 13
stripe × 13
emails × 12
custom-field × 12
addresses × 12
payment × 10
php × 9
ajax × 9
events × 9
tax × 9
users × 8