Post by fido-x » Sat Mar 28, 2009 8:53 am

I notice that a "Special Offers" page has now been included, along with "special price", "start date" and "end date" for the special price (I wonder where those ideas came from ;) ).

The special price is not displayed in the "Latest Products" function on the home page or in the "Best Sellers" module in the column.

The price in the "Latest Products" function on the home page can be fixed by changing line 17 in "catalog/view/theme/default/template/common/home.tpl" from:

Code: Select all

<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
to:

Code: Select all

<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
<?php } else { ?>
<span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span><br />
<span style="color: #F00;"><?php echo $products[$j]['special']; ?></span>
<?php } ?>
And in "catalog/view/theme/default/template/module/popular.tpl", change line 9 from:

Code: Select all

<span style="font-size: 11px; color: #900;"><?php echo $product['price']; ?></span></td>
to:

Code: Select all

<?php if (!$product['special']) { ?>
<span style="color: #900; font-weight: bold;"><?php echo $product['price']; ?></span><br />
<?php } else { ?>
<span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $product['price']; ?></span><br />
<span style="color: #F00;"><?php echo $product['special']; ?></span>
<?php } ?></td>

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Daniel » Sat Mar 28, 2009 9:12 am

Thanks for letting me know.

"I notice that a "Special Offers" page has now been included, along with "special price", "start date" and "end date" for the special price (I wonder where those ideas came from )."

Actually special price is a pretty common feature. Its in OSC. Also If you want I can show you an old sourceforge opencart download link with special prices. It was a really early v0.x version.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by fido-x » Sat Mar 28, 2009 9:46 am

Daniel wrote:Actually special price is a pretty common feature. Its in OSC. Also If you want I can show you an old sourceforge opencart download link with special prices. It was a really early v0.x version.
I wasn't making any accusations. To be perfectly honest, I quite like the way you've implemented it. Probably a better way of applying a special price than I did with my mod anyway.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sat Mar 28, 2009 10:20 am

fido-x wrote:I notice that a "Special Offers" page has now been included, along with "special price", "start date" and "end date" for the special price (I wonder where those ideas came from ;) ).
OpenCart Zero.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Sat Mar 28, 2009 10:29 am

Qphoria wrote:
fido-x wrote:I notice that a "Special Offers" page has now been included, along with "special price", "start date" and "end date" for the special price (I wonder where those ideas came from ;) ).
OpenCart Zero.
Actually, the mod that I did including a "sale price", "start date" and "end date" was done for OpenCart 1.x first, then back-ported to OpenCart Zero. ;D

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sat Mar 28, 2009 4:28 pm

yea, I'm aware of what you were getting at. Actually you said where'd the idea come from :) which would actually be every other e-commerce store :)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by MarkF » Sun Mar 29, 2009 9:05 am

Hi fido,

this isn't working for me - I get 'undefined variable product' in both Latest & Bestsellers?

Looks like there's a missing IF statement at the begining of the home.tpl change, but that doesn't work if made the same as the one in popular.tpl.

Thanks,
Mark :)

New member

Posts

Joined
Tue Mar 17, 2009 9:54 pm

Post by fido-x » Sun Mar 29, 2009 10:24 am

The code snippet above is only suitable for a default 1.2.5, and won't work with my "Featured/Special" mod (they haven't been updated yet).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by MarkF » Sun Mar 29, 2009 6:47 pm

Hi fido,

it's a fresh 1.2.5 installation - no contribs added.

Tried again this morning and I still get the error...?

Thanks,
Mark :)

New member

Posts

Joined
Tue Mar 17, 2009 9:54 pm

Post by fido-x » Sun Mar 29, 2009 9:31 pm

Sorry about that. I missed an if() statement at the beginning of the block of code in the home.tpl, and forgot about the code to be placed in the controllers.

Replace line 17 in "catalog/view/theme/default/template/common/home.tpl" with:

Code: Select all

<?php if (!$products[$j]['special']) { ?>
<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
<?php } else { ?>
<span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span><br />
<span style="color: #F00;"><?php echo $products[$j]['special']; ?></span>
<?php } ?>
In both "catalog/controller/common/home.php" and "catalog/controller/module/popular.php" insert the following:

Code: Select all

$special = $this->model_catalog_product->getProductSpecial($result['product_id']);
if ($special) {
	$special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax')));
} else {
	$special = FALSE;
}
below

Code: Select all

$rating = $this->model_catalog_review->getAverageRating($result['product_id']);
Then in the following products array ($this->data['products][] -- in both files) insert

Code: Select all

'special' => $special,
below

Code: Select all

'price'  => $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))),

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by MarkF » Sun Mar 29, 2009 10:55 pm

Thanks fido - that work's a treat! 8)

Regards
Mark :)

New member

Posts

Joined
Tue Mar 17, 2009 9:54 pm

Post by junkazama » Sun May 13, 2012 8:56 am

I have OpenCart 1.5.2.1. I'm not sure how this happened but I noticed recently that featured products isn't displaying the price and special price properly. The price is not in Bold and for the special price, there is no line through the old price. (e.g. it shows as $100.00 $80.00) If I open the actual product, it shows correctly and everywhere else it shows properly. I'm not sure where I need to be looking to correct this.

Newbie

Posts

Joined
Mon Apr 30, 2012 7:26 pm
Who is online

Users browsing this forum: No registered users and 44 guests