We have 2 customer groups on a trade site - UK and Europe - which requires log-in to access the price.
Depending on which group you are assigned to is it possible using this plug-in to show only their currency IE: if UK only show Sterling and if European only show Euro price
SellerDeck v11
Customer Accounts dependent formatting
Re: Customer Accounts dependent formatting
NorPrice may not be the best way of doing this. NorPrice doesn't have any alternative price available until someone chooses to select it. Plus it's designed to display the base currency and the additional one alongside it (once selected). Although it probably could be tweaked to do what you want (or close to it), significant custom work would be needed.
Since SD has a fixed second currency like the Euro built-in it may be possible to use that and some BlockIf's to display one or the other.
Since SD has a fixed second currency like the Euro built-in it may be possible to use that and some BlockIf's to display one or the other.
Norman
Re: Customer Accounts dependent formatting
Thanks Norman.
I have played around with the Actinic:ShowPriceSchedule but splitting the £/E display accordingly is proving troublesome. Will keep on playing.
I have played around with the Actinic:ShowPriceSchedule but splitting the £/E display accordingly is proving troublesome. Will keep on playing.
Re: Customer Accounts dependent formatting
Here's a jQuery based way.
It assumes you've already got jQuery loaded and are using Euro prices with the format e.g. £1.00 / €1.23.
Add the following to the bottom of layout Standard JavaScript Header Functions:
The code above looks for all stuff with classes product-price, cart, cartheading, checkout-cartheading.
It then removes either all £n,nnn.nn / or \ €n,nnn.nn depending on whether whether Schedule Price 2 is set or not.
You can add other classes to the list but test carefully. Don't use sweeping classes that contain lots of HTML. Try to keep the code within such classes concise.
The Cart Summary code needs tweaked too.
Replace the contents of layout Regular Shopping Cart Summary with:
If you're using SD2013 and use Dynamic Prices, then you can fix these too.
Edit file dynamic.js (in your Site folder) and look for the line:
Replace it with:
It assumes you've already got jQuery loaded and are using Euro prices with the format e.g. £1.00 / €1.23.
Add the following to the bottom of layout Standard JavaScript Header Functions:
Code: Select all
<script type="text/javascript">var showaltprice = false;</script>
<Actinic:SHOWFORPRICESCHEDULE Schedules="2" HTML="<script>showaltprice = true;</script>"/>
<script type="text/javascript">
var patterntoremove = showaltprice ? /£[\d\.,]+( \/ | \/ )/g : /( \/ | \/ )€[\d\.,]+/g;
$(document).ready(function(){
$('.product-price, .cart, .cartheading, .checkout-cartheading').each(function(){
$(this).html($(this).html().replace(patterntoremove, ''));
});
});
</script>
It then removes either all £n,nnn.nn / or \ €n,nnn.nn depending on whether whether Schedule Price 2 is set or not.
You can add other classes to the list but test carefully. Don't use sweeping classes that contain lots of HTML. Try to keep the code within such classes concise.
The Cart Summary code needs tweaked too.
Replace the contents of layout Regular Shopping Cart Summary with:
Code: Select all
<div class="cart-summary">
<!-- shopping cart summary -->
<div>
<script language="javascript" type="text/javascript">
<!--
var summarypatterntoremove = showaltprice ? /£(.|,|\d)+ / / : / / €(.|,|\d)+/;
if (getCartItem(3) == 0) {
document.write('No Items');
}
if (getCartItem(3) == 1) {
document.write(getCartItem(3) + 'Item | ' + getCartItem(1).replace(summarypatterntoremove, ''));
}
if (getCartItem(3) > 1) {
document.write(getCartItem(3) + 'Items | ' + getCartItem(1).replace(summarypatterntoremove, ''));
}
// -->
</script>
</div>
<a href="<actinic:variable name="CartLinkText" />" onclick="AppendParentSection(this)"><actinic:variable name="CartText" /></a> |
<a href="<actinic:variable name="OrderLinkText" />" onclick="AppendParentSection(this)"><actinic:variable name="CheckOutText" /></a>
</div>
Edit file dynamic.js (in your Site folder) and look for the line:
Code: Select all
return Sprintf(g_oConfig.sPriceFmt, arrPrices[0], arrPrices[1]);
Code: Select all
return (showaltprice ? arrPrices[1] : arrPrices[0]);
Norman
Re: Customer Accounts dependent formatting
And here's a CSS way (no jQuery needed):
Replace layout Product Price Including Tax with:
If using Tax Exclusive Prices, then replace layout Product Price Excluding Tax with:
Add the following to the bottom of layout Standard JavaScript Header Functions:
The above hides code with class altcurr unless Schedule Price 2 is set. In which case it hides class maincurr instead.
Note that I've only tested this with normal customers as I don't have a B2B type site handy.
Replace layout Product Price Including Tax with:
Code: Select all
<span class="maincurr"><actinic:variable name="TaxInclusivePrice" selectable="false" /> <span class="altcurr"><actinic:variable name="TaxInclusivePriceAlt" selectable="false" /></span>
Code: Select all
<span class="maincurr"><actinic:variable name="TaxExclusivePrice" selectable="false" /> <span class="altcurr"><actinic:variable name="TaxExclusivePriceAlt" selectable="false" /></span>
Code: Select all
<style>.altcurr {display: none;}</style>
<Actinic:SHOWFORPRICESCHEDULE Schedules="2" HTML="<style>.maincurr {display: none;} .altcurr {display:block;}</style>" />
Note that I've only tested this with normal customers as I don't have a B2B type site handy.
Norman
Re: Customer Accounts dependent formatting
UPDATE: Created a customer account and found that while the CSS route above does get rid of the Euro price on normal pages, it doesn't fix the logged-in ones. That looks much more complicated.
Norman
Re: Customer Accounts dependent formatting
I've re-done my Here's a jQuery based way... above. It now needs no Layout tweaks, just a bit of JavaScript.
Seems to work everywhere but the Cart Summary.
Use with caution.
Seems to work everywhere but the Cart Summary.
Use with caution.
Norman