Congerman:
Thanks DR Byte for the idea i will try it, also is it possible to do what was in the old thread in the newer version something like the below from the old thread?
**I managed to remove the product price when quantity was 0 or less by editing the file that Linda mentioned. Here is what I did (using ZenCart 1.3.8a):
Copied the file catalog/includes/templates/tpl_product_info_display.php into my
catalog/includes/templates/OVER_RIDE_DIR/templates/ directory.
In the file I copied, I found the Product Price Block section.
Then located the line
Code:
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
and replaced it with
Code:
if ($products_quantity > 0) {
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
} else {
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') ;
}
**
my price block looks like this
<!--bof Product Price block -->
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php if($specials_price): ?>
<span class="base-price"><?= $products_base_price ?></span>
<span class="sale-price" itemprop="price"><?= $specials_price ?></span>
<?php else: ?>
<span class="sale-price" itemprop="price"><?= $products_base_price ?></span>
<?php endif; ?>
<?php if($show_onetime_charges_description == 'true'): ?>
<span class="one-time"><?= TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION ?></span>
<?php endif; ?>
</div>
Looked at this again and I think I get it. Modify your price block section from:
<!--bof Product Price block -->
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php if($specials_price): ?>
<span class="base-price"><?= $products_base_price ?></span>
<span class="sale-price" itemprop="price"><?= $specials_price ?></span>
<?php else: ?>
<span class="sale-price" itemprop="price"><?= $products_base_price ?></span>
<?php endif; ?>
<?php if($show_onetime_charges_description == 'true'): ?>
<span class="one-time"><?= TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION ?></span>
<?php endif; ?>
</div>
```
To:
```
<!--bof Product Price block -->
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php [B]if($products_quantity>0):[/B]
if($specials_price): ?>
<span class="base-price"><?= $products_base_price ?></span>
<span class="sale-price" itemprop="price"><?= $specials_price ?></span>
<?php else: ?>
<span class="sale-price" itemprop="price"><?= $products_base_price ?></span>
<?php endif;
[B]endif;[/B]?>
<?php if($show_onetime_charges_description == 'true'): ?>
<span class="one-time"><?= TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION ?></span>
<?php endif; ?>
</div>
```
This will prevent the display of the products price if the quantity of product remaining is 0 or less. This does not discriminate based on category.
If you want to only have this apply for product in a certain category, then change ```
if($products_quantity>0):
To:
if(!zen_product_in_category((int)$_GET['products_id'], 10)):
Where 10 should be changed to the category number of the sold category. Thus, product that do reach a 0 quantity while in another category will still reflect the price that existed, until the product is added to the "sold" category.
Problem that might exist with this is that the itemprop data will be missing for the price which might present an issue with the applicable price review "engine". Ie. May be considered incorrect data for the product. I'm not familiar with the requirements to say that it will be, just that it won't be presented.