Setup Guide

MineShopify Setup Guide

Step-by-step guide to install and configure MineShopify. Connect your Minecraft server with your Shopify store in just a few minutes.

1

Plugin Installation

Download the MineShopify plugin and install it on your Minecraft server

Download Plugin

Download the latest version of the MineShopify plugin:

Server Installation

  1. Upload the MineShopify.jar file to your server's plugins/ folder
  2. Restart your server
  3. The plugin will automatically create a config.yml file
  4. Stop the server for configuration
2

Shopify API Setup

Create a private app in your Shopify Admin Panel

Create Private App

  1. Go to your Shopify Admin Panel
  2. Navigate to "Apps" → "Develop apps"
  3. Click on "Create an app"
  4. Enter a name: MineShopify

Configure API Permissions

Enable the following permissions:

  • read_orders (required)
  • read_customers (recommended)
  • read_products (optional)

Copy the Admin API access token - you'll need it for configuration!

3

Shopify Code Integration

Add the Minecraft username code to your Shopify theme

Edit Theme Code

  1. Go to "Online Store" → "Themes"
  2. Click on "Actions" → "Edit code"
  3. Navigate to "Templates" → "main-main-cart.liquid"
  4. Add the following code before the closing </div> tag at the end:
main-cart.liquid
<!-- Add this code to your main-cart.liquid template -->
<div class="cart-page">
  <div class="cart-page__content">
    
    <!-- Minecraft Username Alert -->
    <div class="minecraft-username-alert">
      <div class="minecraft-username-alert__content">
        <span class="emoji">✨</span>
        <span>
          <strong>Please enter your correct Minecraft username so your order can be processed successfully.</strong>
          Without a valid username, your in-game purchase (e.g., gems) cannot be delivered.
        </span>
      </div>
    </div>

    <!-- Cart Attributes Form -->
    <div class="cart-attribute__wrapper">
      <div class="cart-attribute__field">
        <label for="accountType">Account Type</label>
        <select id="accountType" name="attributes[account_type]" onchange="updateCartAttributes()" form="cart">
          <option
            value="Java"
            {% if cart.attributes.account_type == 'Java' %}
              selected
            {% endif %}
          >
            Java Edition
          </option>
          <option
            value="Bedrock"
            {% if cart.attributes.account_type == 'Bedrock' %}
              selected
            {% endif %}
          >
            Bedrock Edition
          </option>
        </select>
        <div class="cart-attribute__hint">Bedrock usernames automatically get a "!" prefix</div>
      </div>

      <div class="cart-attribute__field">
        <label for="usernameInp">Minecraft Username</label>
        <input
          required
          class="required"
          id="usernameInp"
          type="text"
          name="attributes[username]"
          value="{{ cart.attributes["username"] | escape }}"
          placeholder="e.g. Steve123"
          oninput="updateCartAttributes()"
          form="cart"
        >
      </div>
    </div>

    {%- unless cart.empty? -%}
      <div class="cart-page__summary">
        {%- content_for 'block', id: 'cart-page-summary', type: '_cart-summary' -%}
      </div>
    {%- endunless -%}

    <div class="cart-page__more-blocks">
      {%- content_for 'blocks' -%}
    </div>
    
  </div>
</div>

<style>
  .minecraft-username-alert {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(to right, #e0f2fe, #f0f9ff);
    border-radius: 8px;
    border-left: 3px solid #0ea5e9;
    max-width: 100%;
    display: flex;
    align-items: center;
  }

  .minecraft-username-alert__content {
    color: #0369a1;
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  .minecraft-username-alert__content .emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .minecraft-username-alert__content span:last-child {
    flex: 1;
  }

  .cart-attribute__wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
  }

  .cart-attribute__field {
    position: relative;
  }

  .cart-attribute__field label {
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
  }

  .cart-attribute__field input,
  .cart-attribute__field select {
    appearance: none;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    color: #111827;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  }

  .cart-attribute__field select:focus,
  .cart-attribute__field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
  }

  .cart-attribute__field select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    cursor: pointer;
  }

  .cart-attribute__hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
  }

  @media (max-width: 768px) {
    .cart-attribute__wrapper {
      padding: 1rem;
      margin: 1.5rem 0;
    }
    
    .minecraft-username-alert {
      padding: 0.5rem 0.75rem;
    }
    
    .minecraft-username-alert__content {
      font-size: 0.85rem;
      gap: 0.5rem;
    }
  }
</style>

<script>
  function updateCartAttributes() {
    const usernameInput = document.getElementById('usernameInp');
    const accountType = document.getElementById('accountType').value;
    let username = usernameInput.value;

    if (accountType === 'Bedrock' && !username.startsWith('!')) {
      username = '!' + username;
    } else if (accountType === 'Java' && username.startsWith('!')) {
      username = username.slice(1);
    }

    // Update cart attributes via Shopify's cart API
    fetch('/cart/update.js', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        attributes: {
          username: username,
          account_type: accountType
        }
      })
    })
    .then(res => res.json())
    .then(data => console.log('✅ Cart Attributes updated:', data))
    .catch(err => console.error('❌ Error saving attributes:', err));
  }

  document.addEventListener('DOMContentLoaded', function () {
    const usernameInput = document.getElementById('usernameInp');
    const accountType = document.getElementById('accountType');

    // Update attributes when user changes input
    if (usernameInput) {
      usernameInput.addEventListener('input', updateCartAttributes);
    }
    if (accountType) {
      accountType.addEventListener('change', updateCartAttributes);
    }
  });
</script>
4

Plugin Configuration

Configure the MineShopify plugin on your server

Edit config.yml

Edit the config.yml file in your plugin folder:

config.yml
# MineShopify Configuration
shopify:
  shop_url: "your-shop.myshopify.com"
  api_token: "YOUR_API_TOKEN_HERE"
  scheduler: 30  # Check for new orders every 30 seconds
  max_orders: 50  # Maximum orders to process per check
  days_to_check: 7  # How many days back to check for orders
  
# Storage Configuration
storage:
  type: "file"  # "mysql" or "file"
  mysql:
    host: "localhost"
    port: 3306
    database: "minecraft"
    username: "user"
    password: "password"
    connection_pool:
      minimum: 2
      maximum: 10
      
# Package Configuration
packages:
  "VIP Rank":
    commands:
      - "lp user %player% group add vip"
      - "give %player% diamond 32"
      - "title %player% title {\"text\":\"VIP\",\"color\":\"gold\",\"bold\":true}"
  "Premium Kit":
    commands:
      - "give %player% diamond_sword 1"
      - "give %player% diamond_armor 4"
      - "eco give %player% 1000"
  "Server Gems":
    commands:
      - "gems give %player% %amount%"
      - "broadcast &6%player% &7purchased &e%amount% gems!"
      
# Notifications
notifications:
  enabled: true
  in_game:
    recipients:
      - "admin"
      - "owner"
    message: "&6[&e&lSHOP&6] &e%player% &7purchased &6%package%&7! 🎉"
  success_message: "&a&lSUCCESS! &7Your purchase has been processed successfully!"
  
# Debug Mode
debug: false

Start Server & Test

  1. Restart your Minecraft server
  2. Use /mineshopify status to check the status
  3. Test an order in your Shopify store
  4. Check the logs for any errors

Congratulations! MineShopify is now set up and ready for orders.