How to Set Up Pages for DanDomain Classic

How to Set Up Pages for DanDomain Classic

  • updated 1 yr ago

In this guide, you can read and learn about how to set up the product Pages with the DanDomain Classic platform.

For an in-depth introduction to Pages then read this guide here.

For more about API documentation for Pages then check here.

There are three different methods for how to implementing and setting up Pages:

You can read about the different methods in their individual guide.


Set up of Pages for DanDomain Classic

This guide provides detailed instructions on how to effectively set up pages in DanDomain Classic.

Be aware that the Advanced Designer app from DanDomains is a necessary prerequisite to move forward with the subsequent procedures.

Installing the Hello Retail JavaScript with support for Pages

  1. Navigate to "Indstillinger -> Site" in your DanDomain Classic admin panel.
  2. Locate the webshop where you want to add the JavaScript and click on the small edit icon
     
  3. Add the following JavaScript Snippet - it should replace any previous Hello Retail JavaScript snippet you might have installed:
<script>
const url = window.location.href.split('?')[0] + "?rawjson=1";
fetch(url)
  .then(response => response.json())
  .then(data => {
    const productList = data.productList;
    if (productList) {
      const { settings } = productList;
      const div = $("REPLACE_WITH_ID_OF_THE_PAGES_DIV"); // Replace with your ID of the container
      if (settings.news !== "") {
        div.attr('data-filters', '{"extraData.isNew": true}');
      } else if (settings.specialoffer !== "") {
        div.attr('data-filters', '{"isOnSale": true}');
      } else if (settings.productCatID !== "") {
        div.attr('data-filters', `{"extraDataList.categoryIds": "${settings.productCatID}"}`);
      }
    }
    loadHR();
  });
</script>

<script async src="https://helloretailcdn.com/helloretail.js"></script>

<script>
function loadHR() {
    window.hrq = window.hrq || [];
    hrq.push(['init', {}]);
    hrq.push(function(sdk) {
        fetch("/shop/ajaxwrapper.asp?fc=getsessionvaluesJSON")
            .then((response) => response.json())
            .then((basketData) => {
                var total = basketData.basketTotalProductPriceWithoutVat + basketData.basketTotalVat;
                if (total > 0) {
                    var productNumbers = basketData.basket.map(function(p){
                        return p.productNumber.trim();
                    });
                    var quantities = basketData.basket.map(function(q){
                        return q.quantity;
                    });
                    var cartUrl = document.location.origin +
                        '/shop/showbasket.html?AddMultiple=1&ProductID=' +
                        productNumbers.join("|") +
                        '&Amount=' + quantities.join("|");
                    sdk.setCart({
                        total: total,
                        url: cartUrl,
                        productNumbers: productNumbers
                    });
            }
        });
    });
}
</script>

For REPLACE_WITH_ID_OF_THE_PAGES_DIV you need to replace it with the ID of the Div, which you can find under Pages configurations.

    4. Click “Gem”

 

Now we have to allow the partner script to use the category ids and detect what site we are on.

  1. Go to shopindstillinger -> Layout
  2. Tick off “Tillad Rss / rå XML visning”

 

To set the placement of the HTML-snippet, and thereby the content of the category or brand page, follow the steps below:

  1. Navigate to "Design" and select "Egne sider" from the options.
  2. Click on the product List
  3. After clicking on the ProductList, locate the "Kilde" button within the text editor.

 

Below is an example of a file with the Pages snippet inserted – you can find the div you need to insert under your Pages Configurations.

The design file on your end might look a bit different, depending on which customizations you have made to it.

Remember to save, and you are now done.

Like Follow
  • 1 yr agoLast active
  • 118Views
  • 1 Following