Guest Posted February 10, 2003 Share Posted February 10, 2003 Instead of the new Products list i want to have on the starting page of the shop (default.php) some images, one for each category i have. the images should link to the categories. Well i commented out the new Products code and included a table with these images i made for the categories. But it's a problem with the links. I linked to ..../catalog/default.php?cPath=22 ..../catalog/default.php?cPath=23 and so on .. but if i do it like this the Session ID isn`t included so if a user is putting an item into the shopping cart and then come back to the starting page with the images and clicks one of the images to go to an category his shopping cart is empty then. What can i do to include the Session ID to my new Links? Link to comment Share on other sites More sharing options...
Ian-San Posted February 11, 2003 Share Posted February 11, 2003 I dont think it is anything to do with your links - I use something similar for my country buttons on my home page with no problem. You are losing the session - not sure why. Do you store it in MySQL?? Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 You are losing the session - not sure why. Do you store it in MySQL?? No, cause i don't know how to do this. I'm a totaly newbie to MySQL. Maybe my fault is that i use plain HTML code for this links like: <a href="http://www.jewelz-distribution.de/shop/catalog/default.php?cPath=22" onFocus="if(document.all) this.blur()"><img src="http://www.jewelz-distribution.de/shop/jpg/shop_start_1.jpg" width="101" height="117" alt="ringe" border="0"></a> Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 to store sessions in mysql, find the following line in configure.php define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 i've changed the line to define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' but it still deletes the Cart when i click one of these links i included on the default.php the temporary url of the website i'm working on is http://www.copp.tv/index_neu.html . Link to comment Share on other sites More sharing options...
Ian-San Posted February 11, 2003 Share Posted February 11, 2003 I guess it is because you have trapped your shop in an html frameset which cannot handle sessions. Somehow, you need to drop the frameset page you are using or maybe just rename it index_neu.php. Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 just rename it? or should i include any php code into the frameset file? oh and i use two framesets. one frameset (index_neu.html) with one 100% frame and one not visible and in the 100% frame the english or german frameset will be loaded after choosing the language. Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 i've found out it's definitely a problem of the first frameset. the problem is that we use a domain name for the shop like the firm is called but the shop is stored on another domain we have cause the provider where the firm domain is hosted didn't allow MySQL so we put the shop on the website of our other domain. when i open the website from the domain the shop really is on the cart won't be deleted when i click my new links but if i open the website with the firm domain with the frameset that redirects to the domain where the shop is, the cart will be deleted when i click my new links. this don't happens on the other links of the shop only on the 4 links i included with plain HTML code. is there any way to code this links like the "real" oscommerce links? Link to comment Share on other sites More sharing options...
mattice Posted February 11, 2003 Share Posted February 11, 2003 <?php // proper way to create a link with session ID attached echo '<a href="' . tep_href_link('your_page.php', '', 'NONSSL') . '">Click me</a>'; ?> The second param can contain key/value pairs ie: myvar=1 Third is either SSL or NONSSL HTH Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 i can't add this code to catalog/includes/[language]/default.php in this line: define('TEXT_MAIN', ' [here i want to add my images and links] '); all i get are error meassages. Link to comment Share on other sites More sharing options...
mattice Posted February 11, 2003 Share Posted February 11, 2003 Remove that line from default.php and add @include('path/to/your/mainfile.php'); Then write all your stuff in mainfile.php, start with <?php and end with ?> Or install my define_mainpage contribution, it does exactly this through the Admin. Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2003 Share Posted February 12, 2003 thanks for all these good clues but unfortunately they don't work for me. the problem is this "special" situation with the 2 different domains and servers where the shop is running on. when i open the site at the real domain where it is located everything works fine and the cart won't be deleted when i click these HTML links i included. But the shop must run at the real name and domain (where we can't use MySQL on) so if i open this domain (with the frameset that points to the real server) the cart will be deleted at any click of my HTML links. It's all a problem of this single Frameset. If it isn't used everything works fine. :( Link to comment Share on other sites More sharing options...
Ian-San Posted February 12, 2003 Share Posted February 12, 2003 andreas You cannot transfer session ids between servers nor domains so you need another way to set-up your site. Also, you will have trouble with search engines when set up like this as they do not like either frames or redirects. I would suggest that you actually hand-over the site to the second url and just use the original frameset just as a launch page. You would also need to delete or change the header menu items especially the 'shop'. Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2003 Share Posted February 12, 2003 well it seems your right but what i don't understand is why the original osCommerce links work with this situation perfectly but the links i included don't work correct. Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2003 Share Posted February 12, 2003 ... and i'll definitely move the domain to the provider where i have the MySQL database but our boss have pay the old host (high costs) till next year and don't want to pay twice now for a new host and for the old one too so i can't do any changes now (and i really hate it). Link to comment Share on other sites More sharing options...
Ian-San Posted February 12, 2003 Share Posted February 12, 2003 well it seems your right but what i don't understand is why the original osCommerce links work with this situation perfectly but the links i included don't work correct. I think your links are using html pages not php?? HTML cannot handle session ids. Also, you can see from your bottom toolbar that the session id changes each time you go back to the top page - as the top page is outside your php domain. To answer your earlier question, you can just rename the html as php and it might work .... but I do not think that it will not solve the problem of using two domains. Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2003 Share Posted February 12, 2003 I think your links are using html pages not php?? yes the links on the top page use html pages but the links on the default.php (the images) link to default.php?cPath=22 default.php?cPath=23 ... Link to comment Share on other sites More sharing options...
Ian-San Posted February 12, 2003 Share Posted February 12, 2003 Its a guess, but your hardcoded links seem to have the full url and re-load the main site again e.g. they refer to http://www.your-domain.de/shop/catalog/def...lt.php?cPath=22 Try replacing with the correct method as described by mattice above or maybe try link to an actual product to see if it works?? Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2003 Share Posted February 12, 2003 Its a guess, but your hardcoded links seem to have the full url and re-load the main site again e.g. they refer to http://www.your-domain.de/shop/catalog/def...lt.php?cPath=22 yes this came to my mind too and i've changed the link from <a href="http://www.my-domain.de/shop/catalog/default.php?cPath=22" onFocus="if(document.all) this.blur()"><img src="http://www.my-domain.de/shop/jpg/shop_start_1.jpg" width="101" height="117" alt="ringe" border="0"></a> to <a href="catalog/default.php?cPath=22" onFocus="if(document.all) this.blur()"><img src="http://www.my-domain.de/shop/jpg/shop_start_1.jpg" width="101" height="117" alt="ringe" border="0"></a> but if i check the sourcecode of this page when it is online after these changes the link still points to http://www.my-domain.de/shop/catalog/defau...lt.php?cPath=22 i think i'll try mattices contribution to see it it changes anything. Link to comment Share on other sites More sharing options...
Guest Posted February 18, 2003 Share Posted February 18, 2003 i've included the "Define Mainpage" contribution to our shop and the contribution works fine but unfortunately it didn't helped for my problem with the links that clear the cart. what about doing it the way the links in the categories box will be shown? well i know these links in the categories box will be generated from the database. Is it possible to use this? Maybe let generate these links on the mainpage too and instead of the text links show some images? Could this be possible and if yes how can i do this? Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.