Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

InfoBox Anywhere with PHP


clarocque

Recommended Posts

  • 2 months later...

Hello,

 

i am trying to use your contribution. The Integration on my website was no problem.

 

I want to use the shopping cart on another website.

 

The shop domain is: shop.wilke.de

The website domain is : www.wilke.de

 

First attempt: http://www.wilke.de/shop.php

 

The problem is that the shopping cart on my website is not showing the products i added on the shop-site. I think it is a cookie problem.

 

What can i do?

 

 

BTW: Sorry for my bad english, i am from germany. :-"

Link to comment
Share on other sites

I am having the same problem as Koegs. I got everything else working (I used the idea/method of your contribution and modified it so that it would pull in the whole left column instead of each infobox). However, the shopping cart infobox is not listing any products. I've been toying with it for awhile, and I even tried moving the page that it was being called from in to the same directory as the osc install thinking that may help what i thought was a cookie issue. Needless to say, it didn't.

 

Any advice on this would be very helpful!

 

Thansk for the contrib clarocque!

Link to comment
Share on other sites

Hello,

 

i am trying to use your contribution. The Integration on my website was no problem.

 

I want to use the shopping cart on another website.

 

The shop domain is: shop.wilke.de

The website domain is : www.wilke.de

 

First attempt: http://www.wilke.de/shop.php

 

The problem is that the shopping cart on my website is not showing the products i added  on the shop-site. I think it is a cookie problem.

 

What can i do?

BTW: Sorry for my bad english, i am from germany.  :-"

 

 

It is not designed for shopping carts. All this contribution is to allow you to load boxes from osC stores. If you want to use the functionality of things like cart you will have to modify the existing page to support that. The contibution is for simnple get contents of things liek specials.

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • 1 month later...

Although it doesn't look like this contribution is being supported I am going to ask a question anyhow with hopes someone may know what is going on.

 

I have one site I am working on. Same files online and on my computer.

Contribution works great on my computer but won't work online. Both have php 4.3.1.

 

I changed the code from

localhost/supply.php?box=shopping_cart

on my computer to

wendy.digitalreject.com/supply.php?box=shopping_cart

on the web

 

it has the http:// but i took it off here so it wont make clickable links. :)

 

According to this contribution that is the only thing that needs to be changed.... sooooooo My question is any idea why it would work on my computer but not online?

 

I get this error

ERROR - Either this page is not available or this option is not added to the list of authorized elements.

But that doesn't tell me a thing since it is the stock error written into this contribution.

 

Thanks in advance!

 

 

 

Back, and incase anyone else has this problem I figured I would post the fix. Atleast what fixed it for me.

 

My host has fopen shut off so I had to change the code from

# InfoBox Anywhere with PHP by clarocquevt --------------------------------# 
# Format: http://www.domain.com?box=xx                                     #
$value=@file_get_contents('http://url.com/supply.php?box=categories'); 
#--------------------------------------------------------------------------# 
($value)
 ? $results = $value
 : $results = 'ERROR - Either this page is not available or this option 
 is not added to the list of authorized elements.';
echo $results;
# eof InfoBox Anywhere with PHP by clarocquevt ----------------------------#

to

# InfoBox Anywhere with PHP by clarocquevt --------------------------------# 
# Format: http://www.domain.com?box=xx                                     #
$curl_handle = curl_init();
// Where should we get the data?
curl_setopt ($curl_handle, CURLOPT_URL, 'http://url.com/supply.php?box=categories');
// This says not to dump it directly to the output stream, but instead
// have it return as a string.
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
// the following is optional, but you should consider setting it
// anyway. It prevents your page from hanging if the remote site is
// down.
curl_setopt ($curl_handle, CURLOPT_CONNECTTIMEOUT, 1);
// Now, YOU make the call.
$buffer = curl_exec($curl_handle);
// And tell it to shut down (when your done. You can always make more
// calls if you want.)
curl_close($curl_handle);
// This is where i?d probably do some extra checks on what i just got.
// Paranoia pays dividends.
print $buffer;
#--------------------------------------------------------------------------#

 

Hope this can help someone in the future. :)

Edited by wendyjames

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Although it doesn't look like this contribution is being supported I am going to ask a question anyhow with hopes someone may know what is going on.

 

I have one site I am working on. Same files online and on my computer.

Contribution works great on my computer but won't work online. Both have php 4.3.1.

 

I changed the code from

localhost/supply.php?box=shopping_cart

on my computer to

wendy.digitalreject.com/supply.php?box=shopping_cart

on the web

 

it has the http:// but i took it off here so it wont make clickable links. :)

 

According to this contribution that is the only thing that needs to be changed.... sooooooo My question is any idea why it would work on my computer but not online?

 

I get this error

ERROR - Either this page is not available or this option is not added to the list of authorized elements.

But that doesn't tell me a thing since it is the stock error written into this contribution.

 

Thanks in advance!

Back, and incase anyone else has this problem I figured I would post the fix. Atleast what fixed it for me.

 

My host has fopen shut off so I had to change the code from

# InfoBox Anywhere with PHP by clarocquevt --------------------------------# 
# Format: http://www.domain.com?box=xx                                     #
$value=@file_get_contents('http://url.com/supply.php?box=categories'); 
#--------------------------------------------------------------------------# 
($value)
 ? $results = $value
 : $results = 'ERROR - Either this page is not available or this option 
 is not added to the list of authorized elements.';
echo $results;
# eof InfoBox Anywhere with PHP by clarocquevt ----------------------------#

to

