Jump to content

managment of stock product


ghost4life
 Share

Recommended Posts

Hi,

 

Instead of displaying the numpber of product available I would like to display some lights of coulour for informing the custommer availibility. In fact I think it is better to display "In stock", than 3 products left.

 

So I started to edit the .tpl, but I really do not know what need to be chnaged in order to works.

 

So here is the part interesting :

<!-- availability -->
  <p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_label">{l s='Availability:'}</span>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}</span>  
  </p>
  <p id="availability_date"{if ($product->quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span id="availability_date_label">{l s='Availability date:'}</span>
<span id="availability_date_value">{dateFormat date=$product->available_date full=false}</span>
  </p>
  <!-- number of item in stock -->

 

I would like to add, this picture if quantity equal zero or less, <img src=\'images/red.gif\' title=\'Produit hors stock\'>

 

this one if between 0 and 5 <img src=\'images/orange.gif\' title=\'Attention, dernières pièces disponibles\'>

and this one if upper than 5 <img src=\'images/green.gif\' title=\'Produit en stock\'>

 

Anykind of help will be much appreciated.

 

Kind regards

Share this post


Link to post
Share on other sites

Bonjour,

 

j'ai fais cela :

{if $product->quantity == 0}<span   id="quantityAvailableTxt"><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
	    {if $product->quantity >= 1 AND $product->quantity <=5}<span   id="quantityAvailableTxt"><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}
    {if $product->quantity > 5}<span   id="quantityAvailableTxt"><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}

 

I've done this code but it does not work when we have some declination of products.

Share this post


Link to post
Share on other sites

Thanks for your reply,

 

I've done that

 

{if $product->quantity == 0}<span   id="quantityAvailableTxt"><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
			    {if $product->quantity >= 1 AND $product->quantity <=5}<span   id="quantityAvailableTxt"><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}
	    {if $product->quantity > 5}<span   id="quantityAvailableTxt"><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}

 

the trouble is that it does not take in count the declination

Share this post


Link to post
Share on other sites

I've also tried this but it does not work, the reuslt is the same for each declination

 

{if $product->checkQty($this->id) == 0}<span><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
  {if $product->checkQty($this->id) >= 1 AND $product->checkQty($this->id) <=5}<span><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}
  {if $product->checkQty($this->id) > 5}<span><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}

Share this post


Link to post
Share on other sites

what you've got in the $product->quantity output?

 

can you use somewhere {$product->quantity} or {$product|print_r} to display all available variables? Does the quantity variable exist?

Share this post


Link to post
Share on other sites

thanks! it's really helpful!

 

you've got there quantity field:

 

[quantity] => 6

 

so the method:

{if $product->quantity > 5}<span   id="quantityAvailableTxt"><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}

 

should work well :/

 

 

when you use this code, what you've got? nothing?

Share this post


Link to post
Share on other sites

in fact I've done that code

[/size]
{if $product->quantity == 0}<span><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
  {if $product->quantity >= 1 AND $product->quantity <=5}<span><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}
  {if $product->quantity > 5}<span><img src='images/green.gif' title='Produit en Stock'> Produit en stock</span>{/if}

 

but when I choose a declination which has 0 productsq in stock it still display in stock.

Share this post


Link to post
Share on other sites

so, when quantity = 0

you've got two messages?

 

{if $product->quantity == 0}<span><img src='images/red.gif' title='Produit en rupture de stock'> Produit en rupture de stock</span>{/if}
  {if $product->quantity >= 1 AND $product->quantity <=5}<span><img src='images/orange.gif' title='Attention : Dernières quantités disponible'> Attention : Dernières quantités disponible</span>{/if}

 

am i right?

Share this post


Link to post
Share on other sites

if equal to zero I have no products

 

if quantity between 0 and 5 warning : last products in stock

 

when it is upper to 5 product available in stock

 

the trouble is when, please have a look there

 

http://omega-nutrition.fr/100-whey-premium-muscletech-proteines-48.html

 

when you choose chocolate the button add to cart is not display cause no stock, and the message is still the same as if the product was in stock

 

when you choose vanilla in declination product in stock and button for add to cart is there.

 

I mean, the button should change for each declination, but not. it is not displayed correctly

Share this post


Link to post
Share on other sites

I bought a module but I've been screwed. In fact it does not manage the stock. This module is called rsi stock I bought it for almost 50€ I asked for reimbursment but they did not reply.

 

Please have a look : http://omega-nutrition.fr/nitrotech-peformance-series-muscletech-proteines-isolat-49.html#/nitrotech_performance_series_18kg-chocolat it is down below near the battery stock.

Share this post


Link to post
Share on other sites

it's because when you change attribute - AJAX sends query to the database, and retrieve informations about stock. It's hard to achieve this for external modules...

 

i will try to debug it (with defalt product.tpl file and scripts)

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More