bagisto / bagisto-bulk-upload

The Laravel eCommerce Bulk Upload allows the admin to create and add a bulk number of products into Bagisto online store.
https://bit.ly/3zRLSzw
MIT License
21 stars 26 forks source link

Uploading simple products records more than 1000 #43

Open DarussalamTech opened 3 years ago

DarussalamTech commented 3 years ago

When we upload products csv having more than 1000 records, the count is adjusted per 100 products in SimpleProductRepository@createProduct line# 165

if ($requestData['totalNumberOfCSVRecord'] < 1000) {
    $processCSVRecords = $requestData['totalNumberOfCSVRecord']/($requestData['totalNumberOfCSVRecord']/10);
} else {
    $processCSVRecords = $requestData['totalNumberOfCSVRecord']/($requestData['totalNumberOfCSVRecord']/100);
}

it should be either

if ($requestData['totalNumberOfCSVRecord'] < 1000) {
    $processCSVRecords = $requestData['totalNumberOfCSVRecord']/($requestData['totalNumberOfCSVRecord']/10);
} else {
    $processCSVRecords = $requestData['totalNumberOfCSVRecord']/($requestData['totalNumberOfCSVRecord']/10);
}

where we just use 10 products bag or when storing products we should add 100 products for records more than 1000

Secondly why we are using $requestData['totalNumberOfCSVRecord']/($requestData['totalNumberOfCSVRecord']/10); when we can just use 10 instead.

I encountered this issue and have fixed on my side by changing the value of $processCSVRecords to 10

prateek-webkul commented 3 years ago

Hello @DarussalamTech ,

Thanks for mentioning the bug. Also, you may do respective PR (Pull Request) for the issue.

Thanks