Skip to content

Instantly share code, notes, and snippets.

View baorv's full-sized avatar
🎯
Focusing

Bob Roan baorv

🎯
Focusing
  • Mageplaza
  • Hanoi, Vietnam
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="x-apple-disable-message-reformatting">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Invoice AVADA PDF Invoice</title>
<style type="text/css">
a { text-decoration: none; outline: none; }
<script type="text/javascript">
var buildProductFieldObject = function(object, quantity) {
var product = {};
if (object.title) {
product.name = object.title;
}
if (object.id) {
product.id = object.id;
}
if (object.price) {
@baorv
baorv / discounted_per_item.liquid
Created June 2, 2020 07:21
discount per item
{% assign discountAllocationAmount = 0 %}
{% for discountAllocation in item.discount_allocations %}
{% assign discountAllocationAmount = discountAllocationAmount | minus: item.amount %}
{% assign discountAllocationAmount = discountAllocationAmount | divide_by: item.quantity %}
{% endfor %}
{{ item.price | minus: discountAllocationAmount }}
{% assign totalRemoveItemPrice = 0 %}
{% assign removeItems = "" %}
{% for refundItem in order.refunds %}
{% for refundLineItem in refundItem.refund_line_items %}
{% assign totalRemoveItemPrice = totalRemoveItemPrice | plus: refundLineItem.subtotal %}
{% assign removeItems = removeItems | append: refundLineItem.line_item_id | append: ", " %}
{% endfor %}
{% endfor %}
@baorv
baorv / style.liquid
Created May 13, 2020 06:45
Default packing slip template
* {
padding: 0;
margin: 0;
}
.logo img {
margin-top: 10px;
margin-bottom: 10px;
}
@baorv
baorv / default_invoice.liquid
Created May 13, 2020 06:45
Default invoice template
{% assign logoWidth = configuration.logoWidth | default: 150 %}
{% assign logoSize = template.logo_size | default: 100 %}
{% assign logoHeight = configuration.logoHeight | default: 75 %}
{% unless template.font_family == blank %}
<span>
<link type="text/css" href="https://fonts.googleapis.com/css?family={{ template.font_family }}:100,100i,300,300i,400,400i,500,500i,700,700i&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
<style type="text/css">
#wrapper * {
font-family: '{{ template.font_family | replace: "+", " " }}', serif;
}
{% if order.customer %}
{{ order.customer.email }}<br/>
{{ order.customer.first_name }}</br>
{{ order.customer.last_name }}</br>
{% endif %}
{% for property in item.properties %}
<strong>{{ property.name }}: </strong>{{ property.value }}
{% endfor %}
@baorv
baorv / style.liquid
Created May 11, 2020 11:06
AVADA Invoice template for vfuae.myshopify.com
* {
padding: 0;
margin: 0;
}
.logo img {
margin-top: 10px;
margin-bottom: 10px;
}
{% if item.fulfillable_quantity === 0 %}
{% break %}
{% endif %}