This is your Omacro supplied company identifier. This ID was assigned when your company account was originally created which will never change. The snippet example above already includes your company identifier.
This is a two digit ISO country code ISO 3166-1 alpha-2 code or auto. If not supplied a map will be presented to allow the user to select their country. When provided and not set to auto the user is immediately presented results for the specified country. When set to auto the country will be automatically determined by the users IP Address.
When true the snippet will verify that that each product identifiers available on the page is valid and returns a product. Once validation is complete the snippet will add the respective CSS class to the trigger element: obn-validate-pass or obn-validate-fail. While validation is pending the trigger element will have the CSS class obn-validate-pending.
When true the snippet will assist with debugging by logging all activity and notifications to your browser console. It's recommended to disable this feature once debugging is complete.
Step 1: To trigger the popup window, we'll first need to modify our script path in Step 1 and add an additional parameter called "mode" with a value of "distributor". See example below:
- <script id="omacro-widget-buynow" src="https://buynow.omacro.com/embedded/bn.loader.js?company=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&country=auto&validate=false&debug=false&mode=distributor" async></script>
Step 1: Assign trigger to buttons.
The example below demonstrates a simple anchor tag (link) being used as a button trigger. You can easily use existing, or new elements, on your website by simply adding the required parameter.
- <a href="#obn" data-product="*">Find A Distributor</a>
Trigger parameters take priority over snippet parameters, this allows for parameters to be set globally with exceptions if needed. All trigger parameters are HTML data attributes which require they start with 'data-'.
product requiredThis is the product identifier and should be set to "*".
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 PageAdd 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 Distributor Locator script. This script loads the widget once page loads rather than via a button click.
- <script>
- document.body.addEventListener("loaded.omacro.buynow", function (e) {
- e.preventDefault();
- omacro.buynow.widget.showDistributors();
- }, false)
- </script>
Step 3 : Add Cascading Style Sheet to the PageAdd the following CSS (modify as needed) to adjust the style of the Distributor Locator 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>