Skip to content

Instantly share code, notes, and snippets.

View stuartchaney's full-sized avatar
💥

Stuart Chaney stuartchaney

💥
View GitHub Profile
@stuartchaney
stuartchaney / variables.md
Last active April 16, 2024 15:42
Variables available for Rivo Theme Extensions

How to use these variables

Our theme extensions are built using liquid and a very small javascript framework called Alpine.js.

Here is how to display variables anywhere on the html displayed.

  1. Pick any element
  2. Add x-data to the element
  3. Add x-text to display text
  4. Add x-html if your text has html included.
@stuartchaney
stuartchaney / account.json
Created April 15, 2024 18:33
customers/account.json
{
"sections": {
"main": {
"type": "main-account",
"settings": {
}
}
},
"order": [
"main"
@stuartchaney
stuartchaney / rivo-lp.css
Created March 27, 2024 18:00
Rivo Landing Page Base CSS
/**************************\
Rivo Modal Styles
/**************************/
.rivo-modal {
text-align:center;
}
.rivo-modal__overlay {
z-index: 999999999999;
<script src="https://cdn.tapcart.com/webbridge-sdk/webbridge.umd.js" defer></script>
<script type="text/javascript">
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "<%= asset_url('app_proxy/application') %>";
document.head.appendChild(script);
document.addEventListener("webbridge-loaded", function() {
const div = document.getElementById('rivo-app-root');
@stuartchaney
stuartchaney / determine_test_transaction.rb
Created August 10, 2023 15:07
Service object to determine test transactions for a Shop
class DetermineTestTransaction < ApplicationService
attr_reader :shop
def initialize(shop)
@shop = shop
end
def perform
is_test_environment? || test_eligible_shop?
time_ago = 1.day.ago
expected_customer_ids = s.orders.where(fulfillment_status: "fulfilled", remote_updated_at: time_ago..).pluck(:customer_id).uniq
actual_customer_ids = s.points_logs.where(applied_at: time_ago..).pluck(:customer_id).uniq
missing = expected_customer_ids - actual_customer_ids
######
ids = [6710280782089, 6509421658377, 6710941188361, 6711069212937, 6509565411593, 6711239704841, 6508219203849]
{% comment %}{% assign icon_url = %}{% endcomment %}
{%- assign potential_points_config = shop.metafields.ba_loy.config.frontend.potential_points.order_placed -%}
{%- if potential_points_config.enabled && template.name == "product" -%}
{%- if potential_points_config.points_type == "multipler" -%}
{%- assign potential_points = product.price | divided_by: 100 | times: potential_points_config.points_amount -%}
{%- else -%}
{%- assign potential_points = potential_points_config.points_amount -%}
{%- endif -%}
<div class="rivo-reviews-star-rating" data-product-id="{{ product.id }}" data-rating="{{ product.metafields.ba_rev.review_data.stars }}" data-count="{{ product.metafields.ba_rev.review_data.reviews_count }}">
<div class="rivo-reviews-rating-count"></div>
</div>
.modules-wrapper span .panel--module{
box-shadow: 4px 4px 0px 0px #000;
}
create_table "app_events", id: false, force: :cascade do |t|
t.bigserial "id", null: false
t.bigint "shop_id"
t.string "shopify_domain"
t.string "app_type"
t.datetime "remote_date_at"
t.string "name"
t.string "details"
t.datetime "billing_on"
t.datetime "created_at", null: false