1

I want to be able to add,upadate and get conditions programmatically for salesrule, the sales rule condition:

My salesrule condition is => minimum subtotal == 10000 && product skus is one of sku123,sku2333

skus is seperated by comma

i want to be able to add, update and get the minimum subtotal and skus,for example:

public function addSalesRuleCondition($salesRuleId,$minimumAmount,$skus){
  $salesRule = $this->salesRule->create()->load(salesRuleId);
   // add condition for minimum subtotal and skus 
}

public function updateSalesRuleCondition($salesRuleId,$minimumAmount,$skus){
  $salesRule = $this->salesRule->create()->load(salesRuleId);
   // update condition for minimum subtotal and skus 
}

public function getSalesRuleCondtion($salesRuleId){ 
   // retrieve the minimum subtotal and the skus
   $salesRule = $this->salesRule->create()->load(salesRuleId);
   $result = array("minimum_subtotal","skus");
   return $result
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.