Related Products, Up-sells, Cross-sells in WooCommerce, Shopify, Magento

When you are building your website, it’s important to be mindful of how visitors will navigate through the site. If your customer visits a product, we should show other related products. For example:

  • Fashion & clothing stores – Upsell a gift packaging which you can easily wrap yourself. For example a gift wrap
  • Gadgets & tech stores – Upsell an extended warranty for your (selected) products
  • Adult, cannabis, weed & marijuana stores – Upsell a private and smell proof packaging
  • Services & SaaS stores – Upsell access to premium customer service

Product pages can present unique opportunities and challenges in this context. While the main focus is on the product itself, there’s also an opportunity to display, and cross-sell complementary products.

In this post, we will be looking at the different ways developers can build “smart” options for recommending related products. I’ll also show you how to create a section that displays related products by tag, which will empower your clients to personalize each one of their product pages.

WooCommerce Related Products

In WooCommerce, Product Related could be config in three different ways: Up-sells, Cross-sells and Related by categories, tags.

To add an up-sell or cross-sell to a product:

  1. Go to WooCommerce > Products and select the product on which you’d like to show an up-sell or cross-sell.
  2. Scroll down to the Product Data panel.
  3. Select the Linked Products tab on the left menu.
  4. Add the product you wish to link to by searching for it.
  5. Update.

WooCommerce hide related products

If you want woocommerce disable related products or woocommerce hide related products you just do following:

  1. Go to WooCommerce > Products and select the product on which you’d like to show an up-sell or cross-sell.
  2. Scroll down to the Product Data panel.
  3. Select the Linked Products tab on the left menu.
  4. Remove the product you wish to hide.
  5. Update.

Setup Magento crosssell, magento upsell, magento Related Products

You can setup Magento crosssell, upsell, related products by defining the nature of the relationship between the products

Magento upsell

Up-sell products are items that are similar, but are perhaps of a higher-quality, more popular, or have a better profit margin than the item the customer is considering.

Up-sell products are items that your customer might prefer instead of the product currently considered. An item offered as an up-sell might be of a higher quality, more popular, or have better profit margin. Up-sell products appear on the product page under a heading such as, “You may also be interested in the following product(s).”

To add up-sell product on Magento you need do following steps:

  1. Go to Admin > Products
  2. Open the product in edit mode
  3. Scroll to the section “Related Products, Up-Sells, and Cross-Sells”
  4. Click to Add Up-Sell Products
  5. Use filter to select the products that you want.
  6. Add Selected Products

magento related products

 

Magento crosssell

Magento Cross-sell products are offered on the shopping cart page as last-minute purchases before the checkout process begins. Cross-sell items are similar to impulse purchases positioned next to the cash register in the checkout line. Products offered as a cross-sell appear on the shopping cart page, just before the customer begins the checkout process.

To add cross-sell product on Magento you need do following steps: (Just similar add the upsells)

  1. Go to Admin > Products
  2. Open the product in edit mode
  3. Scroll to the section “Related Products, Up-Sells, and Cross-Sells”
  4. Click to Add Cross-Sell Products
  5. Use filter to select the products that you want.
  6. Add Selected Products

Magento Related Products

Magento Related products are meant to be purchased in addition to the item the customer is viewing. The customer can place the item in the shopping cart by simply clicking the checkbox. The placement of the Related Products block varies according to theme and page layout. In the example below, it appears at the bottom of the Product View page. With a 2 column layout, the Related Product block often appears in the right sidebar.

To add Related products on Magento you need do following steps: (Just similar add the upsells)

  1. Go to Admin > Products
  2. Open the product in edit mode
  3. Scroll to the section “Related Products, Up-Sells, and Cross-Sells”
  4. Click to Add  Related Products
  5. Use filter to select the products that you want.
  6. Add Selected Products

Add Related Products Shopify

