This patch for ecviews.module adds a filter in views to filter by with a product is in stock. Products that don't have inventory management enabled are considered 'in stock'. this will only work for tangible products, as it uses the ec_product_tangible table. I haven't tested this extensively. It works fine on a client site that only has tangible products and inventory management is enabled for all products.

CommentFileSizeAuthor
#7 138988.patch2.1 KBBevan
#1 ecviews.module.add tangible.patch1.69 KBBevan

Comments

Bevan’s picture

StatusFileSize
new1.69 KB

I forgot to upload...

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

Patch works on my site.

brmassa’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Guys,

commited on eC4. ec3 needs this patch yet.

regards,

massa

sime’s picture

Status: Patch (to be ported) » Fixed

no new features in ec3

darren oh’s picture

Status: Fixed » Closed (won't fix)
Bevan’s picture

Glad to hear it's in ec4. I agree it shouldn't go into ec3; it's a feature and EC3 is already stable. :)

Bevan’s picture

Version: 5.x-3.0 » 5.x-4.x-dev
Status: Closed (won't fix) » Needs review
StatusFileSize
new2.1 KB

This version of the patch doesn't exclude nodes that don't aren't tangible products, which means the filter can be used generically on regular views like taxonomy/term to exclude out of stock products.

I diffed against EC3. I'm not sure if should be ported to EC4 or not.

gordon’s picture

Status: Needs review » Closed (won't fix)

Thanks, People can apply this if they want.

gold’s picture

Status: Closed (won't fix) » Fixed

Hey all,

I had a situation were I needed this functionality, but couldn't have it in the ecviews module. I've created a project page, committed the code and released my first (rather tiny) module.

ec_in_stock_filter is a straight replacement for the patch above.

If you install this module and restore ecviews.module to it's unpatched state edit the view that was using this field, ensure the field is still in the Filters and submit the View. After stripping things out and setting up the module I was still getting no products showing until I submitted the View again.

Hope someone finds this useful.

Not sure if "Fixed" is the right Status, but this should resolve the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.