<?php use MagentoFrameworkApiSearchCriteriaBuilder; use MagentoSalesRuleApiRuleRepositoryInterface; use MagentoCatalogApiProductRepositoryInterface; use MagentoFrameworkRegistry; class CustomRule { protected $ruleRepository; protected $searchCriteriaBuilder; protected $productRepository; protected $product; public function __construct( RuleRepositoryInterface $ruleRepository, SearchCriteriaBuilder $searchCriteriaBuilder, ProductRepositoryInterface $productRepository, Registry $registry ) { $this->ruleRepository = $ruleRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->productRepository… Read More »Display the coupon code on the product detail page Magento2.4