Post by fvteamsports » Tue Mar 15, 2016 2:35 am

I'm looking for an extension or php to do the following:

A small simple form that can be placed on my main default opencart store that says "enter your store id here" and a text box for them to enter a code. By them entering a specific "store code" they will then be redirected to their Multi-store, or even an specific external url based on what was entered.

In other words, a centrally located place (located on my default store) to launch any multi-store based on a code entered in a text box.

Thank you, Jim

Newbie

Posts

Joined
Fri Feb 19, 2016 12:11 am

Post by IP_CAM » Wed Mar 16, 2016 4:39 am

such does not exist (yet) for opencart, as per my (limited )knowledge.
Ernie
openshop.li

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by artcore » Wed Mar 16, 2016 5:20 am

There's a built in module that lists all multi-stores in a dropdown.
admin>extensions>modules>store

Not based on an input code but might be good for what you're after.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by budgetneon » Wed Mar 16, 2016 5:30 am

fvteamsports wrote:I'm looking for an extension or php to do the following:

A small simple form that can be placed on my main default opencart store that says "enter your store id here" and a text box for them to enter a code. By them entering a specific "store code" they will then be redirected to their Multi-store, or even an specific external url based on what was entered.

In other words, a centrally located place (located on my default store) to launch any multi-store based on a code entered in a text box.

Thank you, Jim
You could implement that solely with html/javascript...

Like this: http://codepen.io/anon/pen/wGoQMz
(note that it won't actually send to the url, but only because codepen.io runs the javascript in a frame. This would work on a normal site.)

New member

Posts

Joined
Sat Sep 20, 2014 11:32 pm


Post by fvteamsports » Tue Mar 22, 2016 3:45 am

I tried adding that script in the header and also tried to call for it and I can not get it to work. It looks like it should work.

Thanks for the help!

Newbie

Posts

Joined
Fri Feb 19, 2016 12:11 am

Post by fvteamsports » Thu Mar 24, 2016 10:12 am

Does anyone know what is wrong with the code below? Should be able to type in YAHOO and go to yahoo.com. The submit box doesn't even show up on my opencart page?


<html>
<head>
<script>
document.getElementById("gobutton").addEventListener("click", function(event){
event.preventDefault()
var idmap={
REDDIT:"http://reddit.com",
YAHOO:"http://yahoo.com",
BING:"http://bing.com"
};
id=document.getElementById("siteid").value;
if (id in idmap) {
alert("going to "+idmap[id]);
window.location.href=idmap[id];
} else {
alert("invalid code ["+id+"]")
}
event.preventDefault()

});
</Script>
</Head>
<Body>

<form id="urllauncher" action='#'>
<label for="siteid">Site id</label>
<input type="text" id="siteid">
<button type="submit" id="gobutton">Go</button>
</form>

</Body>
</Html>

Newbie

Posts

Joined
Fri Feb 19, 2016 12:11 am
Who is online

Users browsing this forum: Semrush [Bot] and 21 guests