The simplest way to recommend related products is to install a related products app. There are several apps for product recommendations. We have tried some apps and see Globo Related Products are the best one. It is Free for Related Products, If you want to Also Bought Products you could charge fee. You can contact to app developer to get more free trial or discount.

If you don’t want to use app, please following to custom your theme

Then copy and paste the following code to related-products.liquid file

{% if section.settings.show_related_products == true %}
<hr>
<div class="product-template__container page-width" itemscope itemtype="http://schema.org/Product" id="ProductSection-{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="product" data-enable-history-state="true">
 
{% comment %}
  Number of related items per row,
  and number of rows.
{% endcomment %}

{% assign number_of_related_products_per_row = section.settings.related_grid_num %}
{% assign number_of_rows = section.settings.related_grid_row %}

{% comment %}
  Heading.
  Leave blank if you don't need one.
{% endcomment %}

{% assign heading = section.settings.related_title %}

{% comment %}
  Set either or both to true, if you want
  to limit yourself to items with same vendor, and/or type.
{% endcomment %}

{% assign same_vendor = false %}
{% assign same_type = false %}

{% comment %}
  Collections to ignore.
  Never pick related items from those.
{% endcomment %}

{% assign exclusions = 'frontpage,all' | split: ',' %}

{% comment %}
  Looking for a relevant collection.
{% endcomment %}

{% if product.metafields.c_f['Related Products'] %}
  {% assign collection = collections[product.metafields.c_f['Related Products']] %}
{% endif %}

{% assign found_a_collection = false %}
{% if collection and collection.all_products_count > 1 %}
  {% unless exclusions contains collection.handle %}
    {% assign found_a_collection = true %}
  {% endunless %}
{% endif %}
{% unless found_a_collection %}
  {% for c in product.collections %}
    {% unless exclusions contains c.handle or c.all_products_count < 2 %}
      {% assign found_a_collection = true %}
      {% assign collection = c %}
      {% break %}
    {% endunless %}
  {% endfor %}
{% endunless %}

{% comment %}
  If we have a relevant collection.
{% endcomment %}

{% if found_a_collection %}

  {% assign counter = 0 %}
  {% assign break_at = number_of_rows | times: number_of_related_products_per_row %}
  {% assign current_product = product %}
  
  {% case number_of_related_products_per_row %}
    {% when '1' %}
      {% assign grid_item_width = '' %}
  {%- assign max_height = 700 -%}
    {% when '2' %}
      {% assign grid_item_width = 'small--one-half medium-up--one-half' %}
  	  {%- assign max_height = 530 -%}
    {% when '3' %}
      {% assign grid_item_width = 'small--one-half medium-up--one-third' %}
      {%- assign max_height = 345 -%}
    {% when '4' %}
      {% assign grid_item_width = 'small--one-half medium-up--one-quarter' %}
  {%- assign max_height = 250 -%}
    {% when '5' %}
      {% assign grid_item_width = 'small--one-half medium-up--one-fifth' %}
  {%- assign max_height = 195 -%}
    {% when '6' %}
      {% assign grid_item_width = 'small--one-half medium-up--one-sixth' %}
  {%- assign max_height = 195 -%}
    {% else %}
      {% assign grid_item_width = 'small--one-half medium-up--one-quarter' %}
  {%- assign max_height = 195 -%}
  {% endcase %}


  {% capture related_items %}
<div class="grid grid--uniform{% if collection.products_count > 0 %} grid--view-items{% endif %}">

  {% for product in collection.products %}
  {% unless product.handle == current_product.handle %}
  {% unless same_vendor and current_product.vendor != product.vendor %}
  {% unless same_type and current_product.type != product.type %}
  <div class="grid__item {{ grid_item_width }}">
    {% include 'product-card-grid', max_height: max_height %}
  </div>
  {% assign counter = counter | plus: 1 %}
  {% if counter == break_at %}
  {% break %}
  {% endif %}
  {% endunless %}
  {% endunless %}
  {% endunless %}
  {% endfor %}
