Add Custom Rules To Dealer Results
At times, you may want to customize certain results. For example, if you would like to only display rental providers and/or service centers or only display retail locations (or a combination). To do so, you can implement this optional parameter in a couple different ways.
Option 1: Add Rules Globally from the Buy Now Script Path
If you wish to add rules globally throughout the site (where ever Buy Now is used), you can do so with the following additional parameter to the Buy Now script path.
- <script id="omacro-widget-buynow" src="https://buynow.omacro.com/embedded/bn.loader.js?company=[OMACRO ID]&country=US&local=rental,retail,service"></script>
In the above example, we added the additional URL parameter "local" with a value of "rental,retail,service". The value must be comma separated (if more than one value is used), no spaces and all lower case. The above affect will only permit local results to show that have one of those attributes listed. Removing "retail" from the list will then only show rental providers and service centers. Current valid values are:
- rental
- retail
- service
Option 2: Add JavaScript to the Embedded Dealer Locator Script on Page
If you wish to add rules and are utilizing the embedded dealer locator script feature, you may add the following additional line to your embedded script. For more details about how to use an embedded locator, please visit:
Embedding Dealer Locator Within Website Page
Please note the addition of the omacro.buynow.widget.allow method, which accepts two parameters. A key and a list of values. In the below example, we use "local" as our key, and ['rental', 'service', 'retail'] as our values (but any combination will work).
- <script>
- document.body.addEventListener("loaded.omacro.buynow", function (e) {
- e.preventDefault();
- omacro.buynow.widget.allow('local', ['rental', 'service', 'retail']);
- omacro.buynow.widget.show('123456789', 'online', 'us');
- }, false)
- </script>
The value must be comma separated (if more than one value is used), encapsulated in quotes and all lower case. The above affect will only permit local results to show that have one of those attributes listed. Removing "retail" from the list will then only show rental providers and service centers. Current valid values are:
- rental
- retail
- service
Related Articles
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 ...
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 ...
Add Custom Page Size To Online Dealer Results
At times, you may want to customize the number of results that appear on the Online portion of the Buy Now popup. For example, if you would like to show more or less sellers per page (or all sellers with out paging controls). Option 1: Add Page Size ...
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. To see a live demonstration, ...
Managing Seller Relationships and Seller Visibility
To determine which sellers show in your Dealer Locator and or Online Locator, you can control each sellers visibility and determine if they show as a retail store on the map locator, service center on the map locator and or online location on the ...