Skip to content

Instantly share code, notes, and snippets.

@savchukoleksii
Last active April 26, 2023 16:39
Show Gist options
  • Save savchukoleksii/3f8094e1e5020c52879e6fd0e4e6150a to your computer and use it in GitHub Desktop.
Save savchukoleksii/3f8094e1e5020c52879e6fd0e4e6150a to your computer and use it in GitHub Desktop.
Shopify Cookies description

storefront_digest - password protection of store default is null

Can add ?password= to make request under protection


_landing_page - password page?


cart_currency - currency of cart


secure_customer_sig - logged in customer cookie


Login

form_type - const value
utf8 - const value \

url: /account/login
accept-charset="UTF-8"
method: POST
params:
form_type: customer_login
utf8: ✓
customer[email]: email
customer[password]: password \

On success
set cookie to logged in user
On error
response 302
message: Invalid login credentials.


Forgot password

url: /account/recover
accept-charset="UTF-8"
method: POST
params: \ form_type: recover_customer_password
utf8: ✓
email: email \

On error:
request 302 Found
message: No account found with that email.\


Newsletter

url: /contact#ContactFooter
accept-charset="UTF-8"
method: POST
params:
form_type: recover_customer_password
utf8: ✓
contact[tags]: newsletter
contact[email]: email \

On success:
response 302
add query param ?customer_posted=true \


Search

url: /search
accept-charset="UTF-8"
method: GET
params:
form_type: recover_customer_password
utf8: ✓
q: request \


Add address\

url: /account/addresses
accept-charset="UTF-8"
method: POST
params:\ form_type: customer_address
utf8: ✓
address[first_name]: first_name
address[last_name]: last_name
address[company]: company
address[address1]: address1
address[address2]: address2
address[city]: city
address[country]: country
address[province]: province
address[zip]: zip
address[phone]: phone
address[default]: default default 1


EDIT address

url: /account/addresses/address_id>
accept-charset="UTF-8"
method: PUT
params:
form_type: customer_address
utf8: ✓
address[first_name]: first_name
address[last_name]: last_name
address[company]: company
address[address1]: address1
address[address2]: address2 \
address[city]: city \
address[country]: country \
address[province]: province \
address[zip]: zip \
address[phone]: phone
address[default]: default - default value 1 \
_method: put \


DELETE address

url: /account/addresses/address_id
accept-charset="UTF-8"
method: DELETE
params:
_method: 'delete'\


Also in Shopify variable we have method: Shopify.postLink:
https://gist.github.com/DanWebb/0e32f2dc452aba06adae

Shopify.postLink = function(t, e) { e = e || {}; var n = e.method || "post" , i = e.parameters || {} , o = document.createElement("form"); o.setAttribute("method", n), o.setAttribute("action", t); for (var r in i) { var l = document.createElement("input"); l.setAttribute("type", "hidden"), l.setAttribute("name", r), l.setAttribute("value", i[r]), o.appendChild(l) } document.body.appendChild(o), o.submit(), document.body.removeChild(o) }

App proxy set response by type of response for example request.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment