Paper911.com

Thursday, December 08, 2005

removed review from product info

product_info.php

removed the link to the reviews

removed "This product added..." from product_info

product_info.php

commented out "This product added..." or "This product Available"

Hid Quanity in product_info

product_info.php

changed quantity from a text to a hidden and commented out text prompt

Sunday, December 04, 2005

text area

configure_added.php

defines PRODUCT_OPTIONS_TYPE_TEXTAREA = 4

editing the Specific Instructions option in the Admin resets it back to a TEXT= no good

Trimmed down Custom Form

custom.php

cut out all the fat in this form and reduced it to deadline and pages

Thursday, December 01, 2005

Dembo's Observations

Adam Dembowitz's observations and thoughts on www.paper911.com :
  • entering a date of more than 5 days from now results in "product not found"
  • left bar should have bigger font
  • more to come i hope

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);