</div>
  {% endcapture %}

  {% assign related_items = related_items | trim %}

  {% unless related_items == blank %}

  <aside class="grid">
    <div class="grid__item">
      {% unless heading == blank %}
      <header class="section-header">
        <h2 class="section-header__title">{{ heading }}</h2>
      </header>
      {% endunless %}
      <div class="grid-uniform">
        {{ related_items }}
      </div>
    </div>
  </aside>

  {% endunless %}
     
{% endif %}
  
</div>
{% endif %}

{% schema %}
{
  "name": "Related products",
  "settings": [
    {
      "type": "checkbox",
      "id": "show_related_products",
      "label": "Show related products",
      "default": false
    },
    {
      "id": "related_title",
      "type": "text",
      "label": "Section title",
      "default": "Other fine products"
    },
    {
      "type": "select",
      "id": "related_grid_num",
      "label": "Products per row (Desktop)",
      "default": "4",
      "options": [
        {
          "value": "2",
          "label": "2"
        },
        {
          "value": "3",
          "label": "3"
        },
        {
          "value": "4",
          "label": "4"
        },
        {
          "value": "5",
          "label": "5"
        }
      ]
    },
    {
      "type": "select",
      "id": "related_grid_row",
      "label": "Number of rows (Desktop)",
      "default": "1",
      "options": [
        {
          "value": "1",
          "label": "1"
        },
        {
          "value": "2",
          "label": "2"
        },
        {
          "value": "3",
          "label": "3"
        }
      ]
    }
  ]
}
{% endschema %}

Embed Google form in website without iframe

According to surveys, Google form is commonly used to collect people’s opinions as well as information. Its advantages are free, high-speed, and easy to use. Normally, a Google link or a shortcut link in the format of goo.gl is used. In this article, we will talk about how to embed google form in website without iframe. In this way, you can add any form to any platform, to any location which may be your website, email or even mailchimp.

Preparation before “Embed Google form in website without iframe”

  • A Google account to create a Google form
  • (Option) A contact page used to add to Shopify. You may use Weebly.

Implementation “Embed Google form in website without iframe”

Create a form

Firstly, you get to the website with address https://www.google.com/intl/en-EN/forms/about/ . You should replace the language pair en-EN in the url with your language pair appropriately.

You could create a form. Here I use the default form of Google as below

Now, you click on Send button on the top right of the screen

A popup shows up so that you can select the embed icon as in the figure. Now you can select the form height and width. This custom form can be shared via social networks such as Google plus, Facebook, Twitter. In this article how to embed google form in website without iframe, after selecting the dimension, you click on Copy to copy form.

At the moment, you create a page in Shopify. In Editor, you switch to using html mechanism, paste the form here, and save it.

You should view this page to check. If the result is the same as below, you carry out correctly. If it is different, you should review each step carefully.

This article is quite simple. You can easily follow the above notes. The article how to embed google form in website without iframe comes to an end now.

If you use Shopify, Google form or default forms of Shopify are a good idea. However, I recommend that you should use custom form app for Shopify. It allows you to drag and drop fields with new field formats that Google form does not include such as Google map, Upload file. It also supports fully responsive to various screen sizes of different devices. Especially, you can have a lifelong app usage for free.

How to change font Weebly

That developing websites on Weebly is quite easy convinces many people to choose the websites as a personal blog. You can use it for free if you do not change the default domain. You can edit the user interface to match with your style. The article “how to change font weebly” will help you optimize the font as well as edit it properly.

The article “how to change font weebly” guides you on editing the default font of the system without writing a single line of code. You just need to drag and drop, select dropdowns, and pick up colors by using Color picker.

Use the default font – how to change font Weebly

After login to the website, you click on Theme, and click on Change Fonts as the figure below

Next, you select the areas you want to adjust the font. They could be Site Title, Navigation menu as the figure below

Select the items that need editing. In the table bordered in red on the left, you are able to edit font, font-size, and color, etc. After editing, you should remember to click on Publish.

