I use Normans 'YouSave' scripting:
https://community.sellerdeck.com/for...-results-v18-1
But have recently found that whilst it works on both Smart and Swift on Product Pages, on Search Results the scripting works in Swift but not now in Smart
Both sites have identical code:
Added to JS Header Functions:
Added to Product Page Product Layout:
Added to both Standard Price Layout and Dynamic Price Layouts:
Added to Standard Search Result for image:
and Added to Standard Search Result for price:
Go to: https://www.gpxdev.co.uk/SwiftV2_Sli...t-Ring-47.html and https://www.gpxdev.co.uk/rrpsmart/acatalog/Engagement-Ring-47.html and in both Swift and Smart the YouSave image box and price suffix is displayed.
Inspect element and you get this:
Now from the Home Page search for 'ring' in both.
In https://www.gpxdev.co.uk/SwiftV2_Sli...=&ACTION=Go%21 (Swift)
The YouSave stuff is displayed:
Inspect element and you get this:
However in Smart: https://www.gpxdev.co.uk/rrpsmart/cg...O&ACTION=Go%21
The YouSave stuff is not displayed and inspect element and you get this:
I have added this to the Header Function code to show the javascript is executing and it is (Shows 'ready!' in console.)
Also Console shows nothing.
Something is stopping
executing in the search results page in Smart but not in Swift
I am at a complete loss. Please can anyone see the wood for the trees?
Thank you
https://community.sellerdeck.com/for...-results-v18-1
But have recently found that whilst it works on both Smart and Swift on Product Pages, on Search Results the scripting works in Swift but not now in Smart
Both sites have identical code:
Added to JS Header Functions:
Code:
<script type="text/javascript"> function setrrp(){ $( "span.sryousave" ).each(function(){ var rrp = $(this).attr('data-rrp') - 0; var rawprice = $(this).attr('data-rawprice') / $(this).attr('data-scale'); if ( (rrp > 0) && (rawprice > 0) && (rrp > rawprice) ) { var saving = (rrp - rawprice).toFixed(2); $(this).html('<h5 class="rrp">RRP £' + rrp.toFixed(2) + ' You save £' + saving + '</h5>'); } }); $( "span.sryousavepc" ).each(function(){ var rrp = $(this).attr('data-rrp') - 0; var rawprice = $(this).attr('data-rawprice') / $(this).attr('data-scale'); if ( (rrp > 0) && (rawprice > 0) && (rrp > rawprice) ) { var savingsrpc = (((rrp - rawprice) / rrp) * 100).toFixed(0); $(this).html('<h5 class="rrp">RRP £' + rrp.toFixed(2) + ' You save' + savingsrpc + '%</h5>'); } }); $( "span.rrpsplash" ).each(function(){ var rrp = $(this).attr('data-rrp') - 0; var rawprice = $(this).attr('data-rawprice') / $(this).attr('data-scale'); if ( (rrp > 0) && (rawprice > 0) && (rrp > rawprice) ) { var saving = (rrp - rawprice).toFixed(0); $(this).html('Save<br />£' + saving); } }); $( "span.rrpsplashpc" ).each(function(){ var rrp = $(this).attr('data-rrp') - 0; var rawprice = $(this).attr('data-rawprice') / $(this).attr('data-scale'); if ( (rrp > 0) && (rawprice > 0) && (rrp > rawprice) ) { var savingpc = (((rrp - rawprice) / rrp) * 100).toFixed(0); $(this).html('Save<br />' + savingpc + '%'); } }); } // deal with RRP on Search Results and Product Layouts $(document).ready(function(){setrrp();}); // deal with RRP on filtered pages var oldHideLoadingDialog = HideLoadingDialog; // save SD routine that runs after filtering finishes HideLoadingDialog = function(){ oldHideLoadingDialog(); // execute SD routine setrrp(); // and display any RRP's } </script>
Added to Product Page Product Layout:
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%21%3d%20%22%22%20AND%20%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%21%3d%200%20and%20%3cactinic%3avariable%20name%3d%22RRPShowSaveSplash%22%20%2f%3e" ><Actinic:NOTINB2B><span class="rrpsplash" data-rrp="<actinic:variable name="RRP" />" data-rawprice="<actinic:variable name="ProductPriceRaw" />" data-scale="1"> </span> </Actinic:NOTINB2B><Actinic:NOTINB2B><div style="display:none;position:relative;"></Actinic:NOTINB2B><span class="rrpsplashpc" data-rrp="<actinic:variable name="RRP" />" data-rawprice="<actinic:variable name="ProductPriceRaw" />" data-scale="1"> </span><Actinic:NOTINB2B></div></Actinic:NOTINB2B></actinic:block>
Code:
<actinic:block if="%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%21%3d%20%22%22%20AND%20%3cactinic%3avariable%20name%3d%22RRP%22%20%2f%3e%20%21%3d%200"> <Actinic:NOTINB2B><span class="sryousave" data-rrp="<actinic:variable name="RRP" />" data-rawprice="<actinic:variable name="ProductPriceRaw" />" data-scale="1"> </span> </Actinic:NOTINB2B><Actinic:NOTINB2B><div style="display:none;position:relative;"></Actinic:NOTINB2B><span class="sryousavepc" data-rrp="<actinic:variable name="RRP" />" data-rawprice="<actinic:variable name="ProductPriceRaw" />" data-scale="1"> </span><Actinic:NOTINB2B></div></Actinic:NOTINB2B> </actinic:block>
Code:
<span class="rrpsplash" data-rrp="<actinic:variable searchresultvariable="true" name="RRP" />" data-rawprice="<actinic:variable name="SearchResultProductPriceRaw" />" data-scale="100"> </span> </Actinic:NOTINB2B><Actinic:NOTINB2B><div style="display:none;position:relative;"></Actinic:NOTINB2B> <span class="rrpsplashpc" data-rrp="<actinic:variable searchresultvariable="true" name="RRP" />" data-rawprice="<actinic:variable name="SearchResultProductPriceRaw" />" data-scale="100"> </span><Actinic:NOTINB2B></div></Actinic:NOTINB2B>
Code:
<p class="text-center"> <Actinic:NOTINB2B> <span class="sryousave" data-rrp="<actinic:variable searchresultvariable="true" name="RRP" />" data-rawprice="<actinic:variable name="SearchResultProductPriceRaw" />" data-scale="100"> </span> </Actinic:NOTINB2B><Actinic:NOTINB2B><div style="display:none;position:relative;"></Actinic:NOTINB2B> <span class="sryousavepc" data-rrp="<actinic:variable searchresultvariable="true" name="RRP" />" data-rawprice="<actinic:variable name="SearchResultProductPriceRaw" />" data-scale="100"> </span><Actinic:NOTINB2B></div></Actinic:NOTINB2B> </p>
Inspect element and you get this:
Code:
<span class="sryousave" data-rrp="259.99" data-rawprice="240" data-scale="1"><h5 class="rrp">RRP £259.99 You save £19.99</h5></span>
In https://www.gpxdev.co.uk/SwiftV2_Sli...=&ACTION=Go%21 (Swift)
The YouSave stuff is displayed:
Inspect element and you get this:
Code:
<p class="text-center"> <actinic:notinb2b><span class="sryousave" data-rrp="144" data-rawprice="10833" data-scale="100"><h5 class="rrp">RRP £144.00 You save £35.67</h5></span> </actinic:notinb2b><actinic:notinb2b></actinic:notinb2b></p>
The YouSave stuff is not displayed and inspect element and you get this:
Code:
<p class="text-center"> <span class="sryousave" data-rrp="259.99" data-rawprice="28800" data-scale="100"> </span> </p>
Code:
// Shorthand for $( document ).ready() $(function() { console.log( "ready!" ); });
Something is stopping
Code:
$(this).html
I am at a complete loss. Please can anyone see the wood for the trees?
Thank you
Comment