X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Show "Out of Stock" on 0 qty products (https://forum.x-cart.com/showthread.php?t=77760)

Luchiii 04-17-2020 12:25 AM

Show "Out of Stock" on 0 qty products
 
Hello everyone!
My site allow people see Out of Stock products as we can reorder them but, right now, I can't show that the product is out of stock, you can't simply add it to cart. As I see, this is how the button works/appear:

HTML Code:

<div class="add-button-wrapper {{ this.getFingerprint() }}">
  {% if not this.isOutOfStock() and this.isProductAvailableForSale() %}
    {{ widget('\\XLite\\View\\Button\\Submit', label='Add to cart', style='regular-main-button add2cart') }}
  {% endif %}
</div>


Any advinces about how I can edit this using something like an IF / ELSE to show an "Out of Stock" message instead of the "Add to Cart" button?

Thanks a lot for your help or any advices about how I can do it! ;-)

cflsystems 04-17-2020 04:30 AM

Re: Show "Out of Stock" on 0 qty products
 
It sounds like you have set the store to not track inventory. If the store is set to track inventory then out of stock products will show as "out of stock" and ordering is not allowed. When you set the store not to track inventory products are "available for sale" and not "out of stock".
So if you want to use your current setup it will take more than just a simple change in this template file.


Or you can use this module - https://market.x-cart.com/addons/backorder-preorder.html

Luchiii 04-17-2020 06:31 AM

Re: Show "Out of Stock" on 0 qty products
 
Quote:

Originally Posted by cflsystems
It sounds like you have set the store to not track inventory. If the store is set to track inventory then out of stock products will show as "out of stock" and ordering is not allowed. When you set the store not to track inventory products are "available for sale" and not "out of stock".
So if you want to use your current setup it will take more than just a simple change in this template file.


Or you can use this module - https://market.x-cart.com/addons/backorder-preorder.html


Hi!
First of all, thanks for your reply.
I have my inventory tracked to show when a products is shown is in low stock to give a warning on product page. I just need something to tell that product in right now Out of Stock but you can ask, by using the ask form, about it. Customers have only to now that is Out of Stock and they can ask for it, not put it in the cart if quantity is 0. For that reason my idea was replace the add to cart button into an out of stock message with the same dimensions and space.

memoto 04-17-2020 08:40 AM

Re: Show "Out of Stock" on 0 qty products
 
I would also recommend using the module Steve mentioned: https://market.x-cart.com/addons/backorder-preorder.html

It provides exactly what you require and also allows customers to get notified once the products are back to stock.

Luchiii 04-22-2020 12:15 AM

Re: Show "Out of Stock" on 0 qty products
 
Hi all!
I just want something really really more simple. I don't need notify restock or. similiar, I just want to add a box (would be great instead of the "add to cart" button as place) on a product page with stock level 0 that tells "Out of stock", nothing more!

razorbackrinds 05-31-2020 10:40 AM

Re: Show "Out of Stock" on 0 qty products
 
2 Attachment(s)
I am not sure if this is exactly what you are wanting or not but we use the Backorder Module. In our case we make and sell pork rinds. We usually keep a few of each flavor in stock however there are times when a customer wants to order a particular flavor which we are out of.


So when they are viewing the actual product page, we tell them that it is available for pre-ordering if they would like to order it. Then after they have added it to their cart, the cart displays that, in our case, it is made fresh to order and to allow us 24 hours for the item to be available.


Hope that this helps.


All times are GMT -8. The time now is 07:48 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.