I see that many people are searching for “How to change font Weebly ” but few articles look at this issue. Therefore if you feel this article helpful, please share it with others. Perhaps they are also searching for it. Moreover, you can read more our article about WordPress custom form save to database, Mega Menu. If you follow all the articles, I think you can complete your own entire project.

WordPress custom form save to database

The phrase WordPress custom form save to database is interested by lots of people. Almost simple contact forms are sent to the admin email address. But in fact, the data needed to be saved to the database. This article will guide you on how to do this in the simplest way.

To be easy for WordPress newbies, we will prioritize to use a plugin. Of course, you can write code yourself. However, for the suitability for every people, we will do the simplest things as below.

Preparation 

  • WordPress: Absolutely, you need to have one website with WordPress already installed or used on your computer.
  • Contact form 7: You must have been so familiar with it due to its popularity
  • Contact Form 7 Database: This is the plugin used to save data to the database when users submit information.

Implementation wordpress custom form save to database

In order to complete the process that wordpress custom form save to database, the first things to do is log in to the WordPress admin. You hover to Plugins and click on Add new.

In the search box, you enter contact form 7. Then you install the plugin and make it active as below

We so the similar thing with the plugin “contact form 7 database

Now, we will create a contact form by building fields. Contact form 7 is a very good form builder plugin which supports many types of input field such as text, image, file, checkbox, etc.

You can use the default form of contact form 7 to make a simple trial.

On all forms, there exist shortcodes. You just need to copy the shortcodes and paste on the post or page you want forms to be displayed.

This article will help you add this code to the contact page

After entering the information already, you click on Submit. If you use localhost but you have not installed sending email on the localhost, the system will show error. Don’t worry! After submitting, data has been saved to the database. We will get to the back end to check.

The plugin admin will display as below

You click to view the detailed contents.

Here is the content in the example

We have finished the article wordpress custom form save to database. If you have any question, please leave a comment.

If you use Prestashop, you could use form builder module. This module supports you to drag and drop professionally. You just have to drag and drop the fields you want to display and save them. It supports responsive to be compatible with all devices. If you do not know how to use it, there are available guidance document as well as support team so that you can use it without minding.

woocommerce hide breadcrumbs

Depending on the users’ design and requirement, they need to have woocommerce hide breadcrumbs. The aim of breadcrumbs is to filter products, as well as identify the website structure from which users can search for information with the least operations.

woocommerce hide breadcrumbs

Breadcrumbs play an important role in supporting users as well as promoting SEO such as an increase in the rate of keywords and clicks, and a decrease in the rate of page-exiting, etc. However, in small pages, landing pages are not necessary to contain breadcrumbs. It is the reason why we write this article which focuses on woocommerce hide breadcrumbs.

There are two ways to hide breadcrumbs on the WordPress website in which woocommerce installation includes

Way no. 1: Use CSS to hide breadcrumbs

It is an easy way that many people can do. Most people think of this way first because you just find its exact class and hide it by the familiar css attribute display:none.

Way no. 2: remove breadcrumbs via php code

You get to the theme folder you are using, then find function.php file. You open this file and insert the code below in the last paragraph of the file. Save the file, then get back to the website, reload the website to check.

// Remove breadcrumbs from shop & categories

add_filter( ‘woocommerce_before_main_content’, ‘remove_breadcrumbs’);

functionremove_breadcrumbs() {

if(!is_product()) {

remove_action( ‘woocommerce_before_main_content’,’woocommerce_breadcrumb’, 20, 0);

}

}

We have solved the issue related to woocommerce hide breadcrumbs on the website. You can use any way you want. However, I suggest that you should use the second way which uses php code to add to the function file. If you have any problem, please leave a comment. We will support you for free.

 

How to cancel an order on PayPal

How to cancel an order on PayPal is the question many people who use Paypal to order often ask. There are many reasons why the buyers want to cancel their orders. But they do not know how to do this. This article will help solve this problem.

