Improved comments in code
This commit is contained in:
parent
a6ce67151f
commit
92261d4214
|
|
@ -46,7 +46,7 @@ class ReviewController extends Controller
|
|||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request, $id)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Handler extends ExceptionHandler
|
|||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @param \Exception $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $exception)
|
||||
|
|
@ -45,8 +45,8 @@ class Handler extends ExceptionHandler
|
|||
/**
|
||||
* Convert an authentication exception into a response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $exception
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function unauthenticated($request, AuthenticationException $exception)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ConfigurationController extends Controller
|
|||
/**
|
||||
* CoreConfigRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Core\Repositories\CoreConfigRepository
|
||||
*/
|
||||
protected $coreConfigRepository;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ namespace Webkul\Admin\Http\Controllers\Customer;
|
|||
|
||||
use Webkul\Customer\Rules\VatIdRule;
|
||||
use Webkul\Admin\Http\Controllers\Controller;
|
||||
use Webkul\Customer\Repositories\CustomerRepository as Customer;
|
||||
use Webkul\Customer\Repositories\CustomerAddressRepository as CustomerAddress;
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
use Webkul\Customer\Repositories\CustomerAddressRepository;
|
||||
|
||||
/**
|
||||
* Customer's Address controller
|
||||
|
|
@ -25,32 +25,32 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Customer Repository object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Customer\Repositories\CustomerRepository
|
||||
*/
|
||||
protected $customer;
|
||||
protected $customerRepository;
|
||||
|
||||
/**
|
||||
* CustomerAddress Repository object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Customer\Repositories\CustomerAddressRepository
|
||||
*/
|
||||
protected $customerAddress;
|
||||
protected $customerAddressRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Customer\Repositories\CustomerAddressRepository $customerAddress
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository
|
||||
* @param \Webkul\Customer\Repositories\CustomerAddressRepository $customerAddressRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
Customer $customer,
|
||||
CustomerAddress $customerAddress
|
||||
CustomerRepository $customerRepository,
|
||||
CustomerAddressRepository $customerAddressRepository
|
||||
)
|
||||
{
|
||||
$this->customer = $customer;
|
||||
$this->customerRepository = $customerRepository;
|
||||
|
||||
$this->customerAddress = $customerAddress;
|
||||
$this->customerAddressRepository = $customerAddressRepository;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
|
@ -58,11 +58,12 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Method to populate the seller order page which will be populated.
|
||||
*
|
||||
* @return Mixed
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index($id)
|
||||
{
|
||||
$customer = $this->customer->find($id);
|
||||
$customer = $this->customerRepository->find($id);
|
||||
|
||||
return view($this->_config['view'], compact('customer'));
|
||||
}
|
||||
|
|
@ -70,11 +71,12 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create($id)
|
||||
{
|
||||
$customer = $this->customer->find($id);
|
||||
$customer = $this->customerRepository->find($id);
|
||||
|
||||
return view($this->_config['view'], compact('customer'));
|
||||
}
|
||||
|
|
@ -103,7 +105,7 @@ class AddressController extends Controller
|
|||
'vat_id' => new VatIdRule(),
|
||||
]);
|
||||
|
||||
if ($this->customerAddress->create($data)) {
|
||||
if ($this->customerAddressRepository->create($data)) {
|
||||
session()->flash('success', trans('admin::app.customers.addresses.success-create'));
|
||||
|
||||
return redirect()->route('admin.customer.addresses.index', ['id' => $data['customer_id']]);
|
||||
|
|
@ -117,11 +119,12 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Mixed
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$address = $this->customerAddress->find($id);
|
||||
$address = $this->customerAddressRepository->find($id);
|
||||
|
||||
return view($this->_config['view'], compact('address'));
|
||||
}
|
||||
|
|
@ -129,7 +132,7 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Edit's the premade resource of customer called Address.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
|
|
@ -149,10 +152,10 @@ class AddressController extends Controller
|
|||
|
||||
$data = collect(request()->input())->except('_token')->toArray();
|
||||
|
||||
$address = $this->customerAddress->find($id);
|
||||
$address = $this->customerAddressRepository->find($id);
|
||||
|
||||
if ($address) {
|
||||
$this->customerAddress->update($data, $id);
|
||||
$this->customerAddressRepository->update($data, $id);
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.addresses.success-update'));
|
||||
|
||||
|
|
@ -164,12 +167,12 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->customerAddress->delete($id);
|
||||
$this->customerAddressRepository->delete($id);
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.addresses.success-delete'));
|
||||
|
||||
|
|
@ -179,7 +182,7 @@ class AddressController extends Controller
|
|||
/**
|
||||
* Mass Delete the customer's addresses
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function massDestroy($id)
|
||||
|
|
@ -187,7 +190,7 @@ class AddressController extends Controller
|
|||
$addressIds = explode(',', request()->input('indexes'));
|
||||
|
||||
foreach ($addressIds as $addressId) {
|
||||
$this->customerAddress->delete($addressId);
|
||||
$this->customerAddressRepository->delete($addressId);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('admin::app.customers.addresses.success-mass-delete'));
|
||||
|
|
|
|||
|
|
@ -27,30 +27,30 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* CustomerRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Customer\Repositories\CustomerRepository
|
||||
*/
|
||||
protected $customerRepository;
|
||||
|
||||
/**
|
||||
* CustomerGroupRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Customer\Repositories\CustomerGroupRepository
|
||||
*/
|
||||
protected $customerGroupRepository;
|
||||
|
||||
/**
|
||||
* ChannelRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Core\Repositories\ChannelRepository
|
||||
*/
|
||||
protected $channelRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
|
||||
* @param \Webkul\Core\Repositories\ChannelRepository $channelRepository
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
|
||||
* @param \Webkul\Core\Repositories\ChannelRepository $channelRepository
|
||||
*/
|
||||
public function __construct(
|
||||
CustomerRepository $customerRepository,
|
||||
|
|
@ -136,7 +136,7 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
|
|
@ -153,7 +153,7 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
|
|
@ -180,7 +180,7 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
|
@ -203,7 +203,7 @@ class CustomerController extends Controller
|
|||
/**
|
||||
* To load the note taking screen for the customers
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function createNote($id)
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ class CustomerGroupController extends Controller
|
|||
/**
|
||||
* CustomerGroupRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Customer\Repositories\CustomerGroupRepository
|
||||
*/
|
||||
protected $customerGroupRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository;
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository;
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CustomerGroupRepository $customerGroupRepository)
|
||||
|
|
|
|||
|
|
@ -20,63 +20,63 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* CustomerRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Customer\Repositories\CustomerRepository
|
||||
*/
|
||||
protected $customerRepository;
|
||||
|
||||
/**
|
||||
* ProductInventoryRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductInventoryRepository
|
||||
*/
|
||||
protected $productInventoryRepository;
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Illuminate\Support\Carbon
|
||||
*/
|
||||
protected $startDate;
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Illuminate\Support\Carbon
|
||||
*/
|
||||
protected $lastStartDate;
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Illuminate\Support\Carbon
|
||||
*/
|
||||
protected $endDate;
|
||||
|
||||
/**
|
||||
* string object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Illuminate\Support\Carbon
|
||||
*/
|
||||
protected $lastEndDate;
|
||||
|
||||
|
|
@ -112,7 +112,9 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Returns percentage difference
|
||||
*
|
||||
* @return integer
|
||||
* @param int $previous
|
||||
* @param int $current
|
||||
* @return int
|
||||
*/
|
||||
public function getPercentageChange($previous, $current)
|
||||
{
|
||||
|
|
@ -215,6 +217,7 @@ class DashboardController extends Controller
|
|||
|
||||
/**
|
||||
* Returns top selling products
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getTopSellingProducts()
|
||||
|
|
@ -279,7 +282,7 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Returns previous order query
|
||||
*
|
||||
* @return mixed
|
||||
* @return Illuminate\Database\Query\Builder
|
||||
*/
|
||||
private function previousOrders()
|
||||
{
|
||||
|
|
@ -289,7 +292,7 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Returns current order query
|
||||
*
|
||||
* @return mixed
|
||||
* @return Illuminate\Database\Query\Builder
|
||||
*/
|
||||
private function currentOrders()
|
||||
{
|
||||
|
|
@ -299,7 +302,9 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Returns orders between two dates
|
||||
*
|
||||
* @return mixed
|
||||
* @param \Illuminate\Support\Carbon $start
|
||||
* @param \Illuminate\Support\Carbon $end
|
||||
* @return Illuminate\Database\Query\Builder
|
||||
*/
|
||||
private function getOrdersBetweenDate($start, $end)
|
||||
{
|
||||
|
|
@ -311,7 +316,9 @@ class DashboardController extends Controller
|
|||
/**
|
||||
* Returns customers between two dates
|
||||
*
|
||||
* @return mixed
|
||||
* @param \Illuminate\Support\Carbon $start
|
||||
* @param \Illuminate\Support\Carbon $end
|
||||
* @return Illuminate\Database\Query\Builder
|
||||
*/
|
||||
private function getCustomersBetweenDates($start, $end)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class ExportController extends Controller
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,22 +25,22 @@ class InvoiceController extends Controller
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* InvoiceRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Sales\Repositories\InvoiceRepository
|
||||
*/
|
||||
protected $invoiceRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\InvoiceRepository $invoiceRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\InvoiceRepository $invoiceRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class OrderController extends Controller
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,21 +25,21 @@ class RefundController extends Controller
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* RefundRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\RefundRepository
|
||||
*/
|
||||
protected $refundRepository;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,21 +25,21 @@ class ShipmentController extends Controller
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var mixed
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var mixed
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* ShipmentRepository object
|
||||
*
|
||||
* @var mixed
|
||||
* @var \Webkul\Sales\Repositories\ShipmentRepository
|
||||
*/
|
||||
protected $shipmentRepository;
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ class ShipmentController extends Controller
|
|||
* Checks if requested quantity available or not
|
||||
*
|
||||
* @param array $data
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isInventoryValidate(&$data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class DataGridImport implements ToCollection, WithHeadingRow
|
|||
use Importable;
|
||||
|
||||
/**
|
||||
* @param array $row
|
||||
* @param Illuminate\Support\Collection $row
|
||||
* @return void
|
||||
*/
|
||||
public function collection(Collection $rows)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class CancelOrderNotification extends Mailable
|
|||
|
||||
/**
|
||||
* @var \Webkul\Sales\Contracts\Order
|
||||
*
|
||||
*/
|
||||
public $order;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class NewCustomerNotification extends Mailable
|
|||
* Create a new message instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Contracts\Customer $order
|
||||
* @param string $password
|
||||
* @param string $password
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ class AttributeFamilyRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Attribute\Contracts\AttributeFamily
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class AttributeOptionRepository extends Repository
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $optionId
|
||||
* @param int $optionId
|
||||
* @return void
|
||||
*/
|
||||
public function uploadSwatchImage($data, $optionId)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class AttributeRepository extends Repository
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return \Webkul\Attribute\Contracts\Attribute
|
||||
* @return \Webkul\Attribute\Contracts\Attribute
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -79,10 +79,10 @@ class AttributeRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Attribute\Contracts\Attribute
|
||||
* @return \Webkul\Attribute\Contracts\Attribute
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ class Booking
|
|||
* Returns slots for a perticular day
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param string $date
|
||||
* @param string $date
|
||||
* @return array
|
||||
*/
|
||||
public function getSlotsByDate($bookingProduct, $date)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class DefaultSlot extends Booking
|
|||
* Returns slots for a perticular day
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param string $date
|
||||
* @param string $date
|
||||
* @return array
|
||||
*/
|
||||
public function getSlotsByDate($bookingProduct, $date)
|
||||
|
|
@ -62,7 +62,7 @@ class DefaultSlot extends Booking
|
|||
* Returns slots for One Booking For Many Days
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param string $requestedDate
|
||||
* @param string $requestedDate
|
||||
* @return array
|
||||
*/
|
||||
public function getOneBookingForManyDaysSlots($bookingProductSlot, $requestedDate)
|
||||
|
|
@ -92,7 +92,7 @@ class DefaultSlot extends Booking
|
|||
* Returns slots for Many Bookings for One Day
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProductSlot $bookingProductSlot
|
||||
* @param string $requestedDate
|
||||
* @param string $requestedDate
|
||||
* @return array
|
||||
*/
|
||||
public function getManyBookingsforOneDaySlots($bookingProductSlot, $requestedDate)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class RentalSlot extends Booking
|
|||
* Returns slots for a perticular day
|
||||
*
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @param string $date
|
||||
* @param string $date
|
||||
* @return array
|
||||
*/
|
||||
public function getSlotsByDate($bookingProduct, $date)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class BookingProductEventTicketRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ class BookingProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\BookingProduct\Contracts\BookingProduct
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ class Booking extends Virtual
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ class CmsRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\CMS\Contracts\CmsPage
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ class CmsRepository extends Repository
|
|||
/**
|
||||
* Checks slug is unique or not based on locale
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param string $urlKey
|
||||
* @return bool
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class CartRuleCouponRepository extends Repository
|
|||
* Creates coupons for cart rule
|
||||
*
|
||||
* @param array $data
|
||||
* @param int $cartRuleId
|
||||
* @param int $cartRuleId
|
||||
* @return void
|
||||
*/
|
||||
public function generateCoupons($data, $cartRuleId)
|
||||
|
|
@ -58,7 +58,7 @@ class CartRuleCouponRepository extends Repository
|
|||
* Creates coupons for cart rule
|
||||
*
|
||||
* @param string $format
|
||||
* @param int $length
|
||||
* @param int $length
|
||||
* @return string
|
||||
*/
|
||||
public function getRandomString($format, $length)
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ class CartRuleRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\CartRule\Contracts\CartRule
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class CatalogRuleProduct
|
|||
* Collect discount on cart
|
||||
*
|
||||
* @param \Webkul\CatalogRule\Contracts\CatalogRule $rule
|
||||
* @param int $batchCount
|
||||
* @param int $batchCount
|
||||
* @return void
|
||||
*/
|
||||
public function insertRuleProduct($rule, $batchCount = 1000, $product = null)
|
||||
|
|
@ -115,7 +115,7 @@ class CatalogRuleProduct
|
|||
* Get array of product ids which are matched by rule
|
||||
*
|
||||
* @param \Webkul\CatalogRule\Contracts\CatalogRule $rule
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return array
|
||||
*/
|
||||
public function getMatchingProductIds($rule, $product = null)
|
||||
|
|
@ -179,13 +179,12 @@ class CatalogRuleProduct
|
|||
/**
|
||||
* Add product attribute condition to query
|
||||
*
|
||||
* @param string $attributeCode
|
||||
* @param string $attributeCode
|
||||
* @param \Illuminate\Database\Eloquent\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function addAttributeToSelect($attributeCode, $query)
|
||||
{
|
||||
dd($query);
|
||||
$attribute = $this->attributeRepository->findOneByField('code', $attributeCode);
|
||||
|
||||
if (! $attribute) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class CatalogRuleProductPrice
|
|||
/**
|
||||
* Return current logged in customer
|
||||
*
|
||||
* @return Customer|bool
|
||||
* @return \Webkul\Customer\Contracts\Customer|bool
|
||||
*/
|
||||
public function getCurrentCustomer()
|
||||
{
|
||||
|
|
@ -65,7 +65,7 @@ class CatalogRuleProductPrice
|
|||
/**
|
||||
* Collect discount on cart
|
||||
*
|
||||
* @param int $batchCount
|
||||
* @param int $batchCount
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
|
|
@ -140,7 +140,7 @@ class CatalogRuleProductPrice
|
|||
/**
|
||||
* Calculates product price based on rule
|
||||
*
|
||||
* @param array $rule
|
||||
* @param array $rule
|
||||
* @param \Webkul\Product\Contracts\Product|null $productData
|
||||
* @return float
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@ class CatalogRuleRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\CatalogRule\Contracts\CatalogRule
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class CategoryRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return \Webkul\Category\Contracts\Category
|
||||
*/
|
||||
public function create(array $data)
|
||||
|
|
@ -121,7 +121,7 @@ class CategoryRepository extends Repository
|
|||
/**
|
||||
* Checks slug is unique or not based on locale
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param string $slug
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -165,8 +165,8 @@ class CategoryRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Category\Contracts\Category
|
||||
*/
|
||||
|
|
@ -203,7 +203,7 @@ class CategoryRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @param \Webkul\Category\Contracts\Category $category
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class Cart
|
|||
/**
|
||||
* Add Items in a cart with some cart and item details.
|
||||
*
|
||||
* @param int $productId
|
||||
* @param int $productId
|
||||
* @param array $data
|
||||
* @return \Webkul\Checkout\Contracts\Cart|\Exception|array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class CartItemRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Checkout\Contracts\CartItem
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class CartRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Checkout\Contracts\Cart
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ class Core
|
|||
/**
|
||||
* Converts price
|
||||
*
|
||||
* @param float $amount
|
||||
* @param float $amount
|
||||
* @param string $targetCurrencyCode
|
||||
* @param string $orderCurrencyCode
|
||||
* @return string
|
||||
|
|
@ -418,7 +418,7 @@ class Core
|
|||
/**
|
||||
* Converts to base price
|
||||
*
|
||||
* @param float $amount
|
||||
* @param float $amount
|
||||
* @param string $targetCurrencyCode
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -474,7 +474,7 @@ class Core
|
|||
/**
|
||||
* Format and convert price with currency symbol
|
||||
*
|
||||
* @param float $price
|
||||
* @param float $price
|
||||
* @param string $currencyCode
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -560,8 +560,8 @@ class Core
|
|||
* Checks if current date of the given channel (in the channel timezone) is within the range
|
||||
*
|
||||
* @param int|string|\Webkul\Core\Contracts\Channel $channel
|
||||
* @param string|null $dateFrom
|
||||
* @param string|null $dateTo
|
||||
* @param string|null $dateFrom
|
||||
* @param string|null $dateTo
|
||||
* @return bool
|
||||
*/
|
||||
public function isChannelDateInInterval($dateFrom = null, $dateTo = null)
|
||||
|
|
@ -625,7 +625,7 @@ class Core
|
|||
* Format date using current channel.
|
||||
*
|
||||
* @param \Illuminate\Support\Carbon|null $date
|
||||
* @param string $format
|
||||
* @param string $format
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -645,9 +645,9 @@ class Core
|
|||
/**
|
||||
* Retrieve information from payment configuration
|
||||
*
|
||||
* @param string $field
|
||||
* @param string $field
|
||||
* @param int|string|null $channelId
|
||||
* @param string|null $locale
|
||||
* @param string|null $locale
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -854,7 +854,7 @@ class Core
|
|||
/**
|
||||
*
|
||||
* @param string $date
|
||||
* @param int $day
|
||||
* @param int $day
|
||||
* @return string
|
||||
*/
|
||||
public function xWeekRange($date, $day)
|
||||
|
|
@ -950,8 +950,8 @@ class Core
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $items
|
||||
* @param string $key
|
||||
* @param array $items
|
||||
* @param string $key
|
||||
* @param string|int|float $value
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ abstract class Repository extends BaseRepository {
|
|||
/**
|
||||
* Find data by id
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param array $columns
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -64,7 +64,7 @@ abstract class Repository extends BaseRepository {
|
|||
/**
|
||||
* Find data by id
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param array $columns
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
@ -81,7 +81,7 @@ abstract class Repository extends BaseRepository {
|
|||
/**
|
||||
* Count results of repository
|
||||
*
|
||||
* @param array $where
|
||||
* @param array $where
|
||||
* @param string $columns
|
||||
* @return int
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class Laravel5Helper extends Laravel5
|
|||
/**
|
||||
* Helper function to generate products for testing
|
||||
*
|
||||
* @param int $productType
|
||||
* @param int $productType
|
||||
* @param array $configs
|
||||
* @param array $productStates
|
||||
* @return \Webkul\Product\Models\Product
|
||||
|
|
@ -214,7 +214,7 @@ class Laravel5Helper extends Laravel5
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $productId
|
||||
* @param int $productId
|
||||
* @param array $attributeValues
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ class ChannelRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Core\Contracts\Channel
|
||||
*/
|
||||
|
|
@ -70,9 +70,9 @@ class ChannelRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @param \Webkul\Core\Contratcs\Channel $channel
|
||||
* @param string $type
|
||||
* @param string $type
|
||||
* @return void
|
||||
*/
|
||||
public function uploadImages($data, $channel, $type = "logo")
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class CoreConfigRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $formData
|
||||
* @param array $formData
|
||||
* @param string $method
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ class RedirectIfNotCustomer
|
|||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next, $guard = 'customer')
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class CustomerAddressRepository extends Repository
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @return \Webkul\Customer\Contracts\CustomerAddress
|
||||
*/
|
||||
public function update(array $data, $id)
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class CustomerGroupRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $id
|
||||
* @return \Webkul\Customer\Contracts\CustomerGroup
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class WishlistRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Customer\Contracts\Wishlist
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class VatIdRule implements Rule
|
|||
* @see https://raw.githubusercontent.com/danielebarbaro/laravel-vat-eu-validator/master/src/VatValidator.php
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public function passes($attribute, $value)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class InventorySourceController extends Controller
|
|||
/**
|
||||
* InventorySourceRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Inventory\Repositories\InventorySourceRepository
|
||||
*/
|
||||
protected $inventorySourceRepository;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ class Payment
|
|||
/**
|
||||
* Returns payment redirect url if have any
|
||||
*
|
||||
* @return array
|
||||
* @param \Webkul\Checkout\Contracts\Cart $cart
|
||||
* @return string
|
||||
*/
|
||||
public function getRedirectUrl($cart)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,9 +61,8 @@ abstract class Payment
|
|||
/**
|
||||
* Retrieve information from payment configuration
|
||||
*
|
||||
* @param string $field
|
||||
* @param int|string|null $channelId
|
||||
*
|
||||
* @param string $field
|
||||
* @param int|string|null $channelId
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConfigData($field)
|
||||
|
|
|
|||
|
|
@ -23,29 +23,29 @@ class Ipn
|
|||
/**
|
||||
* Order object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Sales\Contracts\Order
|
||||
*/
|
||||
protected $order;
|
||||
|
||||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* InvoiceRepository object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Sales\Repositories\InvoiceRepository
|
||||
*/
|
||||
protected $invoiceRepository;
|
||||
|
||||
/**
|
||||
* Create a new helper instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param Webkul\Sales\Repositories\InvoiceRepository $invoiceRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\InvoiceRepository $invoiceRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -61,15 +61,16 @@ class Ipn
|
|||
/**
|
||||
* This function process the ipn sent from paypal end
|
||||
*
|
||||
* @param array $post
|
||||
* @return void
|
||||
* @param array $post
|
||||
* @return null|void|\Exception
|
||||
*/
|
||||
public function processIpn($post)
|
||||
{
|
||||
$this->post = $post;
|
||||
|
||||
if (! $this->postBack())
|
||||
if (! $this->postBack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (isset($this->post['txn_type']) && 'recurring_payment' == $this->post['txn_type']) {
|
||||
|
|
@ -87,7 +88,6 @@ class Ipn
|
|||
/**
|
||||
* Load order via ipn invoice id
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getOrder()
|
||||
|
|
@ -100,7 +100,6 @@ class Ipn
|
|||
/**
|
||||
* Process order and create invoice
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function processOrder()
|
||||
|
|
@ -121,13 +120,12 @@ class Ipn
|
|||
/**
|
||||
* Prepares order's invoice data for creation
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function prepareInvoiceData()
|
||||
{
|
||||
$invoiceData = [
|
||||
"order_id" => $this->order->id
|
||||
"order_id" => $this->order->id,
|
||||
];
|
||||
|
||||
foreach ($this->order->items as $item) {
|
||||
|
|
@ -140,7 +138,7 @@ class Ipn
|
|||
/**
|
||||
* Post back to PayPal to check whether this request is a valid one
|
||||
*
|
||||
* @param Zend_Http_Client_Adapter_Interface $httpAdapter
|
||||
* @return bool
|
||||
*/
|
||||
protected function postBack()
|
||||
{
|
||||
|
|
@ -150,22 +148,19 @@ class Ipn
|
|||
$url = 'https://www.paypal.com/cgi-bin/webscr';
|
||||
}
|
||||
|
||||
// Set up request to PayPal
|
||||
$request = curl_init();
|
||||
curl_setopt_array($request, array
|
||||
(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_POST => TRUE,
|
||||
CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $this->post),
|
||||
|
||||
curl_setopt_array($request, [
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_POST => TRUE,
|
||||
CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $this->post),
|
||||
CURLOPT_RETURNTRANSFER => TRUE,
|
||||
CURLOPT_HEADER => FALSE,
|
||||
));
|
||||
CURLOPT_HEADER => FALSE,
|
||||
]);
|
||||
|
||||
// Execute request and get response and status code
|
||||
$response = curl_exec($request);
|
||||
$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
|
||||
$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
|
||||
|
||||
// Close connection
|
||||
curl_close($request);
|
||||
|
||||
if ($status == 200 && $response == 'VERIFIED') {
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ class StandardController extends Controller
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* Ipn object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Paypal\Helpers\Ipn
|
||||
*/
|
||||
protected $ipnHelper;
|
||||
|
||||
|
|
@ -32,6 +32,7 @@ class StandardController extends Controller
|
|||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Attribute\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Paypal\Helpers\Ipn $ipnHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ abstract class Paypal extends Payment
|
|||
/**
|
||||
* PayPal web URL generic getter
|
||||
*
|
||||
* @param array $params
|
||||
* @param array $params
|
||||
* @return string
|
||||
*/
|
||||
public function getPaypalUrl($params = [])
|
||||
|
|
@ -30,8 +30,8 @@ abstract class Paypal extends Payment
|
|||
/**
|
||||
* Add order item fields
|
||||
*
|
||||
* @param array $fields
|
||||
* @param int $i
|
||||
* @param array $fields
|
||||
* @param int $i
|
||||
* @return void
|
||||
*/
|
||||
protected function addLineItemsFields(&$fields, $i = 1)
|
||||
|
|
@ -50,7 +50,7 @@ abstract class Paypal extends Payment
|
|||
/**
|
||||
* Add billing address fields
|
||||
*
|
||||
* @param array $fields
|
||||
* @param array $fields
|
||||
* @return void
|
||||
*/
|
||||
protected function addAddressFields(&$fields)
|
||||
|
|
@ -75,8 +75,7 @@ abstract class Paypal extends Payment
|
|||
/**
|
||||
* Checks if line items enabled or not
|
||||
*
|
||||
* @param array $fields
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsLineItemsEnabled()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class Standard extends Paypal
|
|||
/**
|
||||
* Return paypal redirect url
|
||||
*
|
||||
* @var string
|
||||
* @return string
|
||||
*/
|
||||
public function getRedirectUrl()
|
||||
{
|
||||
|
|
@ -97,8 +97,8 @@ class Standard extends Paypal
|
|||
/**
|
||||
* Add shipping as item
|
||||
*
|
||||
* @param array $fields
|
||||
* @param int $i
|
||||
* @param array $fields
|
||||
* @param int $i
|
||||
* @return void
|
||||
*/
|
||||
protected function addShippingAsLineItems(&$fields, $i)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
|
||||
class Large implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
return $image->resize(480, null, function ($constraint) {
|
||||
|
|
|
|||
|
|
@ -7,10 +7,14 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
|
||||
class Medium implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
$width = 280;
|
||||
$height = 280;
|
||||
$width = $height = 280;
|
||||
|
||||
$image->resize($width, $height, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,10 +7,14 @@ use Intervention\Image\Filters\FilterInterface;
|
|||
|
||||
class Small implements FilterInterface
|
||||
{
|
||||
/**
|
||||
* @param \Intervention\Image\Image $image
|
||||
* @return \Intervention\Image\Image
|
||||
*/
|
||||
public function applyFilter(Image $image)
|
||||
{
|
||||
$width = 120;
|
||||
$height = 120;
|
||||
$width = $height = 120;
|
||||
|
||||
$image->resize($width, $height, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,20 +24,17 @@ class PriceUpdate extends Command
|
|||
/**
|
||||
* ProductFlatRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductFlatRepository
|
||||
*/
|
||||
protected $productFlatRepository;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductFlatRepository $productFlatRepository
|
||||
* @param ]Webkul\Product\Repositories\ProductFlatRepository $productFlatRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
ProductFlatRepository $productFlatRepository
|
||||
)
|
||||
public function __construct(ProductFlatRepository $productFlatRepository)
|
||||
{
|
||||
$this->productFlatRepository = $productFlatRepository;
|
||||
|
||||
|
|
@ -47,7 +44,7 @@ class PriceUpdate extends Command
|
|||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ class Builder extends BaseBuilder
|
|||
$perPage = $perPage ?: $this->model->getPerPage();
|
||||
|
||||
$results = ($total = $this->toBase()->getCountForPagination($columns))
|
||||
? $this->forPage($page, $perPage)->get($columns)
|
||||
: $this->model->newCollection();
|
||||
? $this->forPage($page, $perPage)->get($columns)
|
||||
: $this->model->newCollection();
|
||||
|
||||
return $this->paginator($results, $total, $perPage, $page, [
|
||||
'path' => Paginator::resolveCurrentPath(),
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ abstract class AbstractProduct
|
|||
/**
|
||||
* Add Channle and Locale filter
|
||||
*
|
||||
* @param Attribute $attribute
|
||||
* @param QB $qb
|
||||
* @param sting $alias
|
||||
* @return QB
|
||||
* @param \Webkul\Attribute\Contracts\Attribute $attribute
|
||||
* @param \Illuminate\Database\Eloquent\Builder $qb
|
||||
* @param string $alias
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function applyChannelLocaleFilter($attribute, $qb, $alias = 'product_attribute_values')
|
||||
{
|
||||
|
|
@ -54,8 +54,8 @@ abstract class AbstractProduct
|
|||
/**
|
||||
* Sets product flat variable
|
||||
*
|
||||
* @param Product $product
|
||||
* @return void
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return void|null
|
||||
*/
|
||||
public function setProductFlat($product)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ class BundleOption extends AbstractProduct
|
|||
/**
|
||||
* Product
|
||||
*
|
||||
* @var Product
|
||||
* @var \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat
|
||||
*/
|
||||
protected $product;
|
||||
|
||||
/**
|
||||
* Returns bundle option config
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
public function getBundleConfig($product)
|
||||
|
|
@ -59,7 +59,7 @@ class BundleOption extends AbstractProduct
|
|||
/**
|
||||
* Get formed data from bundle option
|
||||
*
|
||||
* @param ProductBundleOption $option
|
||||
* @param \Product\Product\Contracts\ProductBundleOption $option
|
||||
* @return array
|
||||
*/
|
||||
private function getOptionItemData($option)
|
||||
|
|
@ -77,7 +77,7 @@ class BundleOption extends AbstractProduct
|
|||
/**
|
||||
* Get formed data from bundle option product
|
||||
*
|
||||
* @param ProductBundleOption $option
|
||||
* @param \Product\Product\Contracts\ProductBundleOption $option
|
||||
* @return array
|
||||
*/
|
||||
private function getOptionProducts($option)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Webkul\Product\Helpers;
|
||||
|
||||
use Webkul\Attribute\Repositories\AttributeOptionRepository as AttributeOption;
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Product\Models\ProductAttributeValue;
|
||||
|
||||
|
|
@ -14,13 +13,6 @@ use Webkul\Product\Models\ProductAttributeValue;
|
|||
*/
|
||||
class ConfigurableOption extends AbstractProduct
|
||||
{
|
||||
/**
|
||||
* AttributeOptionRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeOption;
|
||||
|
||||
/**
|
||||
* ProductImage object
|
||||
*
|
||||
|
|
@ -31,25 +23,19 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOption
|
||||
* @param Webkul\Product\Helpers\ProductImage $productImage
|
||||
* @param \Webkul\Product\Helpers\ProductImage $productImage
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
AttributeOption $attributeOption,
|
||||
ProductImage $productImage
|
||||
)
|
||||
public function __construct(ProductImage $productImage)
|
||||
{
|
||||
$this->attributeOption = $attributeOption;
|
||||
|
||||
$this->productImage = $productImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowed variants
|
||||
*
|
||||
* @param Product $product
|
||||
* @return float
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
public function getAllowedProducts($product)
|
||||
{
|
||||
|
|
@ -71,7 +57,7 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Returns the allowed variants JSON
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
public function getConfigurationConfig($product)
|
||||
|
|
@ -96,8 +82,8 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Get allowed attributes
|
||||
*
|
||||
* @param Product $product
|
||||
* @return array
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getAllowAttributes($product)
|
||||
{
|
||||
|
|
@ -107,8 +93,8 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Get Configurable Product Options
|
||||
*
|
||||
* @param Product $currentProduct
|
||||
* @param array $allowedProducts
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $currentProduct
|
||||
* @param array $allowedProducts
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions($currentProduct, $allowedProducts)
|
||||
|
|
@ -145,8 +131,8 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Get product attributes
|
||||
*
|
||||
* @param Product $product
|
||||
* @param array $options
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @param array $options
|
||||
* @return array
|
||||
*/
|
||||
public function getAttributesData($product, array $options = [])
|
||||
|
|
@ -178,8 +164,8 @@ class ConfigurableOption extends AbstractProduct
|
|||
}
|
||||
|
||||
/**
|
||||
* @param Attribute $attribute
|
||||
* @param array $options
|
||||
* @param \Webkul\Attribute\Contracts\Attribute $attribute
|
||||
* @param array $options
|
||||
* @return array
|
||||
*/
|
||||
protected function getAttributeOptionsData($attribute, $options)
|
||||
|
|
@ -206,7 +192,7 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Get product prices for configurable variations
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
protected function getVariantPrices($product)
|
||||
|
|
@ -229,7 +215,7 @@ class ConfigurableOption extends AbstractProduct
|
|||
/**
|
||||
* Get product images for configurable variations
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
protected function getVariantImages($product)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ namespace Webkul\Product\Helpers;
|
|||
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Attribute\Models\AttributeOption;
|
||||
use Webkul\Product\Repositories\ProductRepository as Product;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
|
|
@ -17,22 +17,40 @@ class GenerateProduct
|
|||
{
|
||||
/**
|
||||
* Product Repository instance
|
||||
*
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
protected $product;
|
||||
protected $productRepository;
|
||||
|
||||
/**
|
||||
* AttributeFamily Repository instance
|
||||
*
|
||||
* @var \Webkul\Product\Repositories\AttributeFamilyRepository
|
||||
*/
|
||||
protected $attributeFamily;
|
||||
protected $attributeFamilyRepository;
|
||||
|
||||
/**
|
||||
* Product Attribute Types
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $types;
|
||||
|
||||
public function __construct(Product $product, AttributeFamily $attributeFamily)
|
||||
/**
|
||||
* Create a new helper instance.
|
||||
*
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productImage
|
||||
* @param \Webkul\Product\Repositories\AttributeFamilyRepository $productImage
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
ProductRepository $productRepository,
|
||||
AttributeFamilyRepository $attributeFamilyRepository
|
||||
)
|
||||
{
|
||||
$this->product = $product;
|
||||
$this->productRepository = $productRepository;
|
||||
|
||||
$this->attributeFamilyRepository = $attributeFamilyRepository;
|
||||
|
||||
$this->types = [
|
||||
'text',
|
||||
|
|
@ -47,13 +65,13 @@ class GenerateProduct
|
|||
'file',
|
||||
'checkbox',
|
||||
];
|
||||
|
||||
$this->attributeFamily = $attributeFamily;
|
||||
}
|
||||
|
||||
/**
|
||||
* This brand option needs to be available so that the generated product
|
||||
* can be linked to the order_brands table after checkout.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function generateDemoBrand()
|
||||
{
|
||||
|
|
@ -77,7 +95,7 @@ class GenerateProduct
|
|||
{
|
||||
$attributes = $this->getDefaultFamilyAttributes();
|
||||
|
||||
$attributeFamily = $this->attributeFamily->findWhere([
|
||||
$attributeFamily = $this->attributeFamilyRepository->findWhere([
|
||||
'code' => 'default',
|
||||
]);
|
||||
|
||||
|
|
@ -86,7 +104,7 @@ class GenerateProduct
|
|||
$data['attribute_family_id'] = $attributeFamily->first()->id;
|
||||
$data['type'] = 'simple';
|
||||
|
||||
$product = $this->product->create($data);
|
||||
$product = $this->productRepository->create($data);
|
||||
|
||||
unset($data);
|
||||
|
||||
|
|
@ -197,14 +215,17 @@ class GenerateProduct
|
|||
0 => $channel->root_category->id,
|
||||
];
|
||||
|
||||
$updated = $this->product->update($data, $product->id);
|
||||
$updated = $this->productRepository->update($data, $product->id);
|
||||
|
||||
return $updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getDefaultFamilyAttributes()
|
||||
{
|
||||
$attributeFamily = $this->attributeFamily->findWhere([
|
||||
$attributeFamily = $this->attributeFamilyRepository->findWhere([
|
||||
'code' => 'default',
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Webkul\Product\Helpers;
|
||||
|
||||
use Webkul\Attribute\Repositories\AttributeOptionRepository as AttributeOption;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
/**
|
||||
|
|
@ -16,7 +15,7 @@ class ProductImage extends AbstractProduct
|
|||
/**
|
||||
* Retrieve collection of gallery images
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
public function getGalleryImages($product)
|
||||
|
|
@ -54,7 +53,7 @@ class ProductImage extends AbstractProduct
|
|||
/**
|
||||
* Get product's base image
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
*/
|
||||
public function getProductBaseImage($product)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class ProductType extends AbstractProduct
|
|||
* Checks if a ProductType may have variants
|
||||
*
|
||||
* @param string $typeKey as defined in config('product_types)
|
||||
*
|
||||
* @return bool whether ProductType is able to have variants
|
||||
*/
|
||||
public static function hasVariants(string $typeKey): bool
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Review extends AbstractProduct
|
|||
/**
|
||||
* Returns the product's avg rating
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return float
|
||||
*/
|
||||
public function getReviews($product)
|
||||
|
|
@ -31,7 +31,7 @@ class Review extends AbstractProduct
|
|||
/**
|
||||
* Returns the product's avg rating
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return float
|
||||
*/
|
||||
public function getAverageRating($product)
|
||||
|
|
@ -48,8 +48,8 @@ class Review extends AbstractProduct
|
|||
/**
|
||||
* Returns the total review of the product
|
||||
*
|
||||
* @param Product $product
|
||||
* @return integer
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalReviews($product)
|
||||
{
|
||||
|
|
@ -65,8 +65,8 @@ class Review extends AbstractProduct
|
|||
/**
|
||||
* Returns the total rating of the product
|
||||
*
|
||||
* @param Product $product
|
||||
* @return integer
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalRating($product)
|
||||
{
|
||||
|
|
@ -82,8 +82,8 @@ class Review extends AbstractProduct
|
|||
/**
|
||||
* Returns the Percentage rating of the product
|
||||
*
|
||||
* @param Product $product
|
||||
* @return integer
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return int
|
||||
*/
|
||||
public function getPercentageRating($product)
|
||||
{
|
||||
|
|
@ -103,11 +103,11 @@ class Review extends AbstractProduct
|
|||
|
||||
break;
|
||||
} else {
|
||||
$percentage[$i]=0;
|
||||
$percentage[$i] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$percentage[$i]=0;
|
||||
$percentage[$i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns available sort orders
|
||||
*
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableOrders()
|
||||
{
|
||||
|
|
@ -30,8 +29,7 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns available limits
|
||||
*
|
||||
* @param string $key
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public function getAvailableLimits()
|
||||
{
|
||||
|
|
@ -41,7 +39,7 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns the sort order url
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $key
|
||||
* @return string
|
||||
*/
|
||||
public function getOrderUrl($key)
|
||||
|
|
@ -57,7 +55,7 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns the limit url
|
||||
*
|
||||
* @param integer $limit
|
||||
* @param int $limit
|
||||
* @return string
|
||||
*/
|
||||
public function getLimitUrl($limit)
|
||||
|
|
@ -70,7 +68,7 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns the mode url
|
||||
*
|
||||
* @param string $mode
|
||||
* @param string $mode
|
||||
* @return string
|
||||
*/
|
||||
public function getModeUrl($mode)
|
||||
|
|
@ -83,8 +81,8 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Checks if sort order is active
|
||||
*
|
||||
* @param string $key
|
||||
* @return boolean
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function isOrderCurrent($key)
|
||||
{
|
||||
|
|
@ -102,8 +100,8 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Checks if limit is active
|
||||
*
|
||||
* @param integer $limit
|
||||
* @return boolean
|
||||
* @param int $limit
|
||||
* @return bool
|
||||
*/
|
||||
public function isLimitCurrent($limit)
|
||||
{
|
||||
|
|
@ -119,8 +117,8 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Checks if mode is active
|
||||
*
|
||||
* @param string $key
|
||||
* @return boolean
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function isModeActive($key)
|
||||
{
|
||||
|
|
@ -136,7 +134,6 @@ class Toolbar extends AbstractProduct
|
|||
/**
|
||||
* Returns the current mode
|
||||
*
|
||||
* @param string $mode
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentMode()
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ class View extends AbstractProduct
|
|||
/**
|
||||
* Returns the visible custom attributes
|
||||
*
|
||||
* @param Webkul\Product\Models\Product $product
|
||||
* @return integer
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return void|array
|
||||
*/
|
||||
public function getAdditionalData($product)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,54 +31,54 @@ class ProductController extends Controller
|
|||
/**
|
||||
* CategoryRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Category\Repositories\CategoryRepository
|
||||
*/
|
||||
protected $categoryRepository;
|
||||
|
||||
/**
|
||||
* ProductRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
protected $productRepository;
|
||||
|
||||
/**
|
||||
* ProductDownloadableLinkRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository
|
||||
*/
|
||||
protected $productDownloadableLinkRepository;
|
||||
|
||||
/**
|
||||
* ProductDownloadableSampleRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductDownloadableSampleRepository
|
||||
*/
|
||||
protected $productDownloadableSampleRepository;
|
||||
|
||||
/**
|
||||
* AttributeFamilyRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Attribute\Repositories\AttributeFamilyRepository
|
||||
*/
|
||||
protected $attributeFamilyRepository;
|
||||
|
||||
/**
|
||||
* InventorySourceRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Inventory\Repositories\InventorySourceRepository
|
||||
*/
|
||||
protected $inventorySourceRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository
|
||||
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository
|
||||
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySourceRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -189,7 +189,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Webkul\Product\Http\Requests\ProductForm $request
|
||||
* @param \Webkul\Product\Http\Requests\ProductForm $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -256,7 +256,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Mass Delete the products
|
||||
*
|
||||
* @return response
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function massDestroy()
|
||||
{
|
||||
|
|
@ -278,7 +278,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Mass updates the products
|
||||
*
|
||||
* @return response
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function massUpdate()
|
||||
{
|
||||
|
|
@ -307,8 +307,10 @@ class ProductController extends Controller
|
|||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* To be manually invoked when data is seeded into products
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function sync()
|
||||
{
|
||||
|
|
@ -320,7 +322,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Result of search product.
|
||||
*
|
||||
* @return \Illuminate\View\View | \Illuminate\Http\JsonResponse
|
||||
* @return \Illuminate\View\View|\Illuminate\Http\Response
|
||||
*/
|
||||
public function productLinkSearch()
|
||||
{
|
||||
|
|
@ -344,7 +346,8 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Download image or file
|
||||
*
|
||||
* @param int $productId, $attributeId
|
||||
* @param int $productId
|
||||
* @param int $attributeId
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function download($productId, $attributeId)
|
||||
|
|
@ -360,7 +363,7 @@ class ProductController extends Controller
|
|||
/**
|
||||
* Search simple products
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function searchSimpleProducts()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ReviewController extends Controller
|
|||
/**
|
||||
* ProductReviewRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductReviewRepository
|
||||
*/
|
||||
protected $productReviewRepository;
|
||||
|
||||
|
|
@ -33,9 +33,7 @@ class ReviewController extends Controller
|
|||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
ProductReviewRepository $productReviewRepository
|
||||
)
|
||||
public function __construct(ProductReviewRepository $productReviewRepository)
|
||||
{
|
||||
$this->productReviewRepository = $productReviewRepository;
|
||||
|
||||
|
|
@ -115,7 +113,7 @@ class ReviewController extends Controller
|
|||
/**
|
||||
* Mass delete the reviews on the products.
|
||||
*
|
||||
* @return response
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function massDestroy()
|
||||
{
|
||||
|
|
@ -158,7 +156,7 @@ class ReviewController extends Controller
|
|||
/**
|
||||
* Mass approve the reviews on the products.
|
||||
*
|
||||
* @return response
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function massUpdate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,53 +4,48 @@ namespace Webkul\Product\Http\Requests;
|
|||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
|
||||
use Webkul\Product\Repositories\ProductRepository as Product;
|
||||
use Webkul\Product\Repositories\ProductAttributeValueRepository as AttributeValue;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
use Webkul\Product\Repositories\ProductAttributeValueRepository;
|
||||
use Webkul\Product\Models\ProductAttributeValue;
|
||||
|
||||
class ProductForm extends FormRequest
|
||||
{
|
||||
/**
|
||||
* AttributeFamilyRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeFamily;
|
||||
|
||||
/**
|
||||
* ProductRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
protected $product;
|
||||
protected $productRepository;
|
||||
|
||||
/**
|
||||
* ProductAttributeValueRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Product\Repositories\ProductAttributeValueRepository
|
||||
*/
|
||||
protected $attributeValue;
|
||||
protected $productAttributeValueRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* @var array
|
||||
*/
|
||||
protected $rules;
|
||||
|
||||
/**
|
||||
* Create a new form request instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamily
|
||||
* @param Webkul\Product\Repositories\ProductRepository $product
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValue
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AttributeFamily $attributeFamily, Product $product, AttributeValue $attributeValue)
|
||||
public function __construct(
|
||||
ProductRepository $productRepository,
|
||||
ProductAttributeValueRepository $productAttributeValueRepository
|
||||
)
|
||||
{
|
||||
$this->attributeFamily = $attributeFamily;
|
||||
$this->productRepository = $productRepository;
|
||||
|
||||
$this->product = $product;
|
||||
|
||||
$this->attributeValue = $attributeValue;
|
||||
$this->productAttributeValueRepository = $productAttributeValueRepository;
|
||||
}
|
||||
|
||||
protected $rules;
|
||||
|
||||
/**
|
||||
* Determine if the product is authorized to make this request.
|
||||
*
|
||||
|
|
@ -68,7 +63,7 @@ class ProductForm extends FormRequest
|
|||
*/
|
||||
public function rules()
|
||||
{
|
||||
$product = $this->product->find($this->id);
|
||||
$product = $this->productRepository->find($this->id);
|
||||
|
||||
$this->rules = array_merge($product->getTypeInstance()->getTypeValidationRules(), [
|
||||
'sku' => ['required', 'unique:products,sku,' . $this->id, new \Webkul\Core\Contracts\Validations\Slug],
|
||||
|
|
@ -107,7 +102,7 @@ class ProductForm extends FormRequest
|
|||
array_push($validations, function ($field, $value, $fail) use ($attribute) {
|
||||
$column = ProductAttributeValue::$attributeTypeFields[$attribute->type];
|
||||
|
||||
if (! $this->attributeValue->isValueUnique($this->id, $attribute->id, $column, request($attribute->code))) {
|
||||
if (! $this->productAttributeValueRepository->isValueUnique($this->id, $attribute->id, $column, request($attribute->code))) {
|
||||
$fail('The :attribute has already been taken.');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ use Illuminate\Support\Facades\Schema;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Attribute\Repositories\AttributeOptionRepository;
|
||||
use Webkul\Product\Helpers\ProductType;
|
||||
use Webkul\Product\Repositories\ProductFlatRepository;
|
||||
use Webkul\Product\Repositories\ProductAttributeValueRepository;
|
||||
use Webkul\Product\Helpers\ProductType;
|
||||
use Webkul\Product\Models\ProductAttributeValue;
|
||||
|
||||
/**
|
||||
|
|
@ -23,40 +23,40 @@ class ProductFlat
|
|||
/**
|
||||
* AttributeRepository Repository Object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Attribute\Repositories\AttributeRepository
|
||||
*/
|
||||
protected $attributeRepository;
|
||||
|
||||
/**
|
||||
* AttributeOptionRepository Repository Object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Attribute\Repositories\AttributeOptionRepository
|
||||
*/
|
||||
protected $attributeOptionRepository;
|
||||
|
||||
/**
|
||||
* ProductFlatRepository Repository Object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Product\Repositories\ProductFlatRepository
|
||||
*/
|
||||
protected $productFlatRepository;
|
||||
|
||||
/**
|
||||
* ProductAttributeValueRepository Repository Object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Product\Repositories\ProductAttributeValueRepository
|
||||
*/
|
||||
protected $productAttributeValueRepository;
|
||||
|
||||
/**
|
||||
* Attribute Object
|
||||
*
|
||||
* @var object
|
||||
* @var \Webkul\Attribute\Contracts\Attribute
|
||||
*/
|
||||
protected $attribute;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
* @var array
|
||||
*/
|
||||
public $attributeTypeFields = [
|
||||
'text' => 'text',
|
||||
|
|
@ -75,10 +75,10 @@ class ProductFlat
|
|||
/**
|
||||
* Create a new listener instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository
|
||||
* @param Webkul\Product\Repositories\ProductFlatRepository $productFlatRepository
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository
|
||||
* @param \Webkul\Product\Repositories\ProductFlatRepository $productFlatRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -100,6 +100,7 @@ class ProductFlat
|
|||
/**
|
||||
* After the attribute is created
|
||||
*
|
||||
* @param \Webkul\Attribute\Contracts\Attribute $attribute
|
||||
* @return void
|
||||
*/
|
||||
public function afterAttributeCreatedUpdated($attribute)
|
||||
|
|
@ -124,6 +125,12 @@ class ProductFlat
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* After the attribute is deleted
|
||||
*
|
||||
* @param int $attributeId
|
||||
* @return void
|
||||
*/
|
||||
public function afterAttributeDeleted($attributeId)
|
||||
{
|
||||
$attribute = $this->attributeRepository->find($attributeId);
|
||||
|
|
@ -142,7 +149,7 @@ class ProductFlat
|
|||
/**
|
||||
* Creates product flat
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function afterProductCreatedUpdated($product)
|
||||
|
|
@ -159,8 +166,8 @@ class ProductFlat
|
|||
/**
|
||||
* Creates product flat
|
||||
*
|
||||
* @param Product $product
|
||||
* @param Product $parentProduct
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @param \Webkul\Product\Contracts\Product $parentProduct
|
||||
* @return void
|
||||
*/
|
||||
public function createFlat($product, $parentProduct = null)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ProductObserver
|
|||
/**
|
||||
* Handle the Product "deleted" event.
|
||||
*
|
||||
* @param Product $product
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function deleted($product)
|
||||
|
|
|
|||
|
|
@ -18,14 +18,15 @@ class ProductAttributeValueRepository extends Repository
|
|||
/**
|
||||
* AttributeRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Attribute\Repositories\AttributeRepository
|
||||
*/
|
||||
protected $attributeRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Create a new reposotory instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -41,7 +42,7 @@ class ProductAttributeValueRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -49,8 +50,8 @@ class ProductAttributeValueRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Product\Contracts\ProductAttributeValue
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -70,10 +71,10 @@ class ProductAttributeValueRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $column
|
||||
* @param int $attributeId
|
||||
* @param int $productId
|
||||
* @param string $value
|
||||
* @param string $column
|
||||
* @param int $attributeId
|
||||
* @param int $productId
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public function isValueUnique($productId, $attributeId, $column, $value)
|
||||
|
|
|
|||
|
|
@ -13,14 +13,19 @@ use Illuminate\Support\Str;
|
|||
*/
|
||||
class ProductBundleOptionProductRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function model()
|
||||
{
|
||||
return 'Webkul\Product\Contracts\ProductBundleOptionProduct';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param ProductBundleOption $productBundleOption
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\ProductBundleOption $productBundleOption
|
||||
* @return void
|
||||
*/
|
||||
public function saveBundleOptonProducts($data, $productBundleOption)
|
||||
|
|
@ -52,7 +57,7 @@ class ProductBundleOptionProductRepository extends Repository
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return void
|
||||
* @return void|null
|
||||
*/
|
||||
public function setIsDefaultFlag(&$data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,14 +17,15 @@ class ProductBundleOptionRepository extends Repository
|
|||
/**
|
||||
* ProductBundleOptionProductRepository object
|
||||
*
|
||||
* @var ProductBundleOptionProductRepository
|
||||
* @var \Webkul\Product\Repositories\ProductBundleOptionProductRepository
|
||||
*/
|
||||
protected $productBundleOptionProductRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository
|
||||
* @param Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -37,14 +38,19 @@ class ProductBundleOptionRepository extends Repository
|
|||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function model()
|
||||
{
|
||||
return 'Webkul\Product\Contracts\ProductBundleOption';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param Product $product
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function saveBundleOptons($data, $product)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class ProductDownloadableLinkRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -25,9 +25,9 @@ class ProductDownloadableLinkRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @param integer $productId
|
||||
* @return mixed
|
||||
* @return array
|
||||
*/
|
||||
public function upload($data, $productId)
|
||||
{
|
||||
|
|
@ -45,8 +45,8 @@ class ProductDownloadableLinkRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed $product
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function saveLinks(array $data, $product)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class ProductDownloadableSampleRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -25,8 +25,8 @@ class ProductDownloadableSampleRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param integer $productId
|
||||
* @param array $data
|
||||
* @param int $productId
|
||||
* @return mixed
|
||||
*/
|
||||
public function upload($data, $productId)
|
||||
|
|
@ -43,8 +43,8 @@ class ProductDownloadableSampleRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed $product
|
||||
* @param array $data
|
||||
* @param Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function saveSamples(array $data, $product)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ProductFlatRepository extends Repository
|
|||
/**
|
||||
* Maximum Price of Category Product
|
||||
*
|
||||
* @param Category $category
|
||||
* @param \Webkul\Category\Contracts\Category $category
|
||||
* @return float
|
||||
*/
|
||||
public function getCategoryProductMaximumPrice($category = null)
|
||||
|
|
@ -38,7 +38,7 @@ class ProductFlatRepository extends Repository
|
|||
/**
|
||||
* get Category Product Attribute
|
||||
*
|
||||
* @param CategoryId $categoryId
|
||||
* @param int $categoryId
|
||||
* @return array
|
||||
*/
|
||||
public function getCategoryProductAttribute($categoryId)
|
||||
|
|
@ -65,9 +65,9 @@ class ProductFlatRepository extends Repository
|
|||
/**
|
||||
* get Filterable Attributes.
|
||||
*
|
||||
* @param array $category
|
||||
* @param array $products
|
||||
* @return collection
|
||||
* @param array $category
|
||||
* @param array $products
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getFilterableAttributes($category, $products) {
|
||||
$filterAttributes = [];
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ class ProductGroupedProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param Product $product
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function saveGroupedProducts($data, $product)
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ class ProductImageRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed $product
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function uploadImages($data, $product)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ class ProductInventoryRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed $product
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @param Webkul\Product\Contracts\Product $product
|
||||
* @return void
|
||||
*/
|
||||
public function saveInventories(array $data, $product)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,14 +22,15 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* AttributeRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Attribute\Repositories\AttributeRepository
|
||||
*/
|
||||
protected $attributeRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -45,7 +46,7 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -53,8 +54,8 @@ class ProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -70,10 +71,10 @@ class ProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -93,8 +94,8 @@ class ProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @param int $id
|
||||
* @return void
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
|
|
@ -106,105 +107,105 @@ class ProductRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param integer $categoryId
|
||||
* @return Collection
|
||||
* @param int $categoryId
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getAll($categoryId = null)
|
||||
{
|
||||
$params = request()->input();
|
||||
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function($query) use($params, $categoryId) {
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
|
||||
$qb = $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
|
||||
->leftJoin('product_categories', 'products.id', '=', 'product_categories.product_id')
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key');
|
||||
$qb = $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->leftJoin('products', 'product_flat.product_id', '=', 'products.id')
|
||||
->leftJoin('product_categories', 'products.id', '=', 'product_categories.product_id')
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key');
|
||||
|
||||
if ($categoryId) {
|
||||
$qb->where('product_categories.category_id', $categoryId);
|
||||
}
|
||||
if ($categoryId) {
|
||||
$qb->where('product_categories.category_id', $categoryId);
|
||||
}
|
||||
|
||||
if (is_null(request()->input('status'))) {
|
||||
$qb->where('product_flat.status', 1);
|
||||
}
|
||||
if (is_null(request()->input('status'))) {
|
||||
$qb->where('product_flat.status', 1);
|
||||
}
|
||||
|
||||
if (is_null(request()->input('visible_individually'))) {
|
||||
$qb->where('product_flat.visible_individually', 1);
|
||||
}
|
||||
if (is_null(request()->input('visible_individually'))) {
|
||||
$qb->where('product_flat.visible_individually', 1);
|
||||
}
|
||||
|
||||
$queryBuilder = $qb->leftJoin('product_flat as flat_variants', function($qb) use($channel, $locale) {
|
||||
$qb->on('product_flat.id', '=', 'flat_variants.parent_id')
|
||||
->where('flat_variants.channel', $channel)
|
||||
->where('flat_variants.locale', $locale);
|
||||
});
|
||||
$queryBuilder = $qb->leftJoin('product_flat as flat_variants', function($qb) use($channel, $locale) {
|
||||
$qb->on('product_flat.id', '=', 'flat_variants.parent_id')
|
||||
->where('flat_variants.channel', $channel)
|
||||
->where('flat_variants.locale', $locale);
|
||||
});
|
||||
|
||||
if (isset($params['search']))
|
||||
$qb->where('product_flat.name', 'like', '%' . urldecode($params['search']) . '%');
|
||||
if (isset($params['search']))
|
||||
$qb->where('product_flat.name', 'like', '%' . urldecode($params['search']) . '%');
|
||||
|
||||
if (isset($params['sort'])) {
|
||||
$attribute = $this->attributeRepository->findOneByField('code', $params['sort']);
|
||||
if (isset($params['sort'])) {
|
||||
$attribute = $this->attributeRepository->findOneByField('code', $params['sort']);
|
||||
|
||||
if ($params['sort'] == 'price') {
|
||||
if ($attribute->code == 'price') {
|
||||
$qb->orderBy('min_price', $params['order']);
|
||||
} else {
|
||||
$qb->orderBy($attribute->code, $params['order']);
|
||||
}
|
||||
if ($params['sort'] == 'price') {
|
||||
if ($attribute->code == 'price') {
|
||||
$qb->orderBy('min_price', $params['order']);
|
||||
} else {
|
||||
$qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $params['order']);
|
||||
$qb->orderBy($attribute->code, $params['order']);
|
||||
}
|
||||
} else {
|
||||
$qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $params['order']);
|
||||
}
|
||||
}
|
||||
|
||||
$qb = $qb->leftJoin('products as variants', 'products.id', '=', 'variants.parent_id');
|
||||
$qb = $qb->leftJoin('products as variants', 'products.id', '=', 'variants.parent_id');
|
||||
|
||||
$qb = $qb->where(function($query1) use($qb) {
|
||||
$aliases = [
|
||||
'products' => 'filter_',
|
||||
'variants' => 'variant_filter_',
|
||||
];
|
||||
$qb = $qb->where(function($query1) use($qb) {
|
||||
$aliases = [
|
||||
'products' => 'filter_',
|
||||
'variants' => 'variant_filter_',
|
||||
];
|
||||
|
||||
foreach($aliases as $table => $alias) {
|
||||
$query1 = $query1->orWhere(function($query2) use ($qb, $table, $alias) {
|
||||
foreach($aliases as $table => $alias) {
|
||||
$query1 = $query1->orWhere(function($query2) use ($qb, $table, $alias) {
|
||||
|
||||
foreach ($this->attributeRepository->getProductDefaultAttributes(array_keys(request()->input())) as $code => $attribute) {
|
||||
$aliasTemp = $alias . $attribute->code;
|
||||
foreach ($this->attributeRepository->getProductDefaultAttributes(array_keys(request()->input())) as $code => $attribute) {
|
||||
$aliasTemp = $alias . $attribute->code;
|
||||
|
||||
$qb = $qb->leftJoin('product_attribute_values as ' . $aliasTemp, $table . '.id', '=', $aliasTemp . '.product_id');
|
||||
$qb = $qb->leftJoin('product_attribute_values as ' . $aliasTemp, $table . '.id', '=', $aliasTemp . '.product_id');
|
||||
|
||||
$column = ProductAttributeValue::$attributeTypeFields[$attribute->type];
|
||||
$column = ProductAttributeValue::$attributeTypeFields[$attribute->type];
|
||||
|
||||
$temp = explode(',', request()->get($attribute->code));
|
||||
$temp = explode(',', request()->get($attribute->code));
|
||||
|
||||
if ($attribute->type != 'price') {
|
||||
$query2 = $query2->where($aliasTemp . '.attribute_id', $attribute->id);
|
||||
if ($attribute->type != 'price') {
|
||||
$query2 = $query2->where($aliasTemp . '.attribute_id', $attribute->id);
|
||||
|
||||
$query2 = $query2->where(function($query3) use($aliasTemp, $column, $temp) {
|
||||
foreach($temp as $code => $filterValue) {
|
||||
if (! is_numeric($filterValue)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$columns = $aliasTemp . '.' . $column;
|
||||
$query3 = $query3->orwhereRaw("find_in_set($filterValue, $columns)");
|
||||
$query2 = $query2->where(function($query3) use($aliasTemp, $column, $temp) {
|
||||
foreach($temp as $code => $filterValue) {
|
||||
if (! is_numeric($filterValue)) {
|
||||
continue;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$query2->where('product_flat.min_price', '>=', core()->convertToBasePrice(current($temp)))
|
||||
->where('product_flat.min_price', '<=', core()->convertToBasePrice(end($temp)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return $qb->groupBy('product_flat.id');
|
||||
})->paginate(isset($params['limit']) ? $params['limit'] : 9);
|
||||
$columns = $aliasTemp . '.' . $column;
|
||||
$query3 = $query3->orwhereRaw("find_in_set($filterValue, $columns)");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$query2->where('product_flat.min_price', '>=', core()->convertToBasePrice(current($temp)))
|
||||
->where('product_flat.min_price', '<=', core()->convertToBasePrice(end($temp)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return $qb->groupBy('product_flat.id');
|
||||
})->paginate(isset($params['limit']) ? $params['limit'] : 9);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
@ -212,8 +213,9 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Retrive product from slug
|
||||
*
|
||||
* @param string $slug
|
||||
* @return mixed
|
||||
* @param string $slug
|
||||
* @param string $columns
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function findBySlugOrFail($slug, $columns = null)
|
||||
{
|
||||
|
|
@ -235,9 +237,8 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Retrieve product from slug without throwing an exception (might return null)
|
||||
*
|
||||
* @param $slug
|
||||
*
|
||||
* @return mixed
|
||||
* @param string $slug
|
||||
* @return \Webkul\Product\Contracts\ProductFlat
|
||||
*/
|
||||
public function findBySlug($slug)
|
||||
{
|
||||
|
|
@ -251,24 +252,24 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Returns newly added product
|
||||
*
|
||||
* @return Collection
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getNewProducts()
|
||||
{
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function($query) {
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.new', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(4);
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.new', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(4);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
@ -276,24 +277,24 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Returns featured product
|
||||
*
|
||||
* @return Collection
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getFeaturedProducts()
|
||||
{
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function($query) {
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.featured', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(4);
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.featured', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(4);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
@ -301,25 +302,26 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Search Product by Attribute
|
||||
*
|
||||
* @return Collection
|
||||
* @param string $term
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function searchProductByAttribute($term)
|
||||
{
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function($query) use($term) {
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
|
||||
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key')
|
||||
->where('product_flat.name', 'like', '%' . urldecode($term) . '%')
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(16);
|
||||
return $query->distinct()
|
||||
->addSelect('product_flat.*')
|
||||
->where('product_flat.status', 1)
|
||||
->where('product_flat.visible_individually', 1)
|
||||
->where('product_flat.channel', $channel)
|
||||
->where('product_flat.locale', $locale)
|
||||
->whereNotNull('product_flat.url_key')
|
||||
->where('product_flat.name', 'like', '%' . urldecode($term) . '%')
|
||||
->orderBy('product_id', 'desc');
|
||||
})->paginate(16);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
@ -327,8 +329,8 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Returns product's super attribute with options
|
||||
*
|
||||
* @param Product $product
|
||||
* @return Collection
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getSuperAttributes($product)
|
||||
{
|
||||
|
|
@ -353,7 +355,7 @@ class ProductRepository extends Repository
|
|||
/**
|
||||
* Search simple products for grouped product association
|
||||
*
|
||||
* @param string $term
|
||||
* @param string $term
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function searchSimpleProducts($term)
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ abstract class AbstractType
|
|||
/**
|
||||
* AttributeRepository instance
|
||||
*
|
||||
* @var AttributeRepository
|
||||
* @var \Webkul\Attribute\Repositories\AttributeRepository
|
||||
*/
|
||||
protected $attributeRepository;
|
||||
|
||||
/**
|
||||
* ProductRepository instance
|
||||
*
|
||||
* @var ProductRepository
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
protected $productRepository;
|
||||
|
||||
/**
|
||||
* ProductAttributeValueRepository instance
|
||||
*
|
||||
* @var ProductAttributeValueRepository
|
||||
* @var \Webkul\Product\Repositories\ProductAttributeValueRepository
|
||||
*/
|
||||
protected $attributeValueRepository;
|
||||
|
||||
|
|
@ -52,82 +52,82 @@ abstract class AbstractType
|
|||
/**
|
||||
* ProductImageRepository instance
|
||||
*
|
||||
* @var ProductImageRepository
|
||||
* @var \Webkul\Product\Repositories\ProductInventoryRepository
|
||||
*/
|
||||
protected $productImageRepository;
|
||||
|
||||
/**
|
||||
* Product Image helper instance
|
||||
*
|
||||
* @var ProductImage
|
||||
* @var \Webkul\Product\Helpers\ProductImage
|
||||
*/
|
||||
protected $productImageHelper;
|
||||
|
||||
/**
|
||||
* Product model instance
|
||||
*
|
||||
* @var Product
|
||||
* @var \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
protected $product;
|
||||
|
||||
/**
|
||||
* Is a composite product type
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isComposite = false;
|
||||
|
||||
/**
|
||||
* Is a stokable product type
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isStockable = true;
|
||||
|
||||
/**
|
||||
* Show quantity box
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $showQuantityBox = false;
|
||||
|
||||
/**
|
||||
* Is product have sufficient quantity
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $haveSufficientQuantity = true;
|
||||
|
||||
/**
|
||||
* Product can be moved from wishlist to cart or not
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $canBeMovedFromWishlistToCart = true;
|
||||
|
||||
/**
|
||||
* Has child products aka variants
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $hasVariants = false;
|
||||
|
||||
/**
|
||||
* Product children price can be calculated or not
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isChildrenCalculated = false;
|
||||
|
||||
/**
|
||||
* Create a new product type instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -153,8 +153,8 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -162,10 +162,10 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -253,8 +253,8 @@ abstract class AbstractType
|
|||
/**
|
||||
* Specify type instance product
|
||||
*
|
||||
* @param Product $product
|
||||
* @return AbstractType
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return \Webkul\Product\Type\AbstractType
|
||||
*/
|
||||
public function setProduct($product)
|
||||
{
|
||||
|
|
@ -286,7 +286,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Return true if this product type is saleable
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isSaleable()
|
||||
{
|
||||
|
|
@ -300,7 +300,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Return true if this product can have inventory
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isStockable()
|
||||
{
|
||||
|
|
@ -310,7 +310,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Return true if this product can be composite
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isComposite()
|
||||
{
|
||||
|
|
@ -338,7 +338,7 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param integer $qty
|
||||
* @param int $qty
|
||||
* @return bool
|
||||
*/
|
||||
public function haveSufficientQuantity($qty)
|
||||
|
|
@ -349,7 +349,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Return true if this product can have inventory
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function showQuantityBox()
|
||||
{
|
||||
|
|
@ -357,7 +357,7 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param CartItem $cartItem
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $cartItem
|
||||
* @return bool
|
||||
*/
|
||||
public function isItemHaveQuantity($cartItem)
|
||||
|
|
@ -366,7 +366,7 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
* @return int
|
||||
*/
|
||||
public function totalQuantity()
|
||||
{
|
||||
|
|
@ -397,7 +397,8 @@ abstract class AbstractType
|
|||
/**
|
||||
* Return true if item can be moved to cart from wishlist
|
||||
*
|
||||
* @return boolean
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeMovedFromWishlistToCart($item)
|
||||
{
|
||||
|
|
@ -407,9 +408,9 @@ abstract class AbstractType
|
|||
/**
|
||||
* Retrieve product attributes
|
||||
*
|
||||
* @param Group $group
|
||||
* @param bool $skipSuperAttribute
|
||||
* @return Collection
|
||||
* @param \Webkul\Attribute\Contracts\Group $group
|
||||
* @param bool $skipSuperAttribute
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getEditableAttributes($group = null, $skipSuperAttribute = true)
|
||||
{
|
||||
|
|
@ -489,7 +490,7 @@ abstract class AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function haveSpecialPrice()
|
||||
{
|
||||
|
|
@ -564,7 +565,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function prepareForCart($data)
|
||||
|
|
@ -603,7 +604,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Get request quantity
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getQtyRequest($data)
|
||||
|
|
@ -617,9 +618,9 @@ abstract class AbstractType
|
|||
|
||||
/**
|
||||
*
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return boolean
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return bool
|
||||
*/
|
||||
public function compareOptions($options1, $options2)
|
||||
{
|
||||
|
|
@ -645,7 +646,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Returns additional information for items
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getAdditionalOptions($data)
|
||||
|
|
@ -656,8 +657,8 @@ abstract class AbstractType
|
|||
/**
|
||||
* Get actual ordered item
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @return CartItem|OrderItem|InvoiceItem|ShipmentItem|Wishlist
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return \Webkul\Checkout\Contracts\CartItem|\Webkul\Sales\Contracts\OrderItem|\Webkul\Sales\Contracts\InvoiceItem|\Webkul\Sales\Contracts\ShipmentItem|\Webkul\Customer\Contracts\Wishlist
|
||||
*/
|
||||
public function getOrderedItem($item)
|
||||
{
|
||||
|
|
@ -667,7 +668,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Get product base image
|
||||
*
|
||||
* @param Wishlist|CartItem $item
|
||||
* @param \Webkul\Customer\Contracts\CartItem|\Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return array
|
||||
*/
|
||||
public function getBaseImage($item)
|
||||
|
|
@ -678,7 +679,7 @@ abstract class AbstractType
|
|||
/**
|
||||
* Validate cart item product price
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @param \Webkul\Customer\Contracts\CartItem $item
|
||||
* @return void
|
||||
*/
|
||||
public function validateCartItem($item)
|
||||
|
|
|
|||
|
|
@ -23,21 +23,21 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* ProductBundleOptionRepository instance
|
||||
*
|
||||
* @var ProductBundleOptionRepository
|
||||
* @var \Webkul\Product\Repositories\ProductBundleOptionRepository
|
||||
*/
|
||||
protected $productBundleOptionRepository;
|
||||
|
||||
/**
|
||||
* ProductBundleOptionProductRepository instance
|
||||
*
|
||||
* @var ProductBundleOptionProductRepository
|
||||
* @var \Webkul\Product\Repositories\ProductBundleOptionProductRepository
|
||||
*/
|
||||
protected $productBundleOptionProductRepository;
|
||||
|
||||
/**
|
||||
* Bundle Option helper instance
|
||||
*
|
||||
* @var BundleOption
|
||||
* @var \Webkul\Product\Helpers\BundleOption
|
||||
*/
|
||||
protected $bundleOptionHelper;
|
||||
|
||||
|
|
@ -64,29 +64,29 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Is a composite product type
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isComposite = true;
|
||||
|
||||
/**
|
||||
* Product children price can be calculated or not
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isChildrenCalculated = true;
|
||||
|
||||
/**
|
||||
* Create a new product type instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param Webkul\Product\Repositories\ProductBundleOptionRepository $productBundleOptionRepository
|
||||
* @param Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository
|
||||
* @param Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @param Webkul\Product\Helpers\BundleOption $bundleOptionHelper
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\Product\Repositories\ProductBundleOptionRepository $productBundleOptionRepository
|
||||
* @param \Webkul\Product\Repositories\ProductBundleOptionProductRepository $productBundleOptionProductRepository
|
||||
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @param \Webkul\Product\Helpers\BundleOption $bundleOptionHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -118,10 +118,10 @@ class Bundle extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -225,8 +225,8 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Get product regular minimal price
|
||||
*
|
||||
* @param ProductBundleOption $option
|
||||
* @param boolean $minPrice
|
||||
* @param \Webkul\Product\Contracts\ProductBundleOption $option
|
||||
* @param bool $minPrice
|
||||
* @return float
|
||||
*/
|
||||
public function getOptionProductsPrices($option, $minPrice = true)
|
||||
|
|
@ -247,7 +247,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Check if product has required options or not
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
protected function haveRequiredOptions()
|
||||
{
|
||||
|
|
@ -408,7 +408,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function prepareForCart($data)
|
||||
|
|
@ -454,7 +454,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getCartChildProducts($data)
|
||||
|
|
@ -492,8 +492,8 @@ class Bundle extends AbstractType
|
|||
|
||||
/**
|
||||
*
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return boolean
|
||||
*/
|
||||
public function compareOptions($options1, $options2)
|
||||
|
|
@ -509,7 +509,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Remove invalid options from add to cart request
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function validateBundleOptionForCart($data)
|
||||
|
|
@ -530,7 +530,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Returns additional information for items
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getAdditionalOptions($data)
|
||||
|
|
@ -575,7 +575,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Returns additional information for items
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionQuantities($data)
|
||||
|
|
@ -606,7 +606,7 @@ class Bundle extends AbstractType
|
|||
/**
|
||||
* Validate cart item product price
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return void
|
||||
*/
|
||||
public function validateCartItem($item)
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ class Configurable extends AbstractType
|
|||
protected $hasVariants = true;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -83,10 +83,10 @@ class Configurable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -127,10 +127,10 @@ class Configurable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $product
|
||||
* @param array $permutation
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @param array $permutation
|
||||
* @param array $data
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function createVariant($product, $permutation, $data = [])
|
||||
{
|
||||
|
|
@ -219,9 +219,9 @@ class Configurable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function updateVariant(array $data, $id)
|
||||
{
|
||||
|
|
@ -260,9 +260,9 @@ class Configurable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param mixed $product
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @param \Webkul\Product\Contracts\Product $product
|
||||
* @return bool
|
||||
*/
|
||||
public function checkVariantOptionAvailabiliy($data, $product)
|
||||
{
|
||||
|
|
@ -304,7 +304,7 @@ class Configurable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param CartItem $cartItem
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $cartItem
|
||||
* @return bool
|
||||
*/
|
||||
public function isItemHaveQuantity($cartItem)
|
||||
|
|
@ -330,8 +330,8 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Return true if item can be moved to cart from wishlist
|
||||
*
|
||||
* @param Wishlist $item
|
||||
* @return boolean
|
||||
* @param \Webkul\Customer\Contracts\Wishlist $item
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeMovedFromWishlistToCart($item)
|
||||
{
|
||||
|
|
@ -404,7 +404,7 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function prepareForCart($data)
|
||||
|
|
@ -456,9 +456,9 @@ class Configurable extends AbstractType
|
|||
|
||||
/**
|
||||
*
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return boolean
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return bool
|
||||
*/
|
||||
public function compareOptions($options1, $options2)
|
||||
{
|
||||
|
|
@ -472,7 +472,7 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Returns additional information for items
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getAdditionalOptions($data)
|
||||
|
|
@ -495,8 +495,8 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Get actual ordered item
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @return CartItem|OrderItem|InvoiceItem|ShipmentItem
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return \Webkul\Checkout\Contracts\CartItem|\Webkul\Sales\Contracts\OrderItem|\Webkul\Sales\Contracts\InvoiceItem|\Webkul\Sales\Contracts\ShipmentItem|\Webkul\Customer\Contracts\Wishlist
|
||||
*/
|
||||
public function getOrderedItem($item)
|
||||
{
|
||||
|
|
@ -506,7 +506,7 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Get product base image
|
||||
*
|
||||
* @param Wishlist|CartItem $item
|
||||
* @param \Webkul\Customer\Contracts\Wishlist|\Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return array
|
||||
*/
|
||||
public function getBaseImage($item)
|
||||
|
|
@ -527,7 +527,7 @@ class Configurable extends AbstractType
|
|||
/**
|
||||
* Validate cart item product price
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return float
|
||||
*/
|
||||
public function validateCartItem($item)
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* ProductDownloadableLinkRepository instance
|
||||
*
|
||||
* @var ProductDownloadableLinkRepository
|
||||
* @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository
|
||||
*/
|
||||
protected $productDownloadableLinkRepository;
|
||||
|
||||
/**
|
||||
* ProductDownloadableSampleRepository instance
|
||||
*
|
||||
* @var ProductDownloadableSampleRepository
|
||||
* @var \Webkul\Product\Repositories\ProductDownloadableSampleRepository
|
||||
*/
|
||||
protected $productDownloadableSampleRepository;
|
||||
|
||||
|
|
@ -57,21 +57,21 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* Is a stokable product type
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isStockable = false;
|
||||
|
||||
/**
|
||||
* Create a new product type instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @param Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
|
||||
* @param Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
|
||||
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -100,10 +100,10 @@ class Downloadable extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -121,7 +121,7 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* Return true if this product type is saleable
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isSaleable()
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function prepareForCart($data)
|
||||
|
|
@ -184,9 +184,9 @@ class Downloadable extends AbstractType
|
|||
|
||||
/**
|
||||
*
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return boolean
|
||||
* @param array $options1
|
||||
* @param array $options2
|
||||
* @return bool
|
||||
*/
|
||||
public function compareOptions($options1, $options2)
|
||||
{
|
||||
|
|
@ -200,7 +200,7 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* Returns additional information for items
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function getAdditionalOptions($data)
|
||||
|
|
@ -225,7 +225,7 @@ class Downloadable extends AbstractType
|
|||
/**
|
||||
* Validate cart item product price
|
||||
*
|
||||
* @param CartItem $item
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $item
|
||||
* @return float
|
||||
*/
|
||||
public function validateCartItem($item)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Grouped extends AbstractType
|
|||
/**
|
||||
* ProductGroupedProductRepository instance
|
||||
*
|
||||
* @var ProductGroupedProductRepository
|
||||
* @var \Webkul\Product\Repositories\ProductGroupedProductRepository
|
||||
*/
|
||||
protected $productGroupedProductRepository;
|
||||
|
||||
|
|
@ -57,13 +57,13 @@ class Grouped extends AbstractType
|
|||
/**
|
||||
* Create a new product type instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param Webkul\Product\Repositories\ProductGroupedProductRepository $productGroupedProductRepository
|
||||
* @param Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository
|
||||
* @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository
|
||||
* @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository
|
||||
* @param \Webkul\Product\Repositories\ProductGroupedProductRepository $productGroupedProductRepository
|
||||
* @param \Webkul\Product\Helpers\ProductImage $productImageHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -89,10 +89,10 @@ class Grouped extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param $id
|
||||
* @param string $attribute
|
||||
* @return Product
|
||||
* @param array $data
|
||||
* @param int $id
|
||||
* @param string $attribute
|
||||
* @return \Webkul\Product\Contracts\Product
|
||||
*/
|
||||
public function update(array $data, $id, $attribute = "id")
|
||||
{
|
||||
|
|
@ -159,7 +159,7 @@ class Grouped extends AbstractType
|
|||
/**
|
||||
* Add product. Returns error message if can't prepare product.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function prepareForCart($data)
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ class Simple extends AbstractType
|
|||
/**
|
||||
* Show quantity box
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $showQuantityBox = true;
|
||||
|
||||
/**
|
||||
* Return true if this product type is saleable
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isSaleable()
|
||||
{
|
||||
|
|
@ -56,9 +56,8 @@ class Simple extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param integer $qty
|
||||
*
|
||||
* @return boolean
|
||||
* @param int $qty
|
||||
* @return bool
|
||||
*/
|
||||
public function haveSufficientQuantity($qty)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,21 +33,21 @@ class Virtual extends AbstractType
|
|||
/**
|
||||
* Is a stokable product type
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $isStockable = false;
|
||||
|
||||
/**
|
||||
* Show quantity box
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $showQuantityBox = true;
|
||||
|
||||
/**
|
||||
* Return true if this product type is saleable
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isSaleable()
|
||||
{
|
||||
|
|
@ -63,7 +63,7 @@ class Virtual extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* @param integer $qty
|
||||
* @param int $qty
|
||||
* @return bool
|
||||
*/
|
||||
public function haveSufficientQuantity($qty)
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ class Validator
|
|||
/**
|
||||
* Validate cart rule for condition
|
||||
*
|
||||
* @param CartRule|CatalogRule $rule
|
||||
* @param Cart|CartItem|Product $entity
|
||||
* @param \Webkul\CartRule\Contracts\CartRule|\Webkul\CatalogRule\Contracts\CatalogRule $rule
|
||||
* @param \Webkul\Checkout\Contracts\Cart|\Webkul\Checkout\Contracts\CartItem|\Webkul\Product\Contracts\Product $entity
|
||||
* @return boolean
|
||||
*/
|
||||
public function validate($rule, $entity)
|
||||
|
|
@ -51,8 +51,8 @@ class Validator
|
|||
/**
|
||||
* Return value for the attribute
|
||||
*
|
||||
* @param array $condition
|
||||
* @param CartItem|Product $entity
|
||||
* @param array $condition
|
||||
* @param \Webkul\Checkout\Contracts\CartItem|\Webkul\Product\Contracts\Product $entity
|
||||
* @return boolean
|
||||
*/
|
||||
public function getAttributeValue($condition, $entity)
|
||||
|
|
@ -118,8 +118,8 @@ class Validator
|
|||
/**
|
||||
* Validate object
|
||||
*
|
||||
* @param array $condition
|
||||
* @param CartItem $entity
|
||||
* @param array $condition
|
||||
* @param \Webkul\Checkout\Contracts\CartItem $entity
|
||||
* @return bool
|
||||
*/
|
||||
private function validateObject($condition, $entity)
|
||||
|
|
@ -140,8 +140,8 @@ class Validator
|
|||
/**
|
||||
* Return all cart items
|
||||
*
|
||||
* @param string $attributeScope
|
||||
* @param Cart|CartItem|Product $item
|
||||
* @param string $attributeScope
|
||||
* @param \Webkul\Checkout\Contracts\Cart|\Webkul\Checkout\Contracts\CartItem|\Webkul\Product\Contracts\Product $item
|
||||
* @return array
|
||||
*/
|
||||
private function getAllItems($attributeScope, $item)
|
||||
|
|
@ -162,7 +162,7 @@ class Validator
|
|||
/**
|
||||
* Validate object
|
||||
*
|
||||
* @param array $condition
|
||||
* @param array $condition
|
||||
* @return string
|
||||
*/
|
||||
private function getAttributeScope($condition)
|
||||
|
|
@ -177,9 +177,9 @@ class Validator
|
|||
/**
|
||||
* Validate attribute value for condition
|
||||
*
|
||||
* @param array $condition
|
||||
* @param mixed $attributeValue
|
||||
* @return boolean
|
||||
* @param array $condition
|
||||
* @param mixed $attributeValue
|
||||
* @return bool
|
||||
*/
|
||||
public function validateAttribute($condition, $attributeValue)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
/**
|
||||
* ProductDownloadableLinkRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository
|
||||
*/
|
||||
protected $productDownloadableLinkRepository;
|
||||
|
||||
/**
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -42,7 +42,7 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -50,7 +50,7 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $orderItem
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @return void
|
||||
*/
|
||||
public function saveLinks($orderItem)
|
||||
|
|
@ -83,7 +83,7 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
/**
|
||||
* Return true, if ordered item is valid downloadable product with links
|
||||
*
|
||||
* @param mixed $orderItem Webkul\Sales\Models\OrderItem;
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @return bool
|
||||
*/
|
||||
private function isValidDownloadableProduct($orderItem) : bool {
|
||||
|
|
@ -95,8 +95,8 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param OrderItem $orderItem
|
||||
* @param string $status
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @param string $status
|
||||
* @return void
|
||||
*/
|
||||
public function updateStatus($orderItem, $status)
|
||||
|
|
|
|||
|
|
@ -19,16 +19,15 @@ class InvoiceItemRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
|
||||
function model()
|
||||
{
|
||||
return InvoiceItem::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function updateProductInventory($data)
|
||||
|
|
|
|||
|
|
@ -19,39 +19,39 @@ class InvoiceRepository extends Repository
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* InvoiceItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\InvoiceItemRepository
|
||||
*/
|
||||
protected $invoiceItemRepository;
|
||||
|
||||
/**
|
||||
* DownloadableLinkPurchasedRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository
|
||||
*/
|
||||
protected $downloadableLinkPurchasedRepository;
|
||||
|
||||
/**
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\InvoiceItemRepository $invoiceItemRepository
|
||||
* @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\InvoiceItemRepository $invoiceItemRepository
|
||||
* @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
*/
|
||||
public function __construct(
|
||||
OrderRepository $orderRepository,
|
||||
|
|
@ -77,7 +77,7 @@ class InvoiceRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
|
||||
function model()
|
||||
|
|
@ -86,8 +86,8 @@ class InvoiceRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Sales\Contracts\Invoice
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -216,8 +216,8 @@ class InvoiceRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $invoice
|
||||
* @return mixed
|
||||
* @param \Webkul\Sales\Contracts\Invoice $invoice
|
||||
* @return \Webkul\Sales\Contracts\Invoice
|
||||
*/
|
||||
public function collectTotals($invoice)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class OrderItemRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -27,8 +27,8 @@ class OrderItemRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Sales\Contracts\OrderItem
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -43,8 +43,8 @@ class OrderItemRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $orderItem
|
||||
* @return mixed
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @return \Webkul\Sales\Contracts\OrderItem
|
||||
*/
|
||||
public function collectTotals($orderItem)
|
||||
{
|
||||
|
|
@ -102,7 +102,7 @@ class OrderItemRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $orderItem
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @return void
|
||||
*/
|
||||
public function manageInventory($orderItem)
|
||||
|
|
@ -145,7 +145,7 @@ class OrderItemRepository extends Repository
|
|||
/**
|
||||
* Returns qty to product inventory after order cancelation
|
||||
*
|
||||
* @param OrderItem $orderItem
|
||||
* @param \Webkul\Sales\Contracts\OrderItem $orderItem
|
||||
* @return void
|
||||
*/
|
||||
public function returnQtyToProductInventory($orderItem)
|
||||
|
|
|
|||
|
|
@ -20,23 +20,22 @@ class OrderRepository extends Repository
|
|||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* DownloadableLinkPurchasedRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository
|
||||
*/
|
||||
protected $downloadableLinkPurchasedRepository;
|
||||
|
||||
/**
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
*
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -54,18 +53,16 @@ class OrderRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
|
||||
public function model()
|
||||
{
|
||||
return Order::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Sales\Contracts\Order
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -132,9 +129,8 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $orderId
|
||||
*
|
||||
* @return mixed
|
||||
* @param int $orderId
|
||||
* @return \Webkul\Sales\Contracts\Order
|
||||
*/
|
||||
public function cancel($orderId)
|
||||
{
|
||||
|
|
@ -191,7 +187,7 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
* @return int
|
||||
*/
|
||||
public function generateIncrementId()
|
||||
{
|
||||
|
|
@ -217,8 +213,7 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $order
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function isInCompletedState($order)
|
||||
|
|
@ -249,8 +244,7 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $order
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function isInCanceledState($order)
|
||||
|
|
@ -284,8 +278,7 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $order
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return void
|
||||
*/
|
||||
public function updateOrderStatus($order)
|
||||
|
|
@ -307,8 +300,7 @@ class OrderRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mixed $order
|
||||
*
|
||||
* @param \Webkul\Sales\Contracts\Order $order
|
||||
* @return mixed
|
||||
*/
|
||||
public function collectTotals($order)
|
||||
|
|
|
|||
|
|
@ -12,13 +12,12 @@ use Webkul\Sales\Contracts\RefundItem;
|
|||
* @author Jitendra Singh <jitendra@webkul.com>
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
|
||||
class RefundItemRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -28,8 +27,8 @@ class RefundItemRepository extends Repository
|
|||
/**
|
||||
* Returns qty to product inventory after order refund
|
||||
*
|
||||
* @param OrdreItem $orderItem
|
||||
* @param integer $quantity
|
||||
* @param \Webkul\Sales\Contracts\Order $orderItem
|
||||
* @param int $quantity
|
||||
* @return void
|
||||
*/
|
||||
public function returnQtyToProductInventory($orderItem, $quantity)
|
||||
|
|
|
|||
|
|
@ -19,39 +19,39 @@ class RefundRepository extends Repository
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* RefundItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\RefundItemRepository
|
||||
*/
|
||||
protected $refundItemRepository;
|
||||
|
||||
/**
|
||||
* DownloadableLinkPurchasedRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository
|
||||
*/
|
||||
protected $downloadableLinkPurchasedRepository;
|
||||
|
||||
/**
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\RefundItemRepository $refundItemRepository
|
||||
* @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\RefundItemRepository $refundItemRepository
|
||||
* @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository
|
||||
* @param \Illuminate\Container\Container $app
|
||||
*/
|
||||
public function __construct(
|
||||
OrderRepository $orderRepository,
|
||||
|
|
@ -75,7 +75,7 @@ class RefundRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -83,8 +83,8 @@ class RefundRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Sales\Contracts\Refund
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
@ -207,8 +207,8 @@ class RefundRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param Refund $refund
|
||||
* @return mixed
|
||||
* @param \Webkul\Sales\Contracts\Refund $refund
|
||||
* @return \Webkul\Sales\Contracts\Refund
|
||||
*/
|
||||
public function collectTotals($refund)
|
||||
{
|
||||
|
|
@ -236,8 +236,8 @@ class RefundRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param integer $orderId
|
||||
* @param array $data
|
||||
* @param integer $orderId
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderItemsRefundSummary($data, $orderId)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class ShipmentItemRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
|
|
@ -26,7 +26,7 @@ class ShipmentItemRepository extends Repository
|
|||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function updateProductInventory($data)
|
||||
|
|
|
|||
|
|
@ -22,30 +22,30 @@ class ShipmentRepository extends Repository
|
|||
/**
|
||||
* OrderRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderRepository
|
||||
*/
|
||||
protected $orderRepository;
|
||||
|
||||
/**
|
||||
* OrderItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\OrderItemRepository
|
||||
*/
|
||||
protected $orderItemRepository;
|
||||
|
||||
/**
|
||||
* ShipmentItemRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Sales\Repositories\ShipmentItemRepository
|
||||
*/
|
||||
protected $shipmentItemRepository;
|
||||
|
||||
/**
|
||||
* Create a new repository instance.
|
||||
*
|
||||
* @param Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param Webkul\Sales\Repositories\ShipmentItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderItemRepository $orderItemRepository
|
||||
* @param \Webkul\Sales\Repositories\ShipmentItemRepository $orderItemRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -67,17 +67,16 @@ class ShipmentRepository extends Repository
|
|||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return Mixed
|
||||
* @return string
|
||||
*/
|
||||
|
||||
function model()
|
||||
{
|
||||
return Shipment::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @param array $data
|
||||
* @return \Webkul\Sales\Contracts\Shipment
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use Illuminate\Support\Facades\Config;
|
|||
*/
|
||||
abstract class AbstractShipping
|
||||
{
|
||||
|
||||
abstract public function calculate();
|
||||
|
||||
/**
|
||||
|
|
@ -62,14 +61,12 @@ abstract class AbstractShipping
|
|||
/**
|
||||
* Retrieve information from payment configuration
|
||||
*
|
||||
* @param string $field
|
||||
* @param int|string|null $channelId
|
||||
*
|
||||
* @param string $field
|
||||
* @param int|string|null $channelId
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConfigData($field)
|
||||
{
|
||||
return core()->getConfigData('sales.carriers.' . $this->getCode() . '.' . $field);
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
|
@ -21,22 +21,22 @@ class CartController extends Controller
|
|||
/**
|
||||
* WishlistRepository Repository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Customer\Repositories\WishlistRepository
|
||||
*/
|
||||
protected $wishlistRepository;
|
||||
|
||||
/**
|
||||
* ProductRepository object
|
||||
*
|
||||
* @var Object
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
protected $productRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CartItemRepository $wishlistRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @param \Webkul\Customer\Repositories\CartItemRepository $wishlistRepository
|
||||
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -68,7 +68,8 @@ class CartController extends Controller
|
|||
/**
|
||||
* Function for guests user to add the product in the cart.
|
||||
*
|
||||
* @return Mixed
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function add($id)
|
||||
{
|
||||
|
|
@ -106,8 +107,8 @@ class CartController extends Controller
|
|||
/**
|
||||
* Removes the item from the cart if it exists
|
||||
*
|
||||
* @param integer $itemId
|
||||
* @return Response
|
||||
* @param int $itemId
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function remove($itemId)
|
||||
{
|
||||
|
|
@ -123,7 +124,7 @@ class CartController extends Controller
|
|||
/**
|
||||
* Updates the quantity of the items present in the cart.
|
||||
*
|
||||
* @return Response
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function updateBeforeCheckout()
|
||||
{
|
||||
|
|
@ -143,8 +144,8 @@ class CartController extends Controller
|
|||
/**
|
||||
* Function to move a already added product to wishlist will run only on customer authentication.
|
||||
*
|
||||
* @param integer $id
|
||||
* @return Response
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function moveToWishlist($id)
|
||||
{
|
||||
|
|
@ -162,7 +163,7 @@ class CartController extends Controller
|
|||
/**
|
||||
* Apply coupon to the cart
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function applyCoupon()
|
||||
{
|
||||
|
|
@ -197,7 +198,7 @@ class CartController extends Controller
|
|||
/**
|
||||
* Apply coupon to the cart
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function removeCoupon()
|
||||
{
|
||||
|
|
@ -210,11 +211,9 @@ class CartController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true, if result of adding product to cart
|
||||
* is an array and contains a key "warning"
|
||||
*
|
||||
* @param $result
|
||||
* Returns true, if result of adding product to cart is an array and contains a key "warning"
|
||||
*
|
||||
* @param array $result
|
||||
* @return bool
|
||||
*/
|
||||
private function onWarningAddingToCart($result): bool {
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ class CategoryController extends Controller
|
|||
/**
|
||||
* CategoryRepository object
|
||||
*
|
||||
* @var array
|
||||
* @var \Webkul\Category\Repositories\CategoryRepository
|
||||
*/
|
||||
protected $categoryRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
|
||||
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CategoryRepository $categoryRepository)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue