Jump to content
surfalot

[Contribution] Availability

Recommended Posts

First of all, great contribution! very useful to me and lots of others, obviously. I have couple issues getting to work as perfectly with my site however.

 

First problem: When I try to edit the availability options in admin I get the following error:

 

Fatal error: Call to undefined function tep_hide_session_id() in /admin/availability_options.php on line 194

line the error is refering to is:

$contents[] = array('form' => tep_draw_form('availability', FILENAME_AVAILABILITY_OPTIONS, 'page=' . $HTTP_GET_VARS['page'] . '&aID=' . $availability_id . '&action=save') . tep_hide_session_id() );

 

If I try to delete an option I get:

 

Fatal error: Call to undefined function tep_hide_session_id() in /admin/availability_options.php on line 221

line the error is refering to is:

$contents = array('form' => tep_draw_form('availability', FILENAME_AVAILABILITY_OPTIONS, 'page=' . $HTTP_GET_VARS['page'] . '&aID=' . $_GET['aID'] . '&lID=' . $_GET['lID'] . '&action=deleteconfirm') . tep_hide_session_id() );

 

I not sure this is something I have coded wrong or left out because before I changed anything I uploaded the availability_configurer.php to view it I got (and still get) the error below - this file seems to work as it should btw even with the error:

Fatal error: Call to undefined function tep_hide_session_id() in /admin/availability_configurer.php on line 388

line the error is refering to is:

'<br> ' . tep_hide_session_id() .  tep_draw_input_field( /* $name */ 'submit', /* $value */ TEXT_CONFIG_PROCESS, /* $parameters */ '', /* $required */ false, /* $type */ 'submit', /* $reinsert */ false) . '<br><br><br>'."\n" .

 

Anyone had these errors before?

 

Second problem: How do I can the style of text the availability messages are displayed in product description and shopping cart? Ideally I like to have a small icon next to the text (red cross if its out of stock green tick if in stock) but I would just be happy to have the text in class="Main".

Any help appreciated. Thanks, David.

Share this post


Link to post
Share on other sites

^^^^^

I have solved the "Fatal error: Call to undefined function tep_hide_session_id(" problems by uploading an older version on availability_options.php, the one from Version 1 - 1 Mar 2007

 

I'll still looking for help for changing the text style on product_info and shopping_cart though.

Share this post


Link to post
Share on other sites

^^^^^

 

 

I'll still looking for help for changing the text style on product_info and shopping_cart though.

 

I am not very good in php, but you could try to modify this code. It works separately from this contribution. If you have two products in your shopping cart - one is already in stock, the other will be available in a week, it shows no message for the first one and "item in stock:" and date for the second one.

 

in shopping_cart.php find

 

$products_name .= $stock_check;
       }
     }

 

add bellow:

// show availability

$products_query = tep_db_query("select products_date_available from " . TABLE_PRODUCTS . " p where products_id = '" . $products[$i]['id'] . "'");
$product_fetch = tep_db_fetch_array($products_query);
$products_descript = $product_fetch['products_date_available']; 			 
if 	($products_descript > date('Y-m-d H:i:s')) {
$products_name .= '<br>Item in stock: <small> ' . $products_descript . '</small>';
}					
// show availability

 

it is just slightly modified code from description in cart contribution.

Share this post


Link to post
Share on other sites

thanks for the reply Jitty25 but I have sort of solved the problem by crateing an image for each out of stock item and removed the text as it now within an image.

 

Another thing I am desperate to do is to get the availability status on the product listing. Anyone know how to do this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×