Score:0

How do I get coupons usage in a view

cn flag

There is no field for the number of times the coupon was used in Add fields when creating a new view. while other related fields such as Usage limit are available, according to database check:

  1. The fields that can be displayed in the view are all in the commerce_promotion_coupon table. Therefore, there is no field in which to store the sum of the uses of the coupon.
  2. The number of used coupons is the sum of those in the commerce_order__coupons table with coupons_target_id filter. In commerce/modules/promotion/src/CouponListBuilder.php, it's counted by $this->usageCounts = $this->usage->loadMultipleByCoupon($coupons).

I need a list of coupons and their usage. How can I achieve this?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.