Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cart empties when clicking link to products


MikeJandreaudotCom

Recommended Posts

I just installed the STS for a friend's site, and I set up the link to the products section (not using the catagories box), and when someone clicks on that link after adding an item to the cart, it's missing the osCid session number, I linked it directly to index.php?Cpath=21 (which is the products category I set up)

 

Site can temporarily be found here: http://d671123.u36.websitesource.net/store/index.php

 

Anyone know what I'm doing wrong? I know I have to get the osCid in there somewhere, but not sure how to do it with a direct link.

 

Thanks in advance

What's your TopFive? -

Link to comment
Share on other sites

I use direct links and it works fine...? Your cart cotents empties by pushing any link at the top even the cart contents link. Your seesion id is getting lost somewhere. You can try addin $sid to the end of those links and see if that works.

 

-Dennis

Link to comment
Share on other sites

I tried that, it didn't seem to change anything.  The links will now keep the cart contents on anything but the "products" link.  Any other ideas?  Maybe I can try linking the products page another way? Rather than a hard link to the actual category?

 

 

Are you using the tep_href_link function? Or are you hardcoding links?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Two things: you need to make the links with tep_href_link as wizardsandwar suggested ( echo tep_href_link('product_info.php' , 'products_id=41') ) but on the index page the text is normally included (don't know about STS) with a

<?php echo TEXT_MAIN; ?>

statement, where TEXT_MAIN is a "DEFINE". That prevents using PHP, so as suggested in http://www.oscommerce.com/forums/index.php?showtopic=81031&st=0 you should change the "echo" to a "require". I would suggest using:

            <td class="main"><?php 
       //    echo TEXT_MAIN; old, new version to be able to include PHP:
       require(DIR_WS_LANGUAGES . $language . '/text_index_page.inc.php'); ?></td>

In the "required" file: /includes/languages/english/text_index_page.inc.php you can use PHP statements like tep_href_link.

Link to comment
Share on other sites

I think what you have to do is in the link add the sts $sid statement in you href. Example: <a href="/catalog/shopping_cart?products_id=25&$sid"> Add to Cart </a> I think this should work and solve your problem, I had the same problem.

 

I just installed the STS for a friend's site, and I set up the link to the products section (not using the catagories box), and when someone clicks on that link after adding an item to the cart, it's missing the osCid session number, I linked it directly to index.php?Cpath=21 (which is the products category I set up)

 

Site can temporarily be found here: http://d671123.u36.websitesource.net/store/index.php

 

Anyone know what I'm doing wrong? I know I have to get the osCid in there somewhere, but not sure how to do it with a direct link.

 

Thanks in advance

Link to comment
Share on other sites

Two things: you need to make the links with tep_href_link as wizardsandwar suggested ( echo tep_href_link('product_info.php' , 'products_id=41') ) but on the index page the text is normally included (don't know about STS) with a

<?php echo TEXT_MAIN; ?>

statement, where TEXT_MAIN is a "DEFINE". That prevents using PHP, so as suggested in http://www.oscommerce.com/forums/index.php?showtopic=81031&st=0 you should change the "echo" to a "require". I would suggest using:

 ? ? ? ? ? ?<td class="main"><?php 
? ? ? ?// ? ?echo TEXT_MAIN; old, new version to be able to include PHP:
? ? ? ?require(DIR_WS_LANGUAGES . $language . '/text_index_page.inc.php'); ?></td>

In the "required" file: /includes/languages/english/text_index_page.inc.php you can use PHP statements like tep_href_link.

 

 

This won't work with sts as the template does not reconize php. You could add that into a variable. But the $sid thing at the end of your link should work... I use direct links on all my sites and I use sts. I have never had a problem.

 

-Dennis

Link to comment
Share on other sites

  • 2 weeks later...
I think what you have to do is in the link add the sts $sid statement in you href.  Example:  <a href="/catalog/shopping_cart?products_id=25&$sid"> Add to Cart </a>  I think this should work and solve your problem, I had the same problem.

 

For STS, it would be <a href="/catalog/shopping_cart?products_id=25?$sid"> ... use a question mark "?" instead of "&" just before the $sid call

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...