View Single Post
  #2  
Old 03-10-2015, 04:31 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Remove variant selections that are out of stock

Hi, Mike!

X-Cart already has the isInStock() method defined in the
Code:
\XLite\Module\XC\ProductVariants\View\Product\Details\Customer\Stock
class that does what you need. However, it works with the currently selected variant instead of accepting values of selected options and then saying whether this configuration does have in-stock variant or not.

That is why I need to clarify the task a little bit. What if we have 2 colors (white and black) and 3 sizes (S, M, L). Black + L variant is out of stock. Does it mean that one first load, product page will show all values in two select-boxes, but if we choose Black, then we will only need to show S and M options in the second select-box? Or are you expecting it to work in a different way?

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!

Last edited by tony_sologubov : 03-13-2015 at 01:16 AM.
Reply With Quote