Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Dear Members,

 

I'm showing the stock (products_quantity) on the product_listing page as follows:

 

$stock = '' . $listing['products_quantity'] . '';
$p_qty = '<tr>
<td align="right"><font>' . $stock . '</font></td>
</tr>';

 

Works perfectly.

 

However I also want to add the delivery time for which I have added a column (delivery_time) in the 'products' table.

 

$delivery = '' . $listing['delivery_time'] . '';
echo '' . $delivery . ''; // testing output

 

Could someone please explain to me why this isn't working?

 

Thank you! :)

Posted

Dear Members,

 

I'm showing the stock (products_quantity) on the product_listing page as follows:

 

$stock = '' . $listing['products_quantity'] . '';
$p_qty = '<tr>
<td align="right"><font>' . $stock . '</font></td>
</tr>';

 

Works perfectly.

 

However I also want to add the delivery time for which I have added a column (delivery_time) in the 'products' table.

 

$delivery = '' . $listing['delivery_time'] . '';
echo '' . $delivery . ''; // testing output

 

Could someone please explain to me why this isn't working?

 

Thank you! :)

Did you change the sql query to select 'delivery_time' from your products table? You need to get the information first before you can use it.

 

Dan

Posted (edited)

Did you change the sql query to select 'delivery_time' from your products table? You need to get the information first before you can use it.

 

Dan

 

Dan, thank you for your reply.

 

I also tried the following:

 

added to functions/general.php:

////

// Return a product's delivery time

// TABLES: products

function tep_get_delivery_time($products_id) {

$products_id = tep_get_prid($products_id);

$delivery_query = tep_db_query("select delivery_time from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$delivery_values = tep_db_fetch_array($delivery_query);

 

return $delivery_values['delivery_time'];

}

 

added to product_listing.php:

$delivery_time = tep_get_delivery_time((int)$HTTP_GET_VARS['products_id']);

echo '' . $delivery_time . ''; //testing output

(this is working in the product_info page...)

 

Still not working, obviously I am doing something wrong, which select statement do I have to change? Thanks! :)

Edited by steve1337
Posted

Dan, thank you for your reply.

 

Still not working, obviously I am doing something wrong, which select statement do I have to change? Thanks! :)

 

Mine is close to the top of the file...have a look for...

 

$product_info_query =

 

Dan

Posted

Mine is close to the top of the file...have a look for...

 

$product_info_query =

 

Dan

 

Hi Dan,

 

This is already working for me on the product_info page, however I'm unsure what I need to do in the product_listing file...

 

Thanks, Steve

Posted

Hi Dan,

 

This is already working for me on the product_info page, however I'm unsure what I need to do in the product_listing file...

 

Thanks, Steve

 

 

Opps....sorry Steve...I misread that...I'm not sure, but I think that query is in index.php....have a look there and I think you'll find it...dan

Posted

Opps....sorry Steve...I misread that...I'm not sure, but I think that query is in index.php....have a look there and I think you'll find it...dan

 

Steve...I just did a quick search and the query is indeed in index.php...this post from Satish might help...

 

Product List Query

 

Dan

Posted (edited)

Steve...I just did a quick search and the query is indeed in index.php...this post from Satish might help...

 

Product List Query

 

Dan

 

Dan,

 

Thank you so much, you have been a great help! It works perfect! :)

 

- Steve

Edited by steve1337

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...