Skip to content

Instantly share code, notes, and snippets.

@thebigtine
Last active June 23, 2021 14:20
Show Gist options
  • Save thebigtine/c82c0cc34eb4f1cc2a5de2ea483e5cd8 to your computer and use it in GitHub Desktop.
Save thebigtine/c82c0cc34eb4f1cc2a5de2ea483e5cd8 to your computer and use it in GitHub Desktop.
<?php
function after_buttons() {
echo '<a id="yacht_finanz_calc_button" href="#yacht_finanz_calc" class="btn btn-primary btn-lg btn-block anchor-scroll">Finanzierung</a>';
echo "<script>
jQuery('#yacht_finanz_calc_button').click(function() {
jQuery('.listing-accordion > .listing-details-grid').not( jQuery('#yacht_finanz_calc').next('.listing-details-grid') ).slideUp()
jQuery('#yacht_finanz_calc').next('.listing-details-grid').slideDown()
return false
});
</script>";
}
add_action( 'after_buttons', 'after_buttons', 10 );
<?php
function after_accordion( $manufacturer, $model, $year_built, $price ) {
echo '<h2 id="yacht_finanz_calc" class="listing-heading">Finanzierung<i class="fa fa-sort-down"></i></h2>';
echo '<div class="items grid grid-xl-3-items grid-lg-3-items grid-md-3-items listing-details-grid" style="display: none;">';
echo '<script type="text/javascript"><!--
modul_user = "Ribcenter";
detail_hersteller = "' . $manufacturer . '";
detail_modell = "' . $model . '";
detail_baujahr = "' . $year_built . '";
detail_kaufpreis = "' . trim( str_replace( ".", '', $price ) ) . '";
modul_sprache = "de";
modul_width = 1080
modul_height = 480
//--></script>
<link rel="stylesheet" href="https://www.yacht-finanz.de/sonstiges/warning.css" />
<noscript>
<div class="warning">
<span>Ihr JavaScript ist deaktiviert! Bitte aktivieren Sie JavaScript in Ihren Browser Einstellungen, damit Sie die Webseite voll nutzen können.</span>
</div>
<br /><br />
Bei aktiviertem JavaScript wird hier der Finanzierungsrechner von <a href="https://www.yacht-finanz.de" target="_blank">Yacht-Finanz</a> angezeigt.
</noscript>
<script src="https://www.yacht-finanz.de/sonstiges/calc_modul_value.js"></script>';
echo '</div>';
}
add_action( 'after_accordion', 'after_accordion', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment