Guest Posted March 19, 2019 Posted March 19, 2019 I embedded my test store into my own page design by inserting a bit of code where I wanted the store to appear. So, something like: <?php $html = file_get_contents('http://mytestdomain.com/store'); echo $html; ?> It looks great, functions beautifully UNTIL (of course) one of the internal links is clicked. Then my site design goes away (and I'm bummed again). I'm attaching a screenshot of what it looks with the store embedded. My question is concerning those internal links, which of course will lead away from the store's front page (and my web page design). Is there no central file I can edit to send a clicked link to one of my own pages (where I would embed a similar code to call up that link's page into my design, as I did with the front page? Or does the random nature of those generated links make this impossible? I realize that osCommerce is not designed to be embedded and that this is not a good idea overall, and could lead to all sort of things; but for the sake of an argument, while I'm just kicking the tires, could you point me into the right direction by explaining what main file controls the links found on the store's front page (or just how front page navigation works)? I realize that I could just buy a template or something and I probably will. For now, I'm just playing. It's how I learn. ☺️
Guest Posted March 20, 2019 Posted March 20, 2019 Please forgive this; I don't mean to bump my thread but I was hoping, since it's at the top, it might be okay? My follow-up question would be that of the possibility of adding a target attribute somewhere in the osCommerce files that would at least ensure that every link opens on the same page or within the same frame, etc.? I think if this is possible, it would make things much simpler for what I'm trying to achieve.
♥JcMagpie Posted March 20, 2019 Posted March 20, 2019 2 simple solutions if I understand your requirment? 1) open in new window so original page is not affected. 2) open in modal again will not affect original page.
♥JcMagpie Posted March 20, 2019 Posted March 20, 2019 So basic link in new tab/window, <a href="https://chilleddisplays.co.uk" target="_blank">The NorthWest Artist Shop</a> To open link in modal popup takes a little more code. The modal, <a data-toggle="modal" class="btn" href="https://chilleddisplays.co.uk/" data-target="#myModal">The NorthWest Artist Shop</a> <div class="modal hide fade modla-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">The NorthWest Artist Shop</h3> </div> <div class="modal-body"> </div> </div> The js script, <script> $('a.btn').on('click', function(e) { e.preventDefault(); var url = $(this).attr('href'); $(".modal-body").html('<iframe width="100%" height="100%" frameborder="0" scrolling="no" allowtransparency="true" src="'+url+'"></iframe>'); }); </script> Should just work, you can use css to style as you like.
Guest Posted March 20, 2019 Posted March 20, 2019 @JcMagpie Thanks for helping with this! Will the second option cause my page to essentially not change, but just the action within it, once an internal link is clicked? I'm getting ready to try it, but I'm unsure which file to place the edit in. Is this put within the echo code I put on my web page to embed the store? There are so many internal links within the store, when you stop and take notice, so I had wondered if every one of those was going to need their own edit or if there was a central file that determines how links are handled that I could just add a target attribute to, that would cause everything to open within the parent page.
♥JcMagpie Posted March 20, 2019 Posted March 20, 2019 😊 The honist answer is I'm not sure as I don't fully understand how you are doing your links? PM me a link and I can try and see waht is happening. But in general the code goes into which ever page you wish the link to appear! you can see it in this test page I made. https://chilleddisplays.co.uk/modal_test.html As you see its just a text link that drives the pop up modal. when you click you get full screen modal for the shop. Try it and see if it's what you need. If not just the first simple link to new tab will do. Depending on what you first site is using ( PHP, HTML , js) you may need to mod the code a bit.
Guest Posted March 20, 2019 Posted March 20, 2019 @JcMagpie I think that is exactly what I want; that looks awesome! If you don't mind, then, I'm PMing you the link to the test page. You can see there that anything clicked (other than my own top nav) that is store-related leads away from the page design. But a pop-up window would solve that problem. (The issue is that when i finish building the site and upload it to the owner's domain, he is very adamant that the store looks just like the rest of the site. Otherwise, I'd leave it.) My confusion over which file to edit comes from the fact that there are so many modal links on this page, so I wasn't sure how to corral them all, since the only store code on the page is the PHP embed code. PMing the link, thanks so much!
Guest Posted March 20, 2019 Posted March 20, 2019 @JcMagpie I really appreciate your taking the time to help me sort this. Having the entire store open as a modal is brilliant! You're the best! 😀
MrPhil Posted March 20, 2019 Posted March 20, 2019 Just exactly what are you trying to end up with here? From the viewpoint of someone using the "outer" website, what is the intended experience? Do you want to have a complete, functioning store running in another browser tab, as a replacement for the original page, as a pop-up, or something else? Is the store to appear within the other site (think: iframe), or is its contents are to remain accessible while in the store, or what? Where are you trying to get to? I'm not sure that you or your client have completely thought this through. Keep in mind, osCommerce, like most other applications, was not written to play nicely with other applications. It thinks it owns the whole thing. There may be session conflicts and other such problems. If your client really needs a smooth seamless interaction between a shop and the rest of the site, you may need to go to a Content Management System.
Guest Posted March 20, 2019 Posted March 20, 2019 Thank you, @MrPhil Those are just the kinds of questions I need to work through. We've tested a lot of shopping cart software and the owner felt that osCommerce is the most user-friendly but, at the same time, he doesn't want the overall page design to change from the rest of the site. Knowing that osCommerce wasn't really intended to be embedded, I just called for it within some div tags to see if the overall look would be okay with him (and it is). So the question, then, was how to implement that without affecting functionality. JcMagpie has suggested just having the store itself open as a modal, so I'm off to test that theory. To be honest, I had thought that iframes weren't going to continue to be supported, so I was trying to avoid them, but I've been Googling around and I guess that isn't necessarily true, after all. I'll also keep a CMS in mind; it's just that we're both hoping to be able to stick with osCommerce. ☺️
Jack_mcs Posted March 20, 2019 Posted March 20, 2019 1 hour ago, IAmGrammy said: So the question, then, was how to implement that without affecting functionality. The appearance is controlled by the user.css file, for the most part. Appearance changes are, to me, the hardest part of creating a new shop because appearance is so subjective. If you are just wanting to match colors, then editing the user.css file is the way to go. If you want certain boxes in certain places, then they can be adjusted in admin. But if you want an exact match to another site, it may not be possible due to how things are handled in Frozen, unless you do away with some of the functionality. I find that, usually, there is no reason for an entrance page and that shop owners want to have it just because it was always there. So you may want to look into replacing it completely with the shop. Regarding iframes, they are relatively easy to hack so they are not a good idea. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Guest Posted March 20, 2019 Posted March 20, 2019 @Jack_mcs It's been a while but I remember being warned once (maybe at StackOverflow?) that browsers would eventually discontinue support for iframes, so I started backing away from them and haven't revisited them in quite a while. But I'm learning now, just Googling around, that whoever gave me that advice may have been a bit premature in his prediction. But I guess the fact that they're an easy hack is reason enough to keep avoiding them. JcMagpie did some sleight-of-hand today and has my entire store appearing as a modal pop-up which is pretty cool, I have to say. It's difficult to argue with the site owner because each page of his site displays some regional artist (or the actual artwork) in the header and he doesn't want to lose that on his store page. But, to me, personally, a store is its own entity and if it looks a bit different, I'm good with it, as long as it's not a loud clash. (Making site owners happy takes up most of my day.) 😃
Jack_mcs Posted March 20, 2019 Posted March 20, 2019 35 minutes ago, IAmGrammy said: But I'm learning now, just Googling around, that whoever gave me that advice may have been a bit premature in his prediction. Whether it goes or not would be up to the browsers for the most part. But that doesn't mean they should be used since they are a security threat. And without special coding, they are not responsive. While the shop in a popup might look good, it is a bad idea. What happens if some opens the popup, spends an hour adding products and then closes it? The answer is that the session ID would be destroyed and all of their time wasted. The same thing would happen if they opened the shop directly but I think the chances are higher for it to happen with a popup but maybe not. I still don't see the purpose of it. Having it open in a new tab would be a better choice, in my opinion. While popups via dialogs are usually not blocked by firewalls, it is possible to do so. That would make your shop unavailable to those people. Just because you can do something doesn't mean you should. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Guest Posted March 20, 2019 Posted March 20, 2019 Yes, a simple "new tab" was suggested in the beginning and I agree that it's the logical thing. I'll just present my case to the site owner again. 😕
♥JcMagpie Posted March 20, 2019 Posted March 20, 2019 😊 Not a big issue, The new tab was the first recommendation and should work fine, but if you don't like iframes no matter try something else, all you need is some thing to pull the url into the modal. Try something like this, replace iframe with object or embed <object data="https://chilleddisplays.co.uk" width="100%" height="100%"></object> or <embed src="https://chilleddisplays.co.uk" width="100%" height="100%"> Works fine set the css to how you like. Take a look . https://chilleddisplays.co.uk/modal_test2.html
Jack_mcs Posted March 20, 2019 Posted March 20, 2019 9 minutes ago, JcMagpie said: https://chilleddisplays.co.uk/modal_test2.html I haven't tried this approach but I think this method would destroy the sites SEO. Search engines can't normally click buttons so the shop would never get indexed. The button could be changed to one they will follow (using javascript) but then what would the url be? There is also an additional problem with mobile versions since a popup like this would be considered a non-friendly one so the ranking for the page, if it were possible, would probably be lowered. The approach is a good way to go for some things but, in my opinion, should not be used for the shop. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
MrPhil Posted March 20, 2019 Posted March 20, 2019 Certainly, adjusting colors, fonts, text sizes, etc. can be fairly easily done in user.css, to more-or-less match the appearance of the rest of the site. Even adjusting box sizes and placement can be done, to an extent. If the owner wants some picture related to a certain artist to be shown in the osC header area, that might even be possible (look at banner add-ons, or hard code changes to certain files). A full-screen store is not necessarily going to look just like the rest of the site, but you can harmonize its appearance so that it looks fairly well integrated. Once a customer has checked out, you could add a button in osC to send them back to some point on the main site (rather than having to hit "Back" multiple times). Just keep in mind that if the customer leaves osC early to jump to some other point on the main site, they may lose their session (shopping cart contents and logged-in status). If their cart is not empty when they press a button to leave the store, perhaps there could be a pop-up to confirm that they really want to do that. Also, don't write a fixed-name file with contents specifying which artist's work is to be displayed, as the most recent visitor's choice will wipe out earlier selections -- you'll need to work that into the session, or carry it along in the URL Query String. I think that jumping to an osC store as owning the entire screen, rather than trying to bend things into an iframe, modal pop-up, or whatever; will end up being easier to deal with for everyone concerned, so long as there's an easy way to jump back to the main site (navigation within osC). Per Jack's note, as normal site pages they should be properly indexed by search engines. Note that osC (Frozen) will be mobile-friendly -- does the current site use Bootstrap to behave in a similar mobile-friendly way?
Guest Posted March 20, 2019 Posted March 20, 2019 I appreciate all the insight and advice. I commented in my opening post that I realized that this might not be a good idea, overall, but it's good to read through the discussion as to why this is true. I'll focus on styling the store itself, then, rather than wedging it into my existing page. However, I must say I'm impressed by JcMagpie's modal solution. I can think of so many other applications to use this for that are not store-related. Pretty cool! Thank you guys. 😊
♥JcMagpie Posted March 21, 2019 Posted March 21, 2019 14 hours ago, Jack_mcs said: but I think this method would destroy the sites SEO. You may be right Jack I have no idea regarding SEO but the site looks to work fine with no issues. I was simply giving one of a number of options to a question asked. The OP will have to decide what's best for them. A simple open in new tab was my first recommendation and allways would be. Also better not to try and embed the shop into the other site but keep it a simple link to shop. I have seen a number of these types of sites embeding osC into the body of another site, never seen a good implementation yet. It's normaly done to keep some sort of old header or page layout but I think time would be better spent making osC look like you need but that's just my opinion. Anyway I'm sure the OP will find the modal code usfull for giving customers nice large views of the artwork 😊 or somthing else.
Guest Posted March 21, 2019 Posted March 21, 2019 2 hours ago, JcMagpie said: Anyway I'm sure the OP will find the modal code usfull for giving customers nice large views of the artwork 😊 or somthing else. @JcMagpie That is exactly what I was thinking! It is, after all, an art gallery, ha! As far as the look of the store, I'm just tinkering around now with being able to get a header up above the Bootstrap navbar, so that it is not the topmost thing in the store, but the header is. I think that will satisfy the customer. I've not discovered yet if there is some box I can put there and then modify; it does look as if the navbar is naturally meant to be the topmost thing. But I'll keep stabbing away at it. There are other shopping carts (like Stiva) that do plug directly into your own web page but they are so far below osCommerce in actual function, that it's sad. For instance... a customer cannot track their order history! It's nowhere in their account! I asked them about this and they seemed surprised that anyone would even want to! Even though I know I could just plug Stiva in and go, I'd rather keep working with osCommerce, because you can't beat it for pure function. It really does take the customer's needs into account. Anyway, rambling now, but yes to using the modal code for displaying artwork! 😊
Recommended Posts
Archived
This topic is now archived and is closed to further replies.