Claudia M Posted March 6, 2019 Share Posted March 6, 2019 On the skin category page I would like to remove the $0.00 price (price info completely) when the item is sold or unavailable (for sale elsewhere ex. eBay) but keep information lined up as is. Thanks for any and all help in this. Link to comment Share on other sites More sharing options...
bsmither Posted March 6, 2019 Share Posted March 6, 2019 In the template content.category.php, find the HTML that shows the price. It will look similar to the following: <h3> {if $product.ctrl_sale}<span class="old_price">{$product.price}</span> <span class="sale_price">{$product.sale_price}</span> {else} {$product.price} {/if} </h3> There is another variable that can be used: the stock level {$product.available}. So, you can wrap the price inside an {if} block: {if $product.available} <h3> {if $product.ctrl_sale}<span class="old_price">{$product.price}</span> <span class="sale_price">{$product.sale_price}</span> {else} {$product.price} {/if} </h3> {/if} Be aware that there may be two or more places that show the price -- a responsive skin. There would be a list view and a grid view, and a maybe a mobile section. Link to comment Share on other sites More sharing options...
Claudia M Posted March 6, 2019 Author Share Posted March 6, 2019 I only use the grid view. Here is my custom code. Where do I make changes? Thanks Brian <div id="ccScroll"> <ul class="small-block-grid-2 medium-block-grid-3 large-block-grid-3 product_list" data-equalizer> {foreach from=$PRODUCTS item=product} <li> <form action="{$VAL_SELF}" method="post" class="panel add_to_basket"> <div class="product_grid_view"> <div data-equalizer-watch> <div class="text-center"> <a href="{$product.url}" title="{$product.name}"><img class="th" src="{$product.thumbnail}" alt="{$product.name}"></a> </div> <div class="pad-topbottom"><a href="{$product.url}" class="txt black nodecor" title="{$product.name}">{$product.name|truncate:65: "…"}</a></div> </div> <div class="med deep-red thinpad-bottom show-for-medium-up">Product Code: {$product.product_code}</div> {if $product.ctrl_sale}<span class="old_price">{$product.price}</span> <span class="sale_price">{$product.sale_price}</span> {else} <div class="pad-bottom txtmed bold"> {$product.price} {/if} <a class="right txt black" href="{$product.url}" title="{$product.name}" style="font-weight:normal">More Info</a></div> {if $product.available <= 0} <div class="row collapse marg-top"> <div class="small-12 columns"> <div class="buy_unavailable">See listing for details</div> </div> </div> {* ctrl_stock True when a product is considered 'in stock' for purposes of allowing a purchase, either by actually being in stock or via certain settings *} {elseif $product.ctrl_stock && !$CATALOGUE_MODE} <div class="row collapse marg-top"> <div class="small-12 columns "> <button type="submit" value="{$LANG.catalogue.add_to_basket}" class="button br4 expand">{$LANG.catalogue.add_to_basket}</button> <input type="hidden" name="add" value="{$product.product_id}"> </div> </div> {elseif !$CATALOGUE_MODE} <div class="row collapse marg-top"> <div class="small-12 columns"> <div class="buy_outofstock">SOLD</div> </div> </div> {/if} </div> </form> </li> Link to comment Share on other sites More sharing options...
bsmither Posted March 6, 2019 Share Posted March 6, 2019 You have this: {if $product.ctrl_sale}<span class="old_price">{$product.price}</span> <span class="sale_price">{$product.sale_price}</span> {else} <div class="pad-bottom txtmed bold"> {$product.price} {/if} <a class="right txt black" href="{$product.url}" title="{$product.name}" style="font-weight:normal">More Info</a></div> Change to: <div class="pad-bottom txtmed bold"> {if $product.available} {if $product.ctrl_sale}<span class="old_price">{$product.price}</span> <span class="sale_price">{$product.sale_price}</span> {else} {$product.price} {/if} {/if} <a class="right txt black" href="{$product.url}" title="{$product.name}" style="font-weight:normal">More Info</a></div> Link to comment Share on other sites More sharing options...
Claudia M Posted March 6, 2019 Author Share Posted March 6, 2019 Thank you so much Brian. This was one of those annoying gnats in your ear things LOL Link to comment Share on other sites More sharing options...
Claudia M Posted March 11, 2019 Author Share Posted March 11, 2019 Hey Brian, That worked if the item is unavailable (ie: listed on eBay etc.) But how do I NOT show the price ( or $0.00) if the item has sold? See the screenshot and my code earlier in this post. Link to comment Share on other sites More sharing options...
bsmither Posted March 11, 2019 Share Posted March 11, 2019 We need to know what makes $product.available be true in order to show the price. We also need to know about $product.ctrl_stock. It could simply be the setting at Add/Edit Product, General tab, "Available for purchase" checkbox. Are there too many products to go through each and uncheck this setting? What constitutes being SOLD? Is it Stock Level being zero or less? (As suggested by your code.) Is the setting "Use Stock Level" checked? So: {if $product.available and $product.ctrl_stock} Link to comment Share on other sites More sharing options...
Claudia M Posted March 11, 2019 Author Share Posted March 11, 2019 Hey Brian, If I use the code you gave me it works like I want. Thanks so much!! {if $product.available and $product.ctrl_stock} Link to comment Share on other sites More sharing options...
bsmither Posted August 24, 2019 Share Posted August 24, 2019 To maintain the spacing, change the new code above slightly: {else} {$product.price} {/if} {/if} To: {else} {$product.price} {/if} {else} {/if} Link to comment Share on other sites More sharing options...
Claudia M Posted August 24, 2019 Author Share Posted August 24, 2019 That fixed it!!! I nver would have figured that out. Thank you so much Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.