# InfoBox Anywhere with PHP by clarocquevt --------------------------------# 
# Format: http://www.domain.com?box=xx                                     #
$curl_handle = curl_init();
// Where should we get the data?
curl_setopt ($curl_handle, CURLOPT_URL, 'http://url.com/supply.php?box=categories');
// This says not to dump it directly to the output stream, but instead
// have it return as a string.
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
// the following is optional, but you should consider setting it
// anyway. It prevents your page from hanging if the remote site is
// down.
curl_setopt ($curl_handle, CURLOPT_CONNECTTIMEOUT, 1);
// Now, YOU make the call.
$buffer = curl_exec($curl_handle);
// And tell it to shut down (when your done. You can always make more
// calls if you want.)
curl_close($curl_handle);
// This is where i?d probably do some extra checks on what i just got.
// Paranoia pays dividends.
print $buffer;
#--------------------------------------------------------------------------#

 

Hope this can help someone in the future. :)

 

 

Very interesting Wendy....

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Which part? lol

 

I guess my host was having a ton of problems with people exploiting the fopen whatevertheheck so they turned it off then linked to a customers blog who explained a way around it with the curl stuff you see above.

 

Had never mattered to me before on any site I was using until I installed this fantasticly easy to use contribution. Just glad I was able to figure out what was going on.

 

On a whim I compaired the information found in the asCommerce tools to see if there was a difference in my local machines php and my hosts and the fopen was the first thing that was different. Luckily I didnt have to spend hours sorting through that stuff. All gibberish to me. :)

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Which part? lol

 

I guess my host was having a ton of problems with people exploiting the fopen whatevertheheck so they turned it off then linked to a customers blog who explained a way around it with the curl stuff you see above.

 

Had never mattered to me before on any site I was using until I installed this fantasticly easy to use contribution. Just glad I was able to figure out what was going on.

 

On a whim I compaired the information found in the asCommerce tools to see if there was a difference in my local machines php and my hosts and the fopen was the first thing that was different. Luckily I didnt have to spend hours sorting through that stuff. All gibberish to me. :)

 

 

The whole thing - lol

 

Id a good find - but intersting avenue with out fopen it will sure limit many things but I guess if there is a curl workaround you have the ability to modify - was just interesting reading ;)

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

  • 4 weeks later...

I'm trying to use this contribution accross seperate directories but the includes are all muddled.

 

my oscommerce directory is www.domain.com/shop

 

and my main site is in the root directory. so I change the include on the supply file to shop/application_top.php however now all of the includes in the application top file are off kilt. Would it be wise to make a copy of application_top.php and modify all of the include paths to the shop directory, or is there a better way around this?

Link to comment
Share on other sites

ok so I did what I said as a possible solution, making an application_top_2.php and an application_bottom_2.php and modifying the includes, they are not dynamic values as they were originally though... Anyway, It now cannot find a mysql table

 

1146 - Table 'myitsol_osc1.TABLE_INFOBOX_CONFIGURATION' doesn't exist

 

select display_in_column as cfgcol, infobox_file_name as cfgtitle, infobox_display as cfgvalue, infobox_define as cfgkey, box_heading, box_template, box_heading_font_color from TABLE_INFOBOX_CONFIGURATION where infobox_file_name = "whats_new.php" and template_id = "0"

 

[TEP STOP]

 

I checked on phpmyadmin and sure enough the table doesn't exist.

 

am I running an old version of OsCommerce? I installed it using cPanel, which I don't usually do.

Link to comment
Share on other sites

Ok so it's not a version issue, I'm not sure what the deal is with that error, cause the module works fine inside the shop directory.

 

I'll keep messing with it.

 

btw: how do I edit a post in this forum? I can't seem to see the edit button

Link to comment
Share on other sites

ok sorted it,

 

since it was working fine in the supply.php in the /shop directory, I placed that file in the root directory in my site.. that file had no reference to the table it couldn't find before...I may have initially installed it wrong I'm not sure. Anyhow, here's what my edited version of the supply.php file looks like:

 

############################################################################
# DEFAULT OSC CODE DO NOT MODIFY                      #
#--------------------------------------------------------------------------# 
require('shop/includes/application_top_2.php');
#--------------------------------------------------------------------------#
############################################################################ 
#     DO NOT EDIT BELOW THESE LINES UNLESS YOU KNOW WHAT YOU ARE DOING     #
############################################################################ 
#--------------------------------------------------------------------------# 
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php
$box = tep_db_input( $HTTP_GET_VARS['box'] ) . '.php';
    	 
if (file_exists('shop/includes/boxes/' . $box) && !empty($box)) {
 
     include('shop/includes/boxes/' . $box);

}else{

echo 'Sorry, it appears that "<b>'.$box.'</b>" box does not exist.';

}#eof box exists
 
#--------------------------------------------------------------------------# 
require('shop/includes/application_bottom_2.php');?>

 

I've simply replaced the defined require and include directories to static strings, maybe not as practical but it works. I also did the same thing to copies of application_top/bottom. Seems to work like a charm. I guess I could redefine the function and class and include directories on the page outside the catalog, would end up with the same result I'd assume.

Link to comment
Share on other sites

  • 1 year later...

I would really like to use this contribution, however I have the "member approval" contribution that requires a login to view the site.

 

If I put the "Infobox Anywhere with PHP" code into my index page at the root of my site (outside the catalog directory) the page always redirects to the login page, even after the user is logged in.

 

Is it possible to make this contribution work by allowing the login to be valid outside the catalog?

 

I would really appreciate some advice with this, becuase the "Infobox Anywhere with PHP" contribution would be extremely useful to me.

Link to comment
Share on other sites

  • 2 weeks later...
  • 7 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...