Post by paulewhite » Thu Mar 12, 2015 6:20 pm

Hi,

I have built a shop using OC 1.5.6.4 and my client has requested an additional feature (well, several, actually!).

He uses special prices for many items and these are shown in the correspondent page, as usual.

Some of these items however should not be displayed in this page because he does not consider them "specials", i.e. temporary: the special price does not have an expiry date.

Using discounts is not possible because the old price is not shown, only the new price.

I understand this need is based on the client's personal interpretation of what a "special" price is but before telling him "not possible!" I prefer to submit this matter to you, maybe someone has faced and solved a similar situation.

Thanks in advance for your attention.

Paolo

User avatar
New member

Posts

Joined
Tue Jul 02, 2013 3:42 pm
Location - Milano (Italy)

Post by paulewhite » Thu Mar 12, 2015 7:34 pm

Well, I have solved this myself so I will explain how.

First of all, I am using an extension called SHOW SPECIAL DATES to show the dates of start and/or end of a special price.

I have edited the following file: template/product/special.tpl adding a class and "if" condition as follows:

from:

Code: Select all

    <div class="product-list">
    <?php foreach ($products as $product) { ?>
    <div>
to:

Code: Select all

 <div class="product-list">
    <?php foreach ($products as $product) { ?>  
    <div style="<?php 
    	if($product['date_end'] === '0000-00-00') { 
        	echo "display:none;";
       	} ?>">

So if no special end date is set, the div is hidden.

The $product['date_end'] variable may be generated by the above-mentioned extension, I am not sure; in any case there may be a standard variable allowing this.

User avatar
New member

Posts

Joined
Tue Jul 02, 2013 3:42 pm
Location - Milano (Italy)
Who is online

Users browsing this forum: No registered users and 14 guests