Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<script>
$(document).ready(function () {
  $(this).find('.unit-price-wrapper').after('<div class = "vdp-misc-element-wrapper">{PLACE ELEMENT HERE}</div>')
});
</script>

Add Phone Number to SRP (Template v2)

A single phone number can be added to each vehicle listing on SRPs by adding this script to the domain node’s footer section. You will need to replace any spot with “+ phone +” with the appropriate phone number in the script.

Code Block
<script>
$(document).ready(function () {
        $('.unit-list .unit').each(function () {
            var phone =  $(this).find('.detailsContainer').data('phone')
            $(this).find('.unit-price-wrapper').after('<div class = "listing-phone-link"><a href = "tel:' + phone + '">Call Today! ' + phone + '</a></div>')
        });
        //lazy/AJAX loaded listing page units
        $('.ajax-unit-list').on('unit-loaded', function (e, unit) {
            var phone =  $(unit).find('.detailsContainer').data('phone')
            $(unit).find('.unit-price-wrapper').after('<div class = "listing-phone-link"><a href = "tel:' + phone + '">Call Today! ' + phone + '</a></div>')
        });

    });
</script>

Add Phone Number to VDP (Template v2)

This script can be placed in the footer scripts area on the site’s dynamic-inventory-detail page.

...

It is also possible to add this on a multi-location site and have the number change depending on the lot of the unit. More on that coming soon!

Add Phone Number to SRP (Template v1)

Place this script in the footer scripts area on the site’s domain node.

Code Block
<!-- Add Phone Number to SRP Listings for V1 Template -->
<script>
$(document).ready(function () {
        $('.unit-list .unit').each(function () {
            var phone =  $(this).find('.detailsContainer').data('phone')
            $(this).find('.unitPricing').after('<div class = "listing-phone-link text-center"><a href = "tel:' + phone + '">Call Today! ' + phone + '</a></div>')
        });
        //lazy/AJAX loaded listing page units
        $('.ajax-unit-list').on('unit-loaded', function (e, unit) {
            var phone =  $(unit).find('.detailsContainer').data('phone')
            $(unit).find('.unitPricing').after('<div class = "listing-phone-link text-center"><a href = "tel:' + phone + '">Call Today! ' + phone + '</a></div>')
        });
    });
</script>

Add Phone Number to VDP (Template v1)

This script can be placed in the footer scripts area on the site’s dynamic-inventory-detail page.

Code Block
<!-- Add Phone Number to VDP for V1 Template -->
<script>
$(document).ready(function () {
  var phone =  $('.DetailPanel ').data('phone')
  $(this).find('.detailPricing').after('<div class = "listing-phone-link text-center" style = "margin: 15px auto;"><a href = "tel:' + phone + '">Call Today! ' + phone + '</a></div>')
});
</script>