PDA

View Full Version : Preorder Mod



landshark
12-15-2005, 08:09 AM
Ok i posted a question yesterday in the features forum requesting help in setting up the ability to place preorders in osCMax with no luck as far as a response goes.

However I have continued to look and came across this contribution on the osCommerce site.

http://www.oscommerce.com/community/contributions,1173/category,all/search,preorder

I am not sure if this is going to help me or not but i want to install it on my test system to check it out.

This is what i ahce done so far.

1. I've added the preorder info box via the infobox admin panel as opposed to modifying the files as sugested in the Readme.txt. I began to modify manually until i noticed that due to modification on osCMax this didn't make sense.

2. I added the preorder.php file to catalog/includes/boxes/

3. This is where i am stumped. this is what the Readme.txt tells me to do



In catalog/products_new.php

first, find the following:


echo HEADING_TITLE;
}
if ($sql_add == 'pre')
{
echo Preordini;

The word 'Preordini' there is the title of your Preorder page, so change it to suit your language.


In the same file, find:


$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

and replace it with:


// added for Preorder contribution
if ($sql_add == 'pre')
{
$sql_add_code ='and p.products_date_available > curdate()';
}
if (empty($sql_add))
{
$sql_add_code ='and p.products_date_available <= curdate();
}
// end of Preorder code
$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id " . $sql_add_code . " and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);


Well because of BTS i have to go to the \catalog\templates\fallback\content ditectory and i find products_new.tpl.php. When I open this file i cannot find the code mentioned in the first part of step 3. I did find echo HEADING_TITLE; on line 5 but it does not match the direction. Can anyone help me with this my coding skills are limited to find, cut and paste.

I did find the line mentioned in the seconed part on line 16 and i think all i need to do here is cut and paste.

So i still don't know if this is going to help me out but i'd like to check and see since there doesn't seem to be much activity on my original post and i really would like to have this feature on my site.

landshark
12-26-2005, 05:15 AM
Can anyone help me with this. I am assuming it is a bts issue but the Readme is written for stock oScommerce.

jpf
12-31-2005, 09:35 PM
Take code:
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>


Change to:


<td class="pageHeading"><?php echo HEADING_TITLE;
}
if ($sql_add == 'pre')
{
echo Preordini; ?></td>

And change the rest as needed... Make 100% sure your replacing code as specified - if there is OSCMAX added code then check and see if you can still keep that part....