Paper911.com

Wednesday, November 30, 2005

Breadcrump Mods

application_top.php

I changed the breadcrumb so that it does not display the true categorie structure if the user is viewing a custom product. In this case it shows "Custom Paper" as the last item

if (isset($cPath_array)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
if((int)$cPath_array[$i]==53){
$breadcrumb->add("Custom Papers", tep_href_link(FILENAME_CUSTOM));
break;
}

remove category link from product_info

product_info.php

I removed the link to a products category in the case that the product is a custom.

remove category link from product_info

product_info.php


I removed the link to a products category in the case that the product is a custom.

if(tep_is_custom($product_info['products_id'])){
echo tep_get_categories_name(tep_get_products_catagory_id($product_info['products_id'])) . '';
}
else{
echo '' . tep_get_categories_name(tep_get_products_catagory_id($product_info['products_id'])) . '';
}?>

Price Font

Stylesheet.css

"Retail Price:" font in product_info.php is controled by TD.pageHeadingPrice, DIV.pageHeadingPrice

Tuesday, November 29, 2005

Frontpage Additions

index.php

I moved the 'Deadline' and 'Number Required Pages' from elements from custom.php to index.php. This required that I turn the mainpage(index.php) into a from . This is accomplished by

if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
$process = true;

$deadline = tep_db_prepare_input($HTTP_POST_VARS['deadline']);
$req_pages = tep_db_prepare_input($HTTP_POST_VARS['req_pages']);

$error = false;

if (strlen($deadline) < error =" true;">add('index', ENTRY_DEADLINE_ERROR);
}

if (strlen($req_pages) < error =" true;">add('index', ENTRY_REQ_PAGES_ERROR);
}

if ($error == false) {
if (SESSION_RECREATE == 'True'){
tep_session_recreate();
}

//restore cart contents
$cart->restore_contents();

//HR: redirecting to appropriate product
(int)$dead_day= substr($deadline, -2);
if($dead_day<0) $dead_day=-($dead_day); (int)$today=date("d"); $dead_day++; $days=$dead_day-$today; $product_id_query=tep_db_query("select id from custom_products where days =" . $days . " and pages = " . $req_pages ); $product_id_array=tep_db_fetch_array($product_id_query); $product_id=$product_id_array['id']; tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_id)); }
...
HTML
...
echo tep_draw_form('custom_order', tep_href_link(FILENAME_DEFAULT, '', 'SSL'), 'post', '') . tep_draw_hidden_field('action', 'process'); ?>
...
Form

Sunday, November 27, 2005

product attributes

Created a sample product attribute in the form of a drop down box used to select the number of pages. I was unsuccessful at creating a text attribute. Seems as though the contribution was not fully merged with our implementation

display cart link in header upon cart addition

header.php

text link and picture link to the shopping cart display after something the customer puts something in its cart.

Removed cart contents from header

header.php

cart contents is no longer displayed upon login or ever for that matter because it stretched out the length of the header to longer than the logo.

Cart Modifications

/includes/classes/shopping_cart.php

Modified add_cart() and remove() cart to account for custom products.
Updates table custom.

Saturday, November 19, 2005

Clever user precaution

includes/application_top.php

right before item is added to the cart. A check is made to see if the user has submitted a custom paper request. If the user has not then his cart addition proceeds as normal. If it has then a check is made to ensure that the item beeing added to the cart has the same item number as the appropriate custom product.


Session Syntax

There are a few syntaxs in php for registering and accessing session vars the old way was
var $foo;
session_register('foo');
$HTTP_SESSION_VARS['foo'];

the new way is

$_SESSION['bar'] = $foo;
echo $_SESSION['bar']

The new way seems not to work in my implementation os osC which is strange becuase we are using PHP ver.4.3.4

The oscommerce way

var $foo;
tep_session_register('foo')

to access you just
echo $foo;

which makes the least sense out of all 3.

Paper911.com

Paper911.com

what if whenever something is added to your cart, it checks for a registered custom session var. If there isnt, nothing different happens. If there is the custom table is updated including customer_id, and product_id. I'm still not exactly sure what happens if you are not logged on.

Arrays of Arrays

Im reasonably sure that a part of my solution involves arrays of arrays or nested arrays. similar to the syntax found in shoppint_cart.php add_to_cart(). $this->contents[] = array($products_id);
91 $this->contents[$products_id] = array('qty' => $qty);

Friday, November 18, 2005

Cart Product Quantity

Is the Cart product quantity neccesary? Removal may reduce possible customer idiocy and messing up of our process. Either this has to happen or other measures must be taken.

Custom Info Plans

I plan on moving deadline and number of required pages to the front page. The total price will be displayed on the custom form. The Custom form will also have name and email address enquiry removed. The remaining custom info will be put into an array and passed as a session var when the customer submits the form. The customer is then redirected to the appropriate custom product. When the customer adds the appropriate custom product to it's cart This information is asociated with this product through session variable product attributes . If the customer does not add the item to it's cart this session varibale should be unregistered and the info lost. If the customer removes the item from it's cart the same must happen(may happen implicitly from the cart removal). When the customer checksout (pays) the custom information will be committed to the db associated with a customer_id and an order_id.

Passing Session Var

Little notable changes occured today, but i did make the significant advance of passing the custom product information as an session variable. This information is gathered from a form in custom.php and stored in an array $custom_array. I passed this array using session_register('custom_array'). I then accessed it in checkout_process.php using $checkout_custom_array=$HTTP_SESSION_VARS['custom_array'].

