Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display shopping cart info.....


BigMike7801

Recommended Posts

I would like to display the info from the shopping cart on non OSC pages such as the main page of the website or other pages. Is this possable to do? I've tried searching the forums with no luck. Any help would be appreciated.

 

Thanks - Big Mike

 

You can do that, I have, however it does get a little tricky with paths and things like that. I assume you want to do something like post some product links on your main page, and that your installation of osC is in /catalog/ or something similiar.

 

What I did in this one instance was to display a list of the new products on the main index page. osC was installed in /catalog/. So I added application_top.php and application_bottom.php to the file in the normal places. Then I added the code to display the new products in the main body of the page. I thought that I would be good to go, but had issues with some of the paths that were coded inside application_top. So I ended up making a copy of application_top and application_bottom and putting those off of the site root, and modified the include links inside them. Generally not the best idea to have two versions of the "same" file in different locations, but I was able to make everything work correctly.

 

Be well,

Tina

If you're not having fun you're not doing it right

 

Teach a person to fish rather than give them a loaf of bread or however that saying goes.

Link to comment
Share on other sites

You can do that, I have, however it does get a little tricky with paths and things like that. I assume you want to do something like post some product links on your main page, and that your installation of osC is in /catalog/ or something similiar.

 

What I did in this one instance was to display a list of the new products on the main index page. osC was installed in /catalog/. So I added application_top.php and application_bottom.php to the file in the normal places. Then I added the code to display the new products in the main body of the page. I thought that I would be good to go, but had issues with some of the paths that were coded inside application_top. So I ended up making a copy of application_top and application_bottom and putting those off of the site root, and modified the include links inside them. Generally not the best idea to have two versions of the "same" file in different locations, but I was able to make everything work correctly.

 

Be well,

Tina

 

Not quite sure I'm understanding what you're saying. Do you have al ink to the site in which you did this?

 

Thanks - Big Mike

Link to comment
Share on other sites

Not quite sure I'm understanding what you're saying. Do you have al ink to the site in which you did this?

 

Thanks - Big Mike

 

The site is question is adult related and these being "G" rated forums I don't feel its appropriate to post the link here, and no that's not my speciality lol. So let me maybe try to explain a little further, and of course I am making some assumptions as to what you want to do.

 

You have an osC installation, lets say its the default so you have it in www.yoursite.com/catalog. Now you can add extra pages etc if you want in that catalog folder, no problem really. However now you are talking about putting some components of osC in your root folder i.e. www.yoursite.com/

 

By components I'm generally referring to product listings, I suppose there could be other things but nothing comes to mind right now. Anyway for any page in that catalog folder there are two files that are always "included", those being application_top.php and application_bottom.php. application_top is kind of like a bootstrap file, it makes the database connections, sets up the language file, etc. And application_bottom does clean up activities.

 

So if you are going to display components in a file that resides a folder level above /catalog/ you need to make some path adjustments that you would not have to make if the file were in /catalog/. In other words you couldn't have:

require('includes/application_top.php');

 

it would have to be

require('catalog/includes/application_top.php');

 

However the problem in doing that is that within application_top are other included files, and their paths would be out of kilter, so you would have to find some other way to accomodate that.

 

Hopefully that makes more sense, and hopefully I didn't completely misunderstand your question, in which case now we are both completely confused :)

 

Be well,

Tina

If you're not having fun you're not doing it right

 

Teach a person to fish rather than give them a loaf of bread or however that saying goes.

Link to comment
Share on other sites

No I think we're on the same track. It would just help to have the actual code you used as an idea. the link to my site that i'm doing is http://www.habfgiftshop.com. And I want to be able to display the shopping cart info from the oscommerce install at http://habfgiftshop.com/habfgiftshoponline...talog/index.php on the main page http://www.habfgiftshop.com where it says "Shopping cart 0 itmes" So in that table would I have to use the application_top.php and application_bottom.php then some how link that to my new files and shoppingcart.php or what ever it's called.

 

If you would like to e-mail me the address for the website so I can take a look at the code my e-mail addy is [email protected]

 

Thanks for the help - Big Mike

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...