Post by opencart-templates » Mon Jul 18, 2011 9:48 pm

Code: Select all

<file name="catalog/controller/module/special.php">
        <operation>
            <search position="before"><![CDATA[
            if ($this->config->get('config_review_status')) {
            ]]></search>
            <add><![CDATA[
			if ((float)$result['special']) {
				$saving_value = $result['price'] - $result['special'];
				$saving = round(($saving_value/$result['price'])*100, 0);
			} else {
				$saving = false;
			}
            ]]></add>
        </operation>
        <operation>
            <search position="after"><![CDATA[
            'name'    	 => $result['name'],
            ]]></search>
            <add><![CDATA[
			'saving' => $saving,
            ]]></add>
        </operation>
	</file>

Image Image Image Image
Advanced Professional Email Template


User avatar
Active Member

Posts

Joined
Mon May 16, 2011 7:24 pm
Location - UK

Post by Xciso » Tue Nov 15, 2011 1:05 am

Does this mod works for 1.5.1.3?

Active Member

Posts

Joined
Fri Jul 15, 2011 5:20 am

Post by aledmann » Mon Nov 21, 2011 9:45 pm

Seems like there's a step missing to me? Surely you'd need to edit the tpl file to match?

If we could get this working for 1.5x that would be amazing! I've wanted a "You save" for aaaaaaages!! :D

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by Qphoria » Mon Nov 21, 2011 11:20 pm

No need to edit the tpl, the value is being pushed as extension of the original price string

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by aledmann » Tue Nov 22, 2011 6:57 pm

So for us beginners who are keen to learn, am I right in thinking that for 1.5.x it goes a little something like this:

1) Open catalog/controller/module/special.php

2) Find

Code: Select all

if ($this->config->get('config_review_status')) {
3) Before it, add

Code: Select all

if ((float)$result['special']) {
$saving_value = $result['price'] - $result['special'];
$saving = round(($saving_value/$result['price'])*100, 0);
} else {
$saving = false;
}

4) In same file, find

Code: Select all

'name' => $result['name'],
5) After it, put

Code: Select all

'saving' => $saving,
If that's the case, I can't get it to work. ???
Last edited by aledmann on Thu Nov 24, 2011 11:32 pm, edited 4 times in total.

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by aledmann » Thu Nov 24, 2011 11:32 pm

Anyone? :joker:

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by aledmann » Sat Nov 26, 2011 10:00 pm

Bueller?...........Bueller?...........Bueller?...........

(Sorry, 80's gag!)

Reeeeeeeeeeeeeeeeeeally would love this on my site so if anyone can please help I'd be forever grateful. ;D

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by webvet » Fri Dec 02, 2011 1:54 am

Ok, here goes... be gentle with me ;)

I have installed vqmod today, and have viewed a few threads. Wanted to see if I can make this work and have had a go.

Not sure if it is doing the same as Fido-X's efforts with http://forum.opencart.com/viewtopic.php?f=131&t=39597 and if so then use his - he is a master at this sort of stuff, I am just learning. I will check his out in the next few days so this might be superfluous.

But here goes - works on my site - v1.5.1.2 so I would welcome any feedback from those who have said they wanted it.

WHAT IT DOES:
Displays percentage saved next to the original price and special price in the Specials Module.
Text can be styled (it is set to display in red font, but can easily be changed to underline, bold, other colours etc)
Text can be added to give 'Save x%' or 'x% OFF' - edited to remove comment as giving error!

TO DO:
Will get this to also show on the product page, if anyone interested

Attachments


Genuine, Honest Opencart Support @ http://webvetservices.com


User avatar
Active Member

Posts

Joined
Thu May 14, 2009 2:04 am
Location - Shropshire, UK

Post by aledmann » Sat Dec 03, 2011 9:18 pm

Not tried this yet but absolutely +1 to have it appear on the product page as well!! ;D ;D ;D

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by webvet » Sat Dec 03, 2011 10:29 pm

aledmann

let me know if you have any problems - am away for the weekend now, but will look at sorting the product page next week.

Genuine, Honest Opencart Support @ http://webvetservices.com


User avatar
Active Member

Posts

Joined
Thu May 14, 2009 2:04 am
Location - Shropshire, UK

Post by aledmann » Tue Dec 06, 2011 12:54 am

I should probably clarify that I don't want this as part of a discount, I want it as part of the specials tab. All I want is for it to work out and show what the saving is.

So currently when I set up a product I go to:

catalog/product/edit/price - and I enter a product price (say £3.99) I then go to the specials tab and enter a specials price of £1.49. This works great for sale price and RRP.

But I also want the specials to show the percentage save so it looks like this:

£1.49 RRP £3.99 You saved 50%

I hope that makes sense!

User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by webvet » Tue Dec 06, 2011 1:03 am

Which version of OC are you using?

I understand what you are asking - is that exactly how you want the price to show:

SPECIAL PRICE in bold then RRP in italics then 'You saved x%' in bold

and in that order?
It may be a bit specialised for everyones requirements, but if that is what you would like then I can pm or email it to you as should be able to do that. Other people might want the text to say 'x% OFF', some may not want RRP etc so might keep the xml file in the thread quite generic.

Just trying to make sure I get exactly what you want.

Genuine, Honest Opencart Support @ http://webvetservices.com


User avatar
Active Member

Posts

Joined
Thu May 14, 2009 2:04 am
Location - Shropshire, UK

Post by GoGo OpenCart » Tue Dec 06, 2011 6:10 am

Hello guys,

I've created such an extension, you can see it here:

http://www.opencart.com/index.php?route ... on_id=4023

Although, as it is, it puts You Save only at the products' page, by the request of some costumers, I've made it to be shown at the Featured products as well (you can read the comments). So, by request, I can make it to be shown in the Specials box as well ;)

Just after purchasing leave a comment at the extension's page by stating the OpenCart version you need Specials for, and when I make it, you'll receive it without any additional charges.



Image

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Active Member

Posts

Joined
Mon Nov 14, 2011 11:30 pm
Who is online

Users browsing this forum: No registered users and 8 guests