Wednesday, November 16, 2005

Remove Top from Breadcrumb

/includes/classes/breadcrumb.php
//HWR $i was =0 made =1 to elim 'top'
for ($i=1, $n=sizeof($this->_trail); $i<$n; $i++) {

logo link to mainpage

/includes/header.php

both versions of the logo link were present. I commened out the first and enabled the second


if (HEADER_IMG_LINK_ON=='1') {
//HWR: commented out first logo display to eliminate open in new window
//
?>



' . tep_image(DIR_WS_IMAGES . HEADER_LOGO, HEADER_LOGO_ALT_TAG) . ''; ?>

Cart contents in header only

Shows contents of cart only if something is in the cart
includes/header.php


Make Account Features visible on login

/includes/header.php

// HWR: show my account on login
if (tep_session_is_registered('customer_id') ) {
...
//HWR: show shopping cart if you are logged in
...
//HWR: shows checkout upon login

removed row from headers

removed students pictures and search from header

/includes/header.php

// HWR: turned off
/*
if (SHOW_HEADER_CATEGORIES_SEARCH=='1') {
...
}
// EOF: WebMakers.com Added: Show Categories and Search in Header
HWR: Removed */
?>

Tuesday, November 15, 2005

Changed checkout success messages

Previously undocumented mod

checkout_success.php

displays different message depending on product parent category id.

//HWR $PAYPAL_TEXT WAS $TEXT_SUCCESS

//HWR removed $TEXT_SUCCESS becuase it is handled later on
//$TEXT_SUCCESS = TEXT_SUCCESS;

//HWR removed condition to deal with product dependant notification messgages
//if ($global['global_product_notifications'] != '1') {
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);

//HWR added ptc and c
$products_query = tep_db_query("select op.products_id, products_name, parent_id from " . TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc on op.products_id = ptc.products_id left join " . TABLE_CATEGORIES . " c on ptc.categories_id= c.categories_id where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
$products_array[] = array('id' => $products['products_id'],
'text' => $products['products_name'],
'parent_cat' => $products['parent_id']);
}

//HWR $TEXT_SUCCESS dependent on product
$n=(sizeof($products_array));
for ($i=0; $i<$n; $i++) {
if($products_array[$i][parent_cat] == '51'){
$TEXT_SUCCESS=TEXT_SUCCESS_ARCHIVE;
}
else if($products_array[$i][parent_cat] == '53'){
$TEXT_SUCCESS=TEXT_SUCCESS_CUSTOM;
}
else{
$TEXT_SUCCESS=TEXT_SUCCESS_OTHER;
}
}
//} HWR

eliminate custom products from search

advanced_search_results.php

//HWR eliminate custom prods from search
$where_str .= "and c.parent_id != '53'";

added tell a friend to left col

added tell a friend to left col

/includes/column_left.php

added

require(DIR_WS_BOXES . 'tell_a_friend.php');

search box text

/includes/languages/english.php


define('BOX_SEARCH_TEXT', 'Use keywords to find the paper you are looking for.');

removed adavnced search link from search box

removed adavnced search link from search box
/includes/boxes/search.php

$info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
'align' => 'center',
'text' => $param . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '
' . BOX_SEARCH_TEXT

/* HWR. '
' . BOX_SEARCH_ADVANCED_SEARCH . ''*/);

Header

/includes/header.php

if (SHOW_HEADER_CATEGORIES_SEARCH=='1') {
=>
if (SHOW_HEADER_CATEGORIES_SEARCH=='my balls') {

results in elimination of second row in header including people pictures and search

Monday, November 14, 2005

Accidental Advanced Search

The Advanced Search mysteriously appeared in the header

I am relatively sure, it was not there earlier today. I have a backup I can revert to

Removed Contact Us text

You may contact us via snail mail, e-mail, or telephone.

By snail mail:
Paper911.com
City Street
City, State ZIP

By e-mail:
webmaster@paper911.com

By telephone:
xxx.xxx.xxxx

from
catalog/includes/languages/english/define_contact_us.php

changed about us info

changed
/includes/languages/english/define_about_us.php

Changed Privacy Info

Removed "Our Postal Address Is" and "Or you can reach us by telephone"
from
/includes/languages/english/define_privacy.php

changed checkout image

/catalog/images

changed header_checkout.gif to header_cart.gif

removed cart content

includes/header.php

case ($what_link==FILENAME_SHOPPING_CART):
$this_link=false; //HR made false to remove cart image
if (DOWN_FOR_MAINTENANCE_NO_STORE=='1' or DOWN_FOR_MAINTENANCE=='1') {
$this_link=false;
}

Customer Email Text

added EMAIL_TEXT_ARCHIVE
EMAIL_TEXT_CUSTOM

to english/checkout_process.php

added 343-348
if($custom==1){
$email_order .= EMAIL_TEXT_CUSTOM. "\n" . EMAIL_SEPARATOR . "\n" ;
}
else{$email_order .= EMAIL_TEXT_ARCHIVE . "\n" . EMAIL_SEPARATOR . "\n" ;
}

purpose: Track changes to www.paper911.com

I am going to attempt to use this blog to track my modifications to www.paper911.com implementation of oscommerce

I inherited this half finished site several months ago and have since, significantly enhanced it's functionality

It includes some contributions and custimizations done by others; particularly Webmakers Shoppe Enhancement Controller, which i am not very fond of.

Sunday, November 13, 2005

Www.paper911.com

--

Mobile Email from a Cingular Wireless Customer http://www.cingular.com