ET-TAOUSY Zouhair ET-TAOUSY Zouhair - 22 days ago 6
PHP Question

Shopify get parameters from home page

I'm beginner as

shopify
partner and I want to get parameters from home page using proxy app.

Url : mystore.myshopify.com/client_id=value

I want to get client_id via
shopify
app. What I have to do in path_prefix in proxy configuration.

Here more detail about what i want to get the parameters that I want with proxy configuration and nothing received when visting home page\

parameters that I want:

parametters that i want

Proxy configuration:

this configuration
Thanks in advance.

Answer

Here is the solution.

is to created a file Js in theme and send it via app proxy like what i do here.

`var client_id = getUrlParameter('client_id'); jQuery(function($){

    /*  app proxy in jQuery*/            
    var base_urlc = window.location.hostname; //grab shop url
    var window_width = $(window).width();  //save width
    $.ajax({
        type: "GET",
        url: "/apps/client",
        contentType: "application/json",
        data: {client_id:client_id}
    })
    .done(function( msg ){
        console.log( msg );
    });

});`

Thanks anyways

Comments