-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New dashboard page to quickly update stock quantities? #738
Comments
I've had others comment on the potential of being able to edit product fields, like the price, or the availability, from the product list screen. That makes some sense to me, but it may also work a little better on its own dashboard page, where it would be specifically designed for bulk editing. Perhaps it makes sense at this stage to still build it as a seperate package, where it can be selectively installed if needed (and also more easily modified at for different purposes). Down the track, if it make sense to do so it wouldn't be difficult to just add it to the main store package. |
I agree. Should I publish that package under the https://github.com/concretecms-community-store umbrella? Otherwise I'd publish it under https://github.com/concrete5-community |
I reckon under https://github.com/concretecms-community-store |
Yeah, much better. |
Perhaps something a bit more generic, like |
👍 If you create that repo and give write access to me, I'll create it asap |
I've pushed some code to https://github.com/concretecms-community-store/community_store_bulk_product_updating @Mesuva I'm not very familiar with Communiy Store: do you think that the criterias I wrote here and here are ok? |
@mlocati Both those sections look good to me, at a glance at least - that join looks how I'd expect. Also cool to see vuejs in your add-on, I think that's the first time I've spotted someone else using it with Concrete. |
Thank for confirming, Ryan! Yep, I use vue whenever possible (I use jQuery only for ajax requests nowadays 😉) |
@Mesuva I'm done with https://github.com/concretecms-community-store/community_store_bulk_product_updating If you can/want to take a look at it, please let me know. |
@mlocati I've taken a quick look at the add-on. Just a couple of questions: |
Yep: that's what users read when they visit the page:
Yep, but you need to enter some search criteria and hit the magnifying class icon.
Whoops: I tested the code only for products that have mandatory variants. |
This is working well for me now. I'm wondering if something like this is more useful if you don't have to do a search query first - it would just show all products, and you could work your way through them all without having to known what to search for. |
Well, if people have thousands of products/product variations, that would be a huge page... |
Is it not paginated? |
Nope |
Adding pagination is rather cumbersome. The records are fetched by this query, which basically retrieves the products, product options, product variations, and product variation options in just one query. That's done to avoid hundreds of queries (it's faster to retrieve all product data in just one query, instead of executing a query for every product). The downside of this is that we can't easily add pagination: how may records should the results be limited to, provided that a single product may span multiple rows returned by that query? |
Just for reference, here's that big query (I've simplified it a bit): SELECT
StoreProducts.*,
CommunityStoreProductOptions.*,
CommunityStoreProductVariations.*,
CommunityStoreProductVariationOptionItems.*,
CommunityStoreProductOptionItems.*
FROM
StoreProducts
LEFT JOIN CommunityStoreProductOptions
ON StoreProducts.pID = CommunityStoreProductOptions.pID
LEFT JOIN CommunityStoreProductVariations
ON StoreProducts.pID = CommunityStoreProductVariations.pID
LEFT JOIN CommunityStoreProductVariationOptionItems
ON CommunityStoreProductVariations.pvID = CommunityStoreProductVariationOptionItems.pvID
LEFT JOIN CommunityStoreProductOptionItems
ON CommunityStoreProductVariationOptionItems.poiID = CommunityStoreProductOptionItems.poiID
LEFT JOIN CommunityStoreProductVariations AS CommunityStoreProductVariationsWhere
ON StoreProducts.pID = CommunityStoreProductVariationsWhere.pID
AND (StoreProducts.pVariations = 1
AND (CommunityStoreProductVariationsWhere.pvDisabled IS NULL OR CommunityStoreProductVariationsWhere.pvDisabled = 0))
WHERE
StoreProducts.pActive = 1
AND (StoreProducts.pDateAvailableStart IS NULL OR StoreProducts.pDateAvailableStart < '2023-02-20 19:59:40')
AND (StoreProducts.pDateAvailableEnd IS NULL OR StoreProducts.pDateAvailableEnd > '2023-02-20 19:59:40')
AND (
(
StoreProducts.pName LIKE '%search%'
OR StoreProducts.pSKU LIKE '%search%'
OR StoreProducts.pBarcode LIKE '%search%'
OR StoreProducts.pDesc LIKE '%search%'
OR CommunityStoreProductVariationsWhere.pvSKU LIKE '%search%'
OR CommunityStoreProductVariationsWhere.pvBarcode LIKE '%search%'
)
AND
(
StoreProducts.pName LIKE '%me%'
OR StoreProducts.pSKU LIKE '%me%'
OR StoreProducts.pBarcode LIKE '%me%'
OR StoreProducts.pDesc LIKE '%me%'
OR CommunityStoreProductVariationsWhere.pvSKU LIKE '%me%'
OR CommunityStoreProductVariationsWhere.pvBarcode LIKE '%me%'
)
)
ORDER BY
StoreProducts.pName ASC,
StoreProducts.pSKU ASC,
CommunityStoreProductOptions.poSort ASC,
CommunityStoreProductVariations.pvSort ASC |
It has been rather hard, but I've updated that package: it now supports pagination. |
Done. |
I'm planning to build a website for a friend of mine.
She has a physical store, and she wants to start selling online too.
For that reason, she needs to update the available quantities for products when she sells something in the physical shop.
At the moment, updating the available quantity is rather overcomplicated for someone that only needs to do that.
Would you accept a PR that adds a new dashboard page only for that purpose?
Of course, I can create a separated package, but I was wondering if it's a requirement that others too may have...
The text was updated successfully, but these errors were encountered: