Community Forums

Add percentage saved to specials

Put any free vQmod scripts here.
vQmod details

Add percentage saved to specials

Postby opencart-templates » Mon Jul 18, 2011 8:48 am

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>
User avatar
opencart-templates
 
Posts: 117
Joined: Mon May 16, 2011 6:24 am
Location: UK

Re: Add percentage saved to specials

Postby Xciso » Mon Nov 14, 2011 12:05 pm

Does this mod works for 1.5.1.3?
Xciso
 
Posts: 179
Joined: Thu Jul 14, 2011 4:20 pm

Re: Add percentage saved to specials

Postby aledmann » Mon Nov 21, 2011 8:45 am

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
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby Qphoria » Mon Nov 21, 2011 10:20 am

No need to edit the tpl, the value is being pushed as extension of the original price string
ImageImage
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 19154
Joined: Mon Jul 21, 2008 2:02 pm
Donate to Qphoria

Re: Add percentage saved to specials

Postby aledmann » Tue Nov 22, 2011 5:57 am

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 10:32 am, edited 4 times in total.
User avatar
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby aledmann » Thu Nov 24, 2011 10:32 am

Anyone? :joker:
User avatar
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby aledmann » Sat Nov 26, 2011 9:00 am

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
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby webvet » Thu Dec 01, 2011 12:54 pm

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
webvet_percentage_to_specials.xml
(1.14 KiB) Downloaded 127 times
Genuine, Honest Opencart Support @ http://webvetservices.com
User avatar
webvet
 
Posts: 295
Joined: Wed May 13, 2009 1:04 pm
Location: Shropshire, UK

Re: Add percentage saved to specials

Postby aledmann » Sat Dec 03, 2011 8:18 am

Not tried this yet but absolutely +1 to have it appear on the product page as well!! ;D ;D ;D
User avatar
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby webvet » Sat Dec 03, 2011 9:29 am

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
webvet
 
Posts: 295
Joined: Wed May 13, 2009 1:04 pm
Location: Shropshire, UK

Re: Add percentage saved to specials

Postby aledmann » Mon Dec 05, 2011 11: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
aledmann
 
Posts: 62
Joined: Thu Sep 08, 2011 8:56 am

Re: Add percentage saved to specials

Postby webvet » Mon Dec 05, 2011 12:03 pm

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
webvet
 
Posts: 295
Joined: Wed May 13, 2009 1:04 pm
Location: Shropshire, UK

Re: Add percentage saved to specials

Postby GoGo OpenCart » Mon Dec 05, 2011 5:10 pm

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
User avatar
GoGo OpenCart
 
Posts: 575
Joined: Mon Nov 14, 2011 10:30 am


Return to vQmods

Who is online

Users browsing this forum: No registered users and 4 guests

Hosted by Arvixe Web Hosting