Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
I am developing an Embeded App for Shopify, and I have created an Extension that is on the Admin Product Page on the top menu that opens my App page.
On that page, I want to return to the admin product page that openned the App Page, so I tried to redirect directly to: "https://admin.shopify.com/store/mystore/products/8545732395300".
The problem is that shopify will show an error: Refused to display 'https://admin.shopify.com/' in a frame because it set 'X-Frame-Options' to 'deny'.
How can I do this? A simple redirect is not possible from an App?
Bet regards,
Ricardo
I also needed a feature like yours. Following the steps will likely be beneficial for you too. You can see detail. You can review the details in the document below.
https://shopify.dev/docs/api/app-bridge/previous-versions/actions/navigation/redirect-navigate
import {useAppBridge} from "@shopify/app-bridge-react";
import {Redirect} from '@shopify/app-bridge/actions';
export default function Create() {
const app = useAppBridge();
const redirect = Redirect.create(app);
redirect.dispatch(Redirect.Action.ADMIN_SECTION, {
name: Redirect.ResourceType.Product,
resource: {
id: '123',
}
});
}
Thank you for the answer, but my project is in C#... so I cannot use that...
I ended up with finding a solution, not perfect but a working solution...
string url = "https://admin.shopify.com/store/" + domain + "/products/" + shopifyProductId.ToString ("");
// Because the App opens in a Frame inside shopify, we need to pass the parameter "_top"
await jsRuntime.InvokeAsync<object> ("open", url, "_top");
With this solution, the url request jumps outside the IFrame used by shopify to display the App, and it works.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024