Completely replacing original price with alt price?
-
- Posts: 25
- Joined: Wed May 28, 2008 5:30 pm
Completely replacing original price with alt price?
Hi Norman
I have a customer who doesn't want to show the old price at all when customers choose to see the new alt price. Is there a way to completely replace it? Or hide the original with CSS? it would also require removing the brackets from around the alt price.
Thanks
Chris DIcken
I have a customer who doesn't want to show the old price at all when customers choose to see the new alt price. Is there a way to completely replace it? Or hide the original with CSS? it would also require removing the brackets from around the alt price.
Thanks
Chris DIcken
Re: Completely replacing original price with alt price?
The prices on the Product layouts shouldn't be too hard. Try this:
Edit norpricesupport.js (in your Site folder - back it up first).
Replace line:
With:
Replace line:
With:
Replace line:
With:
The Cart needs ActinicOrder.pm tweaked (in your Site folder - back it up first). Try this:
Replace line:
With:
Replace line:
With:
Minor quirk is that the Cart Summary will only update when a Perl based page is called.
Edit norpricesupport.js (in your Site folder - back it up first).
Replace line:
Code: Select all
return prefix + ' (' + optplus + CommaFormatted(Math.round(altprice)) + ' ' + isoname + ')' + suffix;
Code: Select all
return prefix + ' ' + optplus + CommaFormatted(Math.round(altprice)) + ' ' + isoname + '' + suffix;
Code: Select all
return prefix + ' (' + optplus + CommaFormatted(altprice.toFixed(2)) + ' ' + isoname + ')' + suffix;
Code: Select all
return prefix + ' ' + optplus + CommaFormatted(altprice.toFixed(2)) + ' ' + isoname + '' + suffix;
Code: Select all
return val[1] + val[2] + val[3] + getalt(thisval, formatted) + val[4]; // return potentially converted text
Code: Select all
return val[1] + getalt(thisval, formatted) + val[4]; // return potentially converted text
Replace line:
Code: Select all
$sFormattedPrice .= ' (' . CommaFormatted(int($nNorprice + .5 * ($nNorprice <=> 0))) . " $iso)";
Code: Select all
$sFormattedPrice = CommaFormatted(int($nNorprice + .5 * ($nNorprice <=> 0))) . " $iso";
Code: Select all
$sFormattedPrice .= ' (' . CommaFormatted(sprintf("%1.2f", $nNorprice)) . " $iso)";
Code: Select all
$sFormattedPrice = CommaFormatted(sprintf("%1.2f", $nNorprice)) . " $iso";
Norman
-
- Posts: 25
- Joined: Wed May 28, 2008 5:30 pm
Re: Completely replacing original price with alt price?
Thanks so much for the help Norman.
This works great in the store pages, but unfortunately in the basket the prices both appear and are just run together like this:
£44.5071.42 USD
Any suggestions gratefully received!
Thanks
Chris Dicken
This works great in the store pages, but unfortunately in the basket the prices both appear and are just run together like this:
£44.5071.42 USD
Any suggestions gratefully received!
Thanks
Chris Dicken
Re: Completely replacing original price with alt price?
Apologies. Typo in the very last Replace / With, above.
Now corrected. Redo that last line.
Now corrected. Redo that last line.
Norman
-
- Posts: 25
- Joined: Wed May 28, 2008 5:30 pm
Re: Completely replacing original price with alt price?
Hi Norman
Having upgraded to v5 of NorPrice, we've only just realised the prices in the cart and checkout at http://www.anythinglefthanded.co.uk/ no longer update and show the changed currency.
I'm guessing the JavaScript change (to hide the original price) doesn't affect the cart and checkout. Any suggestions of what changes need to me made to a 14.0.3 perl script to make it all happen?
Thanks
Chris Dicken
Having upgraded to v5 of NorPrice, we've only just realised the prices in the cart and checkout at http://www.anythinglefthanded.co.uk/ no longer update and show the changed currency.
I'm guessing the JavaScript change (to hide the original price) doesn't affect the cart and checkout. Any suggestions of what changes need to me made to a 14.0.3 perl script to make it all happen?
Thanks
Chris Dicken
Re: Completely replacing original price with alt price?
Confused. You mention NorPrice V5 (which I sent you in January 2015) but seem to be using NorPrice V4.
Norman
-
- Posts: 25
- Joined: Wed May 28, 2008 5:30 pm
Re: Completely replacing original price with alt price?
A HA - that explains one of my issues! I'll set up a test site and upgrade the plugin to v5 and see how I get on.
I assume that I can make the same change as mentioned before to the js file to hide the original price?
I assume that I can make the same change as mentioned before to the js file to hide the original price?
Re: Completely replacing original price with alt price?
Hi, Chris
NorPrice V5 doesn't need any patched Perl scripts and should be able to convert all prices that are displayed on all types of pages. Basically it scans the DOM for snippets of text that look like prices and adds the extra currency after them if a match is found.
NorPrice V5 is significantly different in operation so new changes are needed. Try using the attached file after upgrading to V5. Note that it must be saved as "norpricesupport.js" to work properly.
It may be worth renaming the original norpricesupport.js and using WinMerge to compare them to see what the changes are.
NorPrice V5 doesn't need any patched Perl scripts and should be able to convert all prices that are displayed on all types of pages. Basically it scans the DOM for snippets of text that look like prices and adds the extra currency after them if a match is found.
NorPrice V5 is significantly different in operation so new changes are needed. Try using the attached file after upgrading to V5. Note that it must be saved as "norpricesupport.js" to work properly.
It may be worth renaming the original norpricesupport.js and using WinMerge to compare them to see what the changes are.
- Attachments
-
- norpricesupport-HideHomeCurrencyIfNorPriceInUse.zip
- (4.49 KiB) Downloaded 919 times
Norman
-
- Posts: 25
- Joined: Wed May 28, 2008 5:30 pm
Re: Completely replacing original price with alt price?
Thanks Norman - that's excellent