Coder Social home page Coder Social logo

shopify / shopify.github.com Goto Github PK

View Code? Open in Web Editor NEW
510.0 506.0 129.0 8.64 MB

A collection of the open source projects by Shopify

Home Page: https://shopify.github.io

License: MIT License

Ruby 0.30% HTML 2.00% CSS 75.26% JavaScript 2.31% Shell 0.01% SCSS 20.11%

shopify.github.com's Issues

How to get abandoned cart data

In my index.js
app.get("/api/abandoned-cart", async (_req, res) => {
const checkoutsData = await shopify.api.rest.AbandonedCheckout.checkouts({
session: res.locals.shopify.session,

});
res.status(200).send(checkoutsData);
});

and I have created a component abandonedCart

import React, { useEffect, useState } from "react";

function AbandonedCart() {
const [checkoutsData, setCheckoutsData] = useState([]);

useEffect(() => {
fetch("/api/abandoned-cart")
.then(response => response.json())
.then(data => {
setCheckoutsData(data)
console.log("data",data)})
.catch(error => console.error(error));
}, []);

return (


Abandoned Cart Data:


{JSON.stringify(checkoutsData, null, 2)}


);
}

export default AbandonedCart;

the auth api I am calling is

const shopify = shopifyApp({
api: {
apiVersion: LATEST_API_VERSION,
restResources,
billing: undefined, // or replace with billingConfig above to enable example billing
},
auth: {
path: "/api/auth?shop=brandgoclothe-01.myshopify.com",
callbackPath: "/api/auth/callback",
},
webhooks: {
path: "/api/webhooks",
},
// This should be replaced with your preferred storage strategy
sessionStorage: new SQLiteSessionStorage(DB_PATH),
});


when the api is called I am getting 503 error

I am attaching the RQ/RS of the api's

abandone
a

aditional informtion is earlier I am getting shop undefined error, so I have included shop=brandgoclothe-01.myshopify.com", as query parameter in and now I am getting 503 error in both the api's.

help me to get out of this

Unprocessed filters in documentation

Scroll to the end on https://shopify.github.io/liquid/filters/ and see:

Input
{% raw %}
{{ "[email protected]" | url_encode }}
{% endraw %}

Output
{{ "[email protected]" | url_encode }}

Input
{% raw %}
{{ "Tetsuro Takara" | url_encode }}
{% endraw %}

Output
{{ "Tetsuro Takara" | url_encode }}

Output is same as input.

Then go the the filter sub page https://shopify.github.io/liquid/filters/url_encode/:

Input
{{ "[email protected]" | url_encode }}

Output
john%40liquid.com

Input
{{ "Tetsuro Takara" | url_encode }}

Output
Tetsuro+Takara

Add handy to open source directory

The Spatial Commerce team created a tool called Handy that can be used to mocap hands using a Meta Quest headset.

This is Handy's repo: https://github.com/Shopify/handy

We have open sourced it because it's useful for 3D artists, and because it helps us promote Shopify engineering.

We would like it to be added to Shopify's open source directory.

We will be promoting the repo next week on Twitter.

Thank you!

A

{%- if section.settings.slideshow_height == 'adapt' -%}
{% comment %}
'min_aspect_ratio' is the minimum aspect ratio of images shown without
whitespace when 'slideshow_height' is set to 'adapt'.
The aspect ratio values for the first image in the slideshow will be used
unless it is blank, in that case a ratio of 2:1 will be used.
{% endcomment %}

{%- assign first_block = section.blocks[0] -%}
{%- if first_block.settings.image.aspect_ratio == blank -%}
{%- assign min_aspect_ratio = 2.0 -%}
{%- else -%}
{%- assign min_aspect_ratio = first_block.settings.image.aspect_ratio -%}
{%- endif -%}
{% assign wrapper_height = 100 | divided_by: min_aspect_ratio %}
{%- endif -%}

{%- assign text_alignments = section.settings.text_alignment | split: ' ' -%}
{%- assign text_horizontal_alignment = text_alignments.first -%}
{%- assign text_vertical_alignment = text_alignments.last | strip -%}

{%- if section.blocks.size > 0 -%}
{%- for block in section.blocks -%} {%- assign block_image = block.settings.image -%}
{% if block_image == blank %}
{% capture current %}{% cycle 1, 2 %}{% endcapture %} {{ 'lifestyle-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{% if section.settings.show_overlay %}
{% endif %}
{% else %}
{% if section.settings.show_overlay %}
{% endif %}
{% endif %}
        <noscript>
          <div class="slideshow__image"{% if block_image %}{% unless block_image.alt == blank %} role="img" aria-label="{{ block_image.alt | escape }}"{% endunless %} style="background-image: url('{{ block_image | img_url: '2048x' }}'); background-position: {{ block.settings.alignment }};"{% endif %}>
            {% if block_image == blank %}
              <div class="placeholder-background">
                {{ 'lifestyle-1' | placeholder_svg_tag: 'placeholder-svg' }}
              </div>
            {% endif %}
          </div>
        </noscript>

Add theme-liquid-docs to open source directory

The theme developer tools team created a repo here to provide a reference for liquid documentation. This is meant to be a convenient source of truth for developers vs. finding a way to pull liquid objects from shopify.dev

We'd like to add this repo to the open source source directory

cc: @Shopify/theme-developer-tools

shopify-assets gem continuously prepending warning comments

css/main.css file (https://shopify.github.io/css/main.css) has 510 lines worth of the following warning text:

/* ==========================================================
=============================================================

    WARNING! DO NOT EDIT THIS FILE!

    This file is auto-generated by the shopify-assets gem
    and will be overwritten regularily.

=============================================================
========================================================== */

Add listing for unofficial open source, Shopify-related projects.

Hey guys,

I think http://shopify.github.io/ is a great idea, and I love the execution. Just wondering if you guys could see some scope for adding a filter for Shopify-related open source projects that have been created by the developer and designer community.

As an author of a couple of libraries and tools, I've found that discovering other people's projects, as well as getting my own out there, has been a bit difficult. It also leads to the same work being done repeatedly (check out how many Grunt plugins wrapping the shopify_theme gem there are). It would be great to have a central list of those projects that we could refer to, and potentially encourage folks to collaborate on existing tools together.

Thanks!

Gavin

Add Shopify/collins to shopify.github.io

For some reason the gh-pages branch of Shopify/collins isn't showing up.

This is another site (generated by Jekyll) that we'll need to modify to change some things from "tumblr" to "shopify".

According to the github docs, this should already be showing up at shopify.github.io/collins, but i'm guessing that our setup is a little different because we use shopify.github.com as the repo name somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.