Jump to content

[SOLVED]Product availability


erikl

Recommended Posts

Hi!

I have a little problem:

Although when I set a products quantity to 0 in BO, in the front office, on the product list it still says "Available" under the product... It is also available in the cart summary
Anybody know the solution to this bug?

Thanks

  • Like 1
Link to comment
Share on other sites

Do you have "When out of stock" set to "Allow orders" or "Default: Allow orders" on the "1. Info" tab of the product editor? If you do, then the item will be marked as "Available" even if it is out-of-stock. You must change it to "Deny orders" for it to be unavailable.

It is the following code on line 19 of product-list.tpl that displays the "Available" or "Out of stock" on the product listings:

{if ($product.allow_oosp OR $product.quantity > 0)}{l s='Available'}{else}{l s='Out of stock'}{/if}



and it is the following code on lines 10-16 of shopping-cart-product-line.tpl that display the tick in shopping cart summary:


   {if $product.active AND ($product.allow_oosp OR $product.stock_quantity > 0)}
       <img src="{$img_dir}icon/available.gif" alt="{l s='Available'}" />
   {else}
       <img src="{$img_dir}icon/unavailable.gif" alt="{l s='Out of stock'}" />
   {/if}



You can {* comment out *} this code if you don't want it displayed. You will also need to comment out line 46 of shopping-cart.tpl to remove the column title:

{l s='Avail.'}

  • Like 1
Link to comment
Share on other sites

Hi Rocky,

thank you for your fast reply and help. I have set it to "Default: Allow Orders"

The business setting is this: my company works on a just-in-time delivery basis with out suppliers, so while we do have most items in stock at all times, it can happen that they are out for a couple of days, but usually we get new stock within a week. And in the market we're working, it is not an issue for customers if sending their order will be delayed.

In addition we have online and offline sales, so the stock management on the website would be wrong most of the time anyways, which is why we don't want to use the stock-management of Prestashop, but the customer should still be able to order an item wether Prestashop "thinks" it is in stock or not. The shop should just not display any stock statuses at all, as they might be wrong. I don't want our customer to think an item is in stock when it's actually only going to restock a couple of days later, and the other way round, I don't want them to think something is out of stock while it isn't.

So is there a way to remove all stock information from cart, order confirmation and online tracking?

I think the code you posted could do the trick, however I am more a business guy than a coder, so I am not sure about how the comment out tag in PHP looks like. Stars in front and end of code to comment out?

Thanks in advance!

Dan

Link to comment
Share on other sites

Hi guys,

this solution worked for me in the end:

I've activated the wishlist block and set the quanitity of out of stock products to 0 and to Deny orders for each of the products separately.

Now, they can't add it to the cart but they can add to wishlist.

Mister Denial, for you what Rocky said is OK.
You can either comment out like this:
/* Line to comment out */

or delete the line, but remember to keep a backup of the original file if something is wrong.
After you delete save it on your PC and then copy to your server and overwrite original.
It should be in prestashop directory/themes/your theme name/shopping-cart.tpl

Cheers

Link to comment
Share on other sites

  • 4 weeks later...

Hi

I needed the similar functions that Mister Denial has mentioned so I deleted the required cart availability lines from shopping-cart.tpl but then the alignment of the cart summary header is off. I can't figure how to correct it. Since its designed like a table & the header uses the

 

tags, can you tell me what I need to put to make sure the other

 

tags remain aligned even if I removed the line :

{l s='Availability'}



Here's a screenshot for better understanding

32017_TutzcedoUUMVwVhMxq0d_t

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

Hi Rocky

Thanks for the solution to the shopping cart summary availability.

I'm having another problem as well though.... on the shopping cart summary (see screenshot) it indicates (with the green dot) that both items are available while the first item is actually a back order item - I've set it to allow orders when out of stock.

Is there a way of making it say "special order" instead of "available" for the items that can be ordered even though they're out of stock?

In other words, in place of the green dots I want it to say "available" if the item is in stock, "special order" if it's a special back order, or "out of stock".

If you can help it would be much appreciated!

Thanks so much.

47626_DbJEWo9yCVmNpG4AuYxy_t

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...