script tag

55 views
Skip to first unread message

synapse

unread,
Oct 3, 2011, 9:36:22 AM10/3/11
to shopi...@googlegroups.com
We are using the API to crate the script tag for the store and the we are having the following problem:

1. We are unable to get the amount ({{total_price}})
and transaction ( {{order_number}}) variable in remote
JavaScript which we have injected through the script tag API

2. Also, we are unable to get the order id in url of thank you page. We have placed the 4 order and all the order id is same of the url. The URL is

First order :https://checkout.shopify.com/orders/1023222/22f01e0f36bf5121a296b056dd6578c1

Second order: https://checkout.shopify.com/orders/1023222/381992e8916620908dccb64f8053000c

Third order: https://checkout.shopify.com/orders/1023222/78f86bcddf6e7461b1d367593a835dad

Fourth order: https://checkout.shopify.com/orders/1023222/69f4216346fe1d0bc84327766d865608

The order id (1023222) in above url are always same and we not able to get the order information using this order id .

However we have get the all orders of the store then this is "1023222" does not exist any ware in the order information.

We want to fetch the intent order information and update the database. Please suggest how to archive this using script tag API.

Dave

unread,
Oct 3, 2011, 11:08:37 AM10/3/11
to shopify-api
that is NOT your order ID... that is your SHOP ID, that is why it is
always the same.

If you inject a script tag in there... you will have to scrap DOM to
get the shopify order number... which by the way, is an artificial
construct... it is made up by the Shop keeper so that they can pretend
that their shop actually has orders.. so it could be 4500 or 666666 or
889191919 for all you know... and then the actual order ID is found by
arbitrarily removing 1000 from that?

And then, you can use the API to query for that order number, which
will get you the order, which has a totally different ID.

Hope that helps.... have fun


On Oct 3, 9:36 am, synapse <synapse...@gmail.com> wrote:
> We are using the API to crate the script tag for the store and the we are
> having the following problem:
>
> 1. We are unable to get the amount ({{total_price}})
> and transaction ( {{order_number}}) variable in remote
> JavaScript which we have injected through the script tag API
>
> 2. Also, we are unable to get the order id in url of thank you page. We have
> placed the 4 order and all the order id is same of the url. The URL is
>
> First order
> :https://checkout.shopify.com/orders/1023222/22f01e0f36bf5121a296b056d...
>
> Second order:https://checkout.shopify.com/orders/1023222/381992e8916620908dccb64f8...
>
> Third order:https://checkout.shopify.com/orders/1023222/78f86bcddf6e7461b1d367593...
>
> Fourth order:https://checkout.shopify.com/orders/1023222/69f4216346fe1d0bc84327766...

Denis Odorcic

unread,
Oct 3, 2011, 11:15:59 AM10/3/11
to shopi...@googlegroups.com
The actual ID of the object is unique in Shopify's database, so multiple shops can have the same order number, but won't have the same ID. Removing 1000 won't really get you anywhere. You can use whatever Shopify is displaying as the Order # (like 4500) to query and find the Order as it maps to the name attribute on the Order object.

ShopifyAPI::Order.find(:all, :params => {:name => "#4500"})

Developer - Shopify

Dave

unread,
Oct 3, 2011, 11:26:27 AM10/3/11
to shopify-api
Right... my point was simply that:

An order has attributes:
name
number
id

All refer to an order... and there is a relation between name and
number, where number is derived from name, which can be seeded from
the admin by the client.


On Oct 3, 11:15 am, Denis Odorcic <denis.odor...@jadedpixel.com>
wrote:

synapse

unread,
Oct 3, 2011, 11:39:21 AM10/3/11
to shopi...@googlegroups.com
when we have placed the order then reached on the thank you page url https://checkout.shopify.com/orders/1023222/22f01e0f36bf5121a296b056dd6578c1
can we get the order id from this url ?

Please suggest if we can call some other php script in remote java script file which is inject through the script tag ? 

Tariehk Geter

unread,
Oct 3, 2011, 2:32:47 PM10/3/11
to shopi...@googlegroups.com
The developer is trying to do a remote call using AJAX to a php file.  The main issue is we are trying to pull in the total and the order id into the javascript that we would insert on the thank you page code and he is having a hard time doing this.  He had wrote me and said:

we have try to call the php using remote script tag but shopify not allow to call the external php using ajax

Can you please help on this.  Thanks.

Reply all
Reply to author
Forward
0 new messages