Post by david3217 » Fri Jan 03, 2020 4:47 pm

Hi there,
I am developing a mod for our OpenCart 2.3.0.2 stores, and am running into a bit of a problem.
The mod needs to request product details from store A and return them to be displayed on store B, but I assume because it is going cross-domain, it is returning the "No 'Access-Control-Allow-Origin' header is present on the requested resource" error in console.
The mod will be displayed on a subdomain which is setup as a separate store in our multi-store installation, this has to be done for a variety of back-end reasons, unfortunately.

Can anyone point me in the right direction to get this figured out?
Last edited by david3217 on Sun Jan 05, 2020 12:32 pm, edited 1 time in total.

Newbie

Posts

Joined
Tue Apr 30, 2019 3:59 pm

Post by ADD Creative » Fri Jan 03, 2020 7:32 pm

The Access-Control-Allow-Origin header and how to use it is described here. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

However, if the second domain is set up as a multi-store, can you not just access the database directly rather than doing a request to a different domain?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Sat Jan 04, 2020 12:31 am

If Store A and Store B are both located on the same domain, you could use Ajax requests with cross-domains as the ones already integrated in OC with the APIs.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 141 guests