Embedding Dealer Locator Within Website Page
You can embed the locator directly on to a page. Assuming you have gone through the steps of adding omacro's buy now code snippets to your page, use the following example to render the locator within the page itself.
An example of a dedicated Dealer Locator with custom styles.
Step 1: Add CSS Class to the Page
Ensure you have an element on the page with the class name of "oma-omacro".
- <div class="oma-omacro"></div>
Step 2: Add JavaScript to the Page
Add the following script to the page anywhere below the HTML element mentioned in Step 1. The script is designed to trigger the render function within the Buy Now script. This script loads the widget once page loads rather than via a button click.
The magic occurs within the omacro.buynow.widget.show() function. This function accepts several parameters:
- Product Identifier required - "*" (for generic dealer locator) or SKU or Omacro Product ID (SKU preferred)
- Market Tab - Value can be either "online" or "local" and specifies the tab to market to show immediately.
- 2-Character ISO Country Code - "us", "ca", "au", etc.
General Dealer Locator Example
- <script>
- document.body.addEventListener("loaded.omacro.buynow", function (e) {
- e.preventDefault();
- omacro.buynow.widget.show('*', 'local', 'us');
- }, false)
- </script>
Product Based Dealer Locator Example
- <script>
- document.body.addEventListener("loaded.omacro.buynow", function (e) {
- e.preventDefault();
- omacro.buynow.widget.show('LA12345', 'online', 'ca');
- }, false)
- </script>
Step 3 : Add Cascading Style Sheet to the Page
Add the following CSS (modify as needed) to adjust the style of the Buy Now content so that it properly renders within the page document.
- <style type="text/css">
- body.oma-modal-in {
- overflow: auto !important;
- }
- .oma-omacro .oma-buynow {
- opacity: 1 !important;
- display: block !important;
- position: relative !important;
- top: auto !important;
- right: auto !important;
- bottom: auto !important;
- left: auto !important;
- }
- .oma-omacro .oma-buynow .oma-dialog {
- transform: none !important;
- transition: none !important;
- left: auto !important;
- margin-right: auto !important;
- margin-left: auto !important;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content {
- box-shadow: none !important;
- background-color: transparent;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-header .oma-title {
- display: none;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-close {
- display: none;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs {
- border-bottom-color: #ddd;
- background-color: transparent;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li>a {
- color: #337ab7;
- background-color: transparent;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li>a:focus,
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li>a:hover {
- text-decoration: none;
- background-color: #eee;
- border-color: #eee #eee #ddd;
- }
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li.oma-active>a,
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li.oma-active>a:focus,
- .oma-omacro .oma-buynow .oma-dialog .oma-content .oma-tabs>li.oma-active>a:hover {
- color: #555;
- cursor: default;
- background-color: #fff;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
- }
- .oma-omacro .oma-buynow .oma-footer {
- border-top-color: transparent;
- background-color: transparent;
- }
- .oma-omacro .oma-backdrop {
- display: none !important;
- }
- </style>
Related Articles
General Dealer Locator Website Code Implementation
omacro has two main types of locator options, this section will refer to setting up the code on your website front-end for the General Locator. This locator produces general dealer results that are not connected to a product. For example online ...
Product Based Dealer Locator Website Code Implementation
Step 1: Include script within website The example below demonstrates what's needed to integrate the Buy Now widget with your site. Simply update desired parameters then copy the snippet into your website. <script id="omacro-widget-buynow" ...
Distributor Locator Website Code Implementation
Step 1: Include script within website The example below demonstrates what's needed to integrate the Distributor Locator widget with your site. Simply update desired parameters then copy the snippet into your website. <script id="omacro-widget-buynow" ...
Initial Onboarding of Sellers
To aid and expedite your initial implementation, please provide a list of sellers have attached the above mentioned Excel template. We will use to do the import of all of your sellers. Please note, in the event you are on-boarding multiple omacro ...
Adding Custom Branded Seller Landing Pages For General Dealer Locator
omacro's General Dealer Locator will produce non-product specific dealer listing results. This function allows you to show Sellers and send customers to the Seller's custom branded landing page that contains just your products and or your brand's ...