osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Specials on non-osC Max php page

This is a discussion on Specials on non-osC Max php page within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; On our site we have a static php home page that exists outside the store. Is there a way to ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1  
Old 09-12-2007, 06:03 AM
New Member
 
Join Date: Sep 2007
Location: Fennimore, WI, USA
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
webwise is on a distinguished road
Default Specials on non-osC Max php page

On our site we have a static php home page that exists outside the store. Is there a way to add some code on that page that will display specials or a featured product?

Thanks,
WebWise
__________________
Save the world, Ride a bike.
o_
()/()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 09-12-2007, 11:07 AM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 444
Thanks: 3
Thanked 75 Times in 70 Posts
Rep Power: 6
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Specials on non-osC Max php page

what you seem to be asking is what is the minimum necessary to pull in the specials. You only look at a window that is opened outside the normal browser to see the minimum code required. That window is the "receipt" that gets displayed at the end of a sale. The code in there supplies a template for all the minimal things that are necessary to display a stand along piece of OSC.
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 09-13-2007, 06:41 AM
New Member
 
Join Date: Sep 2007
Location: Fennimore, WI, USA
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
webwise is on a distinguished road
Default Re: Specials on non-osC Max php page

Where do I find the code for this "receipt" window/box so that I can place the content (such as the specials box or a featured product) into it? I assume I can then place this stand alone code on our site's php home page outside our store.
__________________
Save the world, Ride a bike.
o_
()/()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 09-13-2007, 08:16 AM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 444
Thanks: 3
Thanked 75 Times in 70 Posts
Rep Power: 6
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Specials on non-osC Max php page

It's called print_order.php
It's in /catalog

This is the code that is run when a person completes a transaction and wants a receipt. It creates a popup window with just a receipt for the order.

Now, let's strip out all the code that prints the receipt (ie: the <body>)

Code:
<?php
/*
  
my core
*/

  require('includes/application_top.php');

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }
/* this can be stripped out and replaced with your call to the special function or whatever...

    if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id'])
 && !is_numeric($HTTP_GET_VARS['order_id']))) {
    tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
  }
   $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " wher
e orders_id = '" . tep_db_input($oID) . "'");
  $customer_info_query = tep_db_query("select customers_id from " . TABLE_ORDERS
 . " where orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "'");
  $customer_info = tep_db_fetch_array($customer_info_query);
  if ($customer_info['customers_id'] != $customer_id) {
    tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
  }



  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ORDERS_PRINTABLE_INFO);

  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
  $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', '
SSL'));
  $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href
_link(FILENAME_ORDERS_PRINTABLE_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 
'SSL'));

  require(DIR_WS_CLASSES . 'order.php');
  $order = new order($HTTP_GET_VARS['order_id']);

*/
?>

<link rel="stylesheet" type="text/css" href="stylesheet.css">



<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
That is the barebones version. take the area that is commented out and replace it with the call to the function you want to use (special, featured products, whatever).

Now, all you have to do is include this code in your index.php page and VIOLA! you have included a portion of OSC into your other pages.
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 09-14-2007, 09:14 AM
New Member
 
Join Date: Sep 2007
Location: Fennimore, WI, USA
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
webwise is on a distinguished road
Default Re: Specials on non-osC Max php page

By replacing a call to the desired function do you mean replae all instances of "order" with "special". It seems a lot of that code deals with customer ids which seem unecessary for displaying a specials box on an outside page. It seems the following two lines are the only releveant ones:

require(DIR_WS_CLASSES . 'order.php');
$order = new order($HTTP_GET_VARS['order_id']);

However simply including these with the appropriate changes isn't enough either.

The "Infoboxes outside OSC" contribution found on the oscommerce site seems to work for the "what's new" box but not specials. Here is the code from the contribution:

<?php
/*
Author: David Vance
Email: dv@josheli.com
Date: March 15, 2003
OSC 2.2 MS1
PHP Version 4.3.1
This snippet allows you to place an info box (or other osc things i suppose) elsewhere on your site (outside of OSC, though it must be the same site as OSC).
There must be no html or php output above the application_top.php include (unless you use buffering, etc.), or you will get "headers already sent" errors.
Sample: http://www.josheli.com/new.php
*/
//saves current working directory for later return
$cwd=getcwd();
//changes current working directory to osc root install directory;
//something like: /home/david/www/catalog/ but not DIR_FS_CATALOG
chdir('shop');
//need all of application_top's configurations and includes
//NO OUTPUT ABOVE THIS POINT!
include('includes/application_top.php');
ob_start(); //start buffering
include(DIR_WS_BOXES.'specials.php');//include the file for the box you want
$sbox=ob_get_contents();//save it in a variable for later use
ob_clean();//clean the buffer
include(DIR_WS_BOXES.'whats_new.php');//include another file for the box you want
$wbox=ob_get_contents();//save it in a variable for later use too
ob_end_clean();//stop buffering
//replace relative image paths with absolute urls (you may not need this. i did.)
$sbox=str_replace("src=\"images", "src=\"<A href="http://74.53.88.227/shop/images",$sbox">shop/images",$sbox);
//$wbox=str_replace("src=\"images", "src=\"<A href="http://74.53.88.227/shop/images",$wbox">shop/images",$wbox);
chdir($cwd);//change back to original working directory
//********* COPY THE CODE ABOVE TO THE TOP OF THE FILE YOU WANT YOUR BOX IN *******\\
?>
__________________
Save the world, Ride a bike.
o_
()/()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 09-14-2007, 01:56 PM
New Member
 
Join Date: Sep 2007
Location: Fennimore, WI, USA
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
webwise is on a distinguished road
Default Re: Specials on non-osC Max php page

It seems that the only relevant lines to showing the specials outside of osc are the requre and $order= lines at the end.

We have the "Infoboxes outside OSC" contribution on the page and it displays the "what's new" page but not the specials. I put two test specials in the db and they don't appear in the Site Index page, just the store index page.
__________________
Save the world, Ride a bike.
o_
()/()
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 09-14-2007, 10:12 PM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 444
Thanks: 3
Thanked 75 Times in 70 Posts
Rep Power: 6
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Specials on non-osC Max php page

lets try this one more time...

Inside your index.php or whatever non-osc page you have include the following

Code:
<?php
/*
  
my core
*/

  require('includes/application_top.php');

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }
/* insert your call to the special function or whatever...

  
*/
?>

<link rel="stylesheet" type="text/css" href="stylesheet.css">



<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Is that a simple enough explanation? In order to get the osc code to run you only have to pick up the application top and bottom and then include the osc function call.
__________________
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.oscmax.com/forums/oscmax-v2-customization-mods/10661-specials-non-oscommerce-max-php-page.html

Posted By For Type Date
Pages tagged with "osc" on del.icio.us This thread Refback 10-01-2007 03:44 PM

Similar Threads

Thread Thread Starter Forum Replies Last Post
Specials Page not updating in admin? Redeye_Joe osCMax v2 Installation issues 3 02-06-2006 07:17 AM
Specials page, how to show in html bts gamefreak7 osCMax v2 Features Discussion 1 08-31-2005 07:29 AM
MS2-Max Bug in main page specials??? midwestwebsites osCMax v1.7 Discussion 4 06-16-2004 11:11 AM
Bug - specials.php page displays to few products Redbeard osCMax v1.7 Discussion 1 11-09-2003 11:11 AM
spécials in first page talme osCommerce 2.2 Modification Help 1 02-19-2003 01:21 AM


All times are GMT -8. The time now is 10:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax