I want to make Add to Cart buttons available on al...
# suitecommerce
a
I want to make Add to Cart buttons available on all the items in the facets views, but these buttons always fail with the message popup "Sorry, there is a problem with this Item and can not be purchased at this time. Please check back later." Not a very helpful error message for a developer. I inspected the HTTP request the button makes, and it's requesting the item in a quantity of 1, which is fewer than the minimum quantity set for almost all the items. So I suspect that's the reason it's not working. But how can it be fixed so the buttons will order the minimum quantity instead? This is SuiteCommerce Standard, not SCA. I might have to remove the facet view Add to Cart buttons if I can't fix this. But that's not the end of the world, just a nice-to-have.
1
u
couple different options but maybe override the theme template for that Facet - grid, table, list .tpl files and force the input for that quantity to use the min attribute something like
min='{{item.minquantity}}'
also when you add to cart with the proper qty amount that meet the min requirements does the error still occur ?
also - make sure you are not adding a matrix parent item to the cart
a
We're not using matrix items, but you're right, I should check on whether items with a min qty of 1 work before going to the trouble of making an extension.
OK I confirmed that changing an item's Min Qty to 1 fixes the problem for that item only, and not the others that still have Min Qty higher than 1.
Because I won't have time to complete this project if I get involved with developing extensions any further, I'll need to just turn off the SC Configuration checkbox for Add To Cart From Facets (I think that's what it's called).
s
min, max, and step attributes are interesting little things you can to quantity inputs. Maybe I should write a tutorial about them
👍 2
a
That's another approach that could work for our situation and I see the benefit: Input step size equivalent to the number of sales units that would constitute a full truck load pallet. That way the step size functions as that multiplication factor in every use case, so we wouldn't have to cover them all with brittle client-side code after the input element is rendered, with the step size determined by each specific Item.