/**
  * Should specify validation rules for price units and subunits.
  */
 public function testRules()
 {
     $this->assertArrayHasKey('units', $this->setPriceRequest->rules());
     $this->assertArrayHasKey('subunits', $this->setPriceRequest->rules());
 }
Example #2
0
 /**
  * @param string          $sku
  * @param SetPriceRequest $setPriceRequest
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function setProductPrice(string $sku, SetPriceRequest $setPriceRequest)
 {
     $this->productRepository->setPriceBySku($sku, $setPriceRequest->get('units'), $setPriceRequest->get('subunits'));
     return $this->webUi->redirect('products.show', [$sku]);
 }