How to cancel an order on PayPal

 

You may cancel your order when you realize that this product does not match with you. Or you have spent so much so far and you do not want to spend anymore. Or you just want to cancel the order. Below are the ways you can apply.

Cancel the payment

If you do not transfer PayPal payment to the store, they will not deliver goods to you. Usually, when you transder money via PayPal without confirmation, you have a right to cancel the payment by doing the following steps

  • Log in to your PayPal account.
  • Then Click Transactions at the top of the page.
  • Click the unclaimed payment you want to cancel.
  • Then Click Cancel Payment next to the unclaimed payment.
  • Click Cancel Payment to confirm

However, you can apply this way only the payment has not been confirmed. Maybe the email in which you transfer money does not exist in PayPal or the account has not been authenticated. If your account is valid, money will be sent in a short time, you cannot cancel the payment.

Contact the store

If you have transferred money but the goods have not been delivered. You no longer want to pay for this order. You can contact store owners to apologize request for a refund. In some cases, they will accept the refund happily.

In case of goods having been delivered to you already, you should view the regulation of product exchange. It depends on the regulation of each company.

Open a dispute

This is a rarely faced case, but you need to do this to protect your right. In case that you cannot negotiate successfully, you can absolutely open a dispute. PayPal allows you to do this in 180 days from the date money is transferred.

We have run through the article how to cancel an order on paypal. I believe that you now have your own solution. However, many online purchasing newbies may face the problem. Hope that you could share this article with others to read. If you have any innovative solution, please leave a comment below. We are so grateful for your action.

 

 

 

Contact form 7 send to multiple emails

contact form 7 send to multiple emails is very important to people who use contact form as a contact channel. This happens in the case that someone sends data via contact form. The contents will be automatically sent to administrative, sales and customer service departments, etc. The advantage of the contact form is that it allows users to send email directly to admin quickly without depending on mail-sending programs such as Outlook or gmail.

When the contact form is on the website, by default, customers will base on the existing fields such as name, email, title, contents to send data. After submitting the data, an email containing this data saved in the system will be sent to admin. However, you can do more than ever with contact form 7.

Contact form 7 is the well-known form builder which is used many people in the world for WordPress source code. If you use Shopify to build your website, I suggest that you should use Powerful Form Builder because it works well and has many similar and higher-level features than that of contact form 7.

Come back to today problem “ contact form 7 send to multiple emails ”, at the moment, I suggest that you should apply one in the two following simple ways.

Add extra emails to received email item

By using this way, you can enter a list of email addresses in text box “to” in the email tab of contact form 7’s installation. Remember that email addresses are separated by a comma “,”.

contact form 7 send to multiple emails

Use BCC, and CC to add email address to Additional Headers

When following this way, you enter received emails in CC, BCC in Additional Headers as below.

contact form 7 send to multiple emails

Send emails to customers

When customers send data to the website’s admin, you can automatically reply to the emails that have been sent to you. This automatic email could be thanking one. You can use this feature or not depending on your purpose.

To use this feature, you do as the following guidance. Put a tick on Use email check box.

contact form 7 send to multiple emails

Next, a window shows up as below. Your task is to enter information as below to make sure that your customers can receive your reply email. You can absolutely create your own message by changing the contents in Message Body box.

contact form 7 send to multiple emails

We have solved the problem “ contact form 7 send to multiple emails ” together. I believe that you have your own solution. If you cannot do that, please try one more time. Or you can contact us or leave us a message. We will support you for free. You can share this article because I believe that many people do not know about this solution.

 

How to create woocommerce purchase note

woocommerce purchase note is messages that customers send to the store when purchasing. The messages could be notes of address, or reminders to remind admin the date of goods delivery. This article will help you understand what purchase note on woocommerce is as well as how it works, where the data display, and how to eliminate it when unnecessary.

woocommerce purchase note

Display purchase note

In order to see the note contents from customers, you get to Order of Woocommerce. When getting to each order, you will see the content as the figure below

woocommerce purchase note

Change the purchase note placeholder

You can replace the default placeholder of Woocommerce purchase note with the syntax of the following command. You should remember that it only works when being added to function.phpin the theme folder file.

add_filter( 'woocommerce_checkout_fields', 'ht_woocommerce_checkout_fields' );
/**
* Change Order Notes Placeholder Text - WooCommerce
*
*/
functionht_woocommerce_checkout_fields( $fields ) {
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder';
return $fields;
}

Now, the checkout page in the front end will display like that

woocommerce purchase note

Remove woocommerce purchase note

woocommerce purchase note is seen not to be a required field. You can enter it or not. Therefore, there are two ways of hiding this field

The first way is using css to hide it.

.woocommerce-additional-fields {display:none}

You add this code to css. file. Press F5 button to check.

woocommerce purchase note

 

The second way is safer. If you accidentally add a field with the same class as the class in the figure above, this field will be hidden by chance. Therefore, you should add it to function.php file, then add the below code

add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );

After the article Woocommerce purchase note, you must have known to use it properly depending on the project that you are developing requires purchase note or not. I have worked on many projects so I see that there are many custom requirements in orders. For instance, customers want to add/delete a field, change the order of data displayed, and retrieve users’ data to deliver to the back end for the admin to check. If you are using woocommerce, you should read our next articles. We will have more articles about customer checkout page as well as order. But if you are using Prestashop, I suggest that you should use Order edit module. Because this module helps arrange, edit, and add new orders easily.

 

how to add a drop down menu in Shopify?

Drop down menu is one type of menu including a parent menu and submenus. When you hover or click on the parent menu, a list of submenus belonging to parent menu will show up. Drop down menu makes your websites more tidy, attractive and professional. Drop down menus on Shopify are different from other source codes. So, how to add a drop down menu in Shopify? This article will help you answer this question.

The first step is that you log in the back office of Shopify. The link for you to login is http://yourdomain/admin . Use your account to log in the website. Please make sure that your account has right to create and edit menus. To check this right, you click on Online Store, and click on Navigation. If you can add menu, you are allowed to continue. If not, you should use another account or request for your account to be given extra rights.

how to add a drop down menu in Shopify

Add a parent menu

You can edit a menu in the list of existing menus by adding a drop down menu. Or you can create a new menu.

Title: You input the name of the menu

Add menu item: Here you add menu items. For example, in this article, items are Home, Shop, Sale, Collection, Blog, Pages

how to add a drop down menu in Shopify

After adding menu item, we have a menu as below

how to add a drop down menu in Shopify

Add submenus

You may ask why the question how to add a drop down menu in shopify is related to submenus. If you do not know the answer, I will explain to you. Drop down menu includes a parent menu and submenus. Usually, on the screen, parent menu displays and submenus hides. When you hover mouse cursor to the parent menu, a list of submenus will display.

how to add a drop down menu in Shopify

One special thing of Shopify is that the name of submenu should be set as the same as that of the menu item. In the following example, we create submenus for home item. We will set the name as “home”. We add custom items with names home page 1, home page 2, home page 3, etc. for example.

how to add a drop down menu in Shopify

We have run through the article how to add a drop down menu in shopify. If you have the same question such as how to make a drop down menu in shopify , or how to create a drop down menu in shopify, I believe you have your own answer. It is too easy to create a drop down menu on Shopify. I believe that you can do that.

If you want to create a drop down menu with unlimited submenus, I suggest that you should mega menu app. It supports to add not only unlimited submenus but also contact form, html, image, and best-selling products, which makes your website more lively, increasing customers’ experiences and your revenues.

If you are good at html, css code, please read this article which will help you to create a menu with code

 

How to create shopify mega menu code

shopify mega menu code is a combination of html, css, js source codethat you can add to your website. You can use this free mega menu code to add to your project. This article will guide you on how to create and insert mega menu code in your website.

In this example, I will create a simple mega menu including a drop down menu, and images. Based on this example, you can customize it so that it can be suitable for your store and your hobby as well.

Create mega menu code

To facilitate the process of editing code, you could use software such as như note notepad++, phpdesigner, etc. Or you can open directly the Shopify’s file in the back end of Shopify.

In this example, we use phpdesigner to edit code. We will add shopify mega menu code to the website if everything is okay after testing.

Create index.html file with the following content

<div class="navbar">
<a href="#home">Home</a>
<a href="#news">News</a>
<div class="dropdown">
<button class="dropbtn">Dropdown
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<div class="header">
<h2>Mega Menu</h2>
</div>
<div class="row">
<div class="column">
<h3>Category 1</h3>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<div class="column">
<h3>Category 2</h3>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<div class="column">
<h3>Category 3</h3>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
</div>
</div>
</div>

Create style-megamenu.css file with the following content

* Navbar container */
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial;
}
/* Links inside the navbar */
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
/* The dropdown container */
.dropdown {
float: left;
overflow: hidden;
}
/* Dropdown button */
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font: inherit; /* Important for vertical align on mobile phones */
margin: 0; /* Important for vertical align on mobile phones */
}
/* Add a red background color to navbar links on hover */
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
/* Dropdown content (hidden by default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
width: 100%;
left: 0;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Mega Menu header, if needed */
.dropdown-content .header {
background: red;
padding: 16px;
color: white;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 10px;
background-color: #ccc;
height: 250px;
}
/* Style links inside the columns */
.column a {
float: none;
color: black;
padding: 16px;
text-decoration: none;
display: block;
text-align: left;
}
/* Add a background color on hover */
.column a:hover {
background-color: #ddd;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}

We will test the menu by opening index.html file on the browser. If there is any problem that needs to be edited, you edit it the file you have created.

Add code to Shopify

To keep your website safe, you duplicate the theme, and try this mega menu on the duplicated theme.

shopify mage menu code

We can use Preview status of Shopify by clicking on Action button. In the list of drop down menu, you click on preview as below. In this status, only you can see the changes on the website when you add mega menu code. This will be safe because your customers are not affected. And if there is something wrong with the interface, nobody knows this.

shopify mage menu code

Next, we will edit code

shopify mage menu code

Depending on the place you want the menu to be displayed, you select a proper file to edit. In this example, I use the default Debut theme. I will add Shopify mega menu code to the existing main menu of the theme.

Add html code to theme

In the Debut theme, the following code helps display the menu {% include ‘site-nav’ %}

Now, you open header.liquid file, search for code {% include ‘site-nav’ %} in line 177 of the original theme. We will edit this code as {% include ‘mega-menu’ %}

shopify mage menu code

Next, in Snippets, you click on Add a new snippet, enter texts “mega-menu”, and click on Create snippet

shopify mage menu code

In mega-menu.liquid file, you add all the html contents in index.html file we have prepared in the first step and save them.

shopify mage menu code

Add css to theme

Add these codes {{ ‘mega-menu.css’ | asset_url | stylesheet_tag }} to theme.liquid file

shopify mage menu code

In Assets, click on Add a new asset. A popup shows up, you click on Create a blank file. Enter the name of “mega-menu” file, choose format as “.css”, click on Add asset bordered in red.

shopify mage menu code

Next, enter the content of style.css file to mega-menu.css file just created, then save this.

shopify mage menu code

 

Now, you enjoy the result in the front end.

We have just created shopify mega menu code and add it to the website. This way in not time-consuming, you just need to copy and use the codes. But it is extremely difficult for people who do not know about codes. If you do not know about codes, I suggest that you should use mega menu app. When you use this app, you just need to drag and drop to create a menu. There are many menu types so that you can show your creativity. You can refer to this link https://apps.shopify.com/globo-mega-menu to try using the demo. Of course, your menu will be much more attractive. I really recommend you to use this app.