secretpizzaparty / shopify-connect-for-woocommerce

Shopify Connect for WooCommerce Plugin
https://secretpizza.party
GNU General Public License v2.0
10 stars 2 forks source link

Redirects #14

Closed nickhamze closed 8 years ago

nickhamze commented 8 years ago

For some reason on my test site (http://shop.secretpizza.party/) none of the redirects are working. I can still hit the cart page (http://shop.secretpizza.party/cart/) and the backend links still take me to the WC pages not the Shopify ones. I see the code is there for the redirects (so I have the newest version of the code) just not sure why they aren't working.

jkudish commented 8 years ago

Are you sure you're running the latest version from Github? Redirects were some of the last things added.

Can you check to see if there's any messages in your error logs?

nickhamze commented 8 years ago

Now it works I was sure I had the latest version but maybe I was wrong.

However it links to the wrong site, it's linking to https://embeds.myshopify.com/admin/auth/login but my connected shopify store is a regionally-famous.myshopify.com

nickhamze commented 8 years ago

While the internal redirects work I'm still able to access the cart and such: http://shop.secretpizza.party/cart/

I added you to the site in case maybe I'm just doing something wrong.

nickhamze commented 8 years ago

With the embeds.myshopify.com links. I was having trouble getting a new product to shop up in the Shopify modal so I disconnected and reconnected and now the link is correct. Not sure why that fixed it but I'll try to reproduce again.

jkudish commented 8 years ago

I committed something that might fix the cart redirect, please try again with the latest version.

With the embeds.myshopify.com links. I was having trouble getting a new product to shop up in the Shopify modal so I disconnected and reconnected and now the link is correct. Not sure why that fixed it but I'll try to reproduce again.

It sounds like the option wasn't saved correctly on your site. Perhaps while running development versions of something. If you can reproduce this again, do let me know so we can address it.

nickhamze commented 8 years ago

The cart redirect is working good but is there anyway we could make it work without having it append #shopify_cart to the end of the url, it looks kinda messy to me.

jkudish commented 8 years ago

I need to pass the info in somehow via the url. What I could do is remove it as soon as the redirect is done, so it'll flash for a second . Does that work?

On Sat, Aug 13, 2016, 1:06 PM Nick Hamze notifications@github.com wrote:

The cart redirect is working good but is there anyway we could make it work without having it append #shopify_cart to the end of the url, it looks kinda messy to me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14#issuecomment-239639022, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP4nSiQ4sPeVbhpIcmmXGID00dxmlN1ks5qfiPUgaJpZM4JjMSI .

nickhamze commented 8 years ago

That would work fine.

jkudish commented 8 years ago

K will do

On Sat, Aug 13, 2016, 1:09 PM Nick Hamze notifications@github.com wrote:

That would work fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14#issuecomment-239639158, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP4nYc8etbo8v-yrRDLJWy9BZkBG5XWks5qfiSEgaJpZM4JjMSI .

jkudish commented 8 years ago

Done!

nickhamze commented 8 years ago

So I installed everything on a different domain that has never had any form of the plugin installed (blog.nickhamze.com) and the redirects aren't working (all the WC pages still load) like when I tried it on my shop domain. Any idea? I can add you to the site if you want to take a look. I made sure I was using the latest version of the code.

jkudish commented 8 years ago

I'll try myself first and see.

On Sun, Aug 14, 2016, 12:18 PM Nick Hamze notifications@github.com wrote:

So I installed everything on a different domain that has never had any form of the plugin installed (blog.nickhamze.com) and the redirects aren't working (all the WC pages still load) like when I tried it on my shop domain. Any idea? I can add you to the site if you want to take a look. I made sure I was using the latest version of the code.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14#issuecomment-239691191, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP4nfLXlJo9R8ETYhDvEz7lIUwJ7C0oks5qf2oYgaJpZM4JjMSI .

jkudish commented 8 years ago

So the Shopify plugin doesn't save the option with the site's url until you select this (screenshot below) under Shopify > Customize. That's kind of odd, and I'm going to investigate if we can force it to save when the site is connected instead.

screen shot 2016-08-14 at 2 01 12 pm

This brings up a few good questions from my end though:

Any thoughts on the above @nickhamze ?

jkudish commented 8 years ago

Yeah so there's not really any way that I can find to capture the store URL until that cart option is selected and at least one product embed is added. It's really odd and I don't really like the way that the shopify plugin is coded in this respect. Everything is iframe based from the Shopify side and they don't really relay/save the information to the WordPress site until it's absolutely required.

I think our best/safest bet will be to add a minimal options page or add a field to one of the existing pages, for the user to enter the shopify URL. Not ideal, but the only way we can be certain we have the URL.

Thoughts before I proceed? Where do you think this option should go?

nickhamze commented 8 years ago

We probably should force the cart option if possible.

How is that option saved on the WordPress side? So there isn't anyway that we can just set it to "cart" when our plugin is activated?

If we can't set it ourselves maybe we can just redirect them to that page (/wp-admin/admin.php?page=shopify_ecommerce_plugin_customize) when they activate the plugin if the setting isn't set with an admin notice telling them to select the cart option.

Until they select the cart option we probably should just hide those links as I really don't want them ever being able to access those pages. I really like being able to give them links to their shopify dashboard but I think the plugin works ok without them. I just don't want them accessing those pages. I don't like the links enough to complicate the UI with a shopify url field.

jkudish commented 8 years ago

Okay... While testing this, I also noticed that it also seems to set the url to that embeds site you had encountered. I haven't yet figured out why it does that and when it gets correctly set to the actual shopify site. Seems a bit buggy... I'll investigate it further but that's why I wanted to suggest the url field first.

Hiding all those pages will also be fairly involved, more than some of the other things I've hidden so far, especially the order pages from WooCommerce.

I do think the field might make things easier overall, but I hear you about it complicating the UI.

I'll revisit this on Tuesday as I'm going afk now.

On Sun, Aug 14, 2016, 2:52 PM Nick Hamze notifications@github.com wrote:

We probably should force the cart option if possible.

How is that option saved on the WordPress side? So there isn't anyway that we can just set it to "cart" when our plugin is activated?

If we can't set it ourselves maybe we can just redirect them to that page (/wp-admin/admin.php?page=shopify_ecommerce_plugin_customize) when they activate the plugin if the setting isn't set with an admin notice telling them to select the cart option.

Until they select the cart option we probably should just hide those links as I really don't want them ever being able to access those pages. I really like being able to give them links to their shopify dashboard but I think the plugin works ok without them. I just don't want them accessing those pages. I don't like the links enough to complicate the UI with a shopify url field.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14#issuecomment-239700066, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP4ncFGzo-fcCn_BDFsDIdH4BN3kJ3Rks5qf440gaJpZM4JjMSI .

nickhamze commented 8 years ago

Can you just unhook admin menu links? Not worried about them being hidden completely. It's not the end of the world if they somehow stumble upon those screens.

On Aug 14, 2016 5:06 PM, "Joey Kudish" notifications@github.com wrote:

Okay... While testing this, I also noticed that it also seems to set the url to that embeds site you had encountered. I haven't yet figured out why it does that and when it gets correctly set to the actual shopify site. Seems a bit buggy... I'll investigate it further but that's why I wanted to suggest the url field first.

Hiding all those pages will also be fairly involved, more than some of the other things I've hidden so far, especially the order pages from WooCommerce.

I do think the field might make things easier overall, but I hear you about it complicating the UI.

I'll revisit this on Tuesday as I'm going afk now.

On Sun, Aug 14, 2016, 2:52 PM Nick Hamze notifications@github.com wrote:

We probably should force the cart option if possible.

How is that option saved on the WordPress side? So there isn't anyway that we can just set it to "cart" when our plugin is activated?

If we can't set it ourselves maybe we can just redirect them to that page (/wp-admin/admin.php?page=shopify_ecommerce_plugin_customize) when they activate the plugin if the setting isn't set with an admin notice telling them to select the cart option.

Until they select the cart option we probably should just hide those links as I really don't want them ever being able to access those pages. I really like being able to give them links to their shopify dashboard but I think the plugin works ok without them. I just don't want them accessing those pages. I don't like the links enough to complicate the UI with a shopify url field.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14# issuecomment-239700066, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP4ncFGzo-fcCn_ BDFsDIdH4BN3kJ3Rks5qf440gaJpZM4JjMSI .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jkudish/shopify-connect-for-woocommerce/issues/14#issuecomment-239700708, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJsxunYmydtDe-7-yo5SK3CzwvYbWo3ks5qf5FxgaJpZM4JjMSI .

jkudish commented 8 years ago

Can you just unhook admin menu links?

Okay, that's done now.


The way the shopify site URL is saved on the WordPress site is is really weird. After experimenting with it, I found that the correct steps to get the site to save as an option on the WP side is:

It seems a bit buggy -- I even see that they use two different option names in the code, and only one is correct. It feels like they didn't really think it through to the end. Maybe something we can get in touch with them to fix; especially since there isn't really a way for me to grab the url out of their iframes.

I think i've done all I can here @nickhamze, with the redirects in place when possible (I check for embeds.shopify.com too) and everything unhooked/hidden if not possible.

Let me know how it's looking!

nickhamze commented 8 years ago

Sounds good. I'll give this bad boy one final run through and then let's get it launched.

I have a call scheduled with Joel Bronkowski so if you have anything else you think should be fixed in the Shopify plugin let me know and I'll pass it along.

jkudish commented 8 years ago

Don't have anything else to add at the moment. Maybe you can suggest they add more hooks to make it easier to customize in the future ;)