steve1337 Posted October 25, 2010 Posted October 25, 2010 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! :) Quote
Dan Cole Posted October 27, 2010 Posted October 27, 2010 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 Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
steve1337 Posted October 27, 2010 Author Posted October 27, 2010 (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 October 27, 2010 by steve1337 Quote
Dan Cole Posted October 28, 2010 Posted October 28, 2010 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 Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
steve1337 Posted October 28, 2010 Author Posted October 28, 2010 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 Quote
Dan Cole Posted October 29, 2010 Posted October 29, 2010 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 Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Dan Cole Posted October 29, 2010 Posted October 29, 2010 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 Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
steve1337 Posted October 31, 2010 Author Posted October 31, 2010 (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 October 31, 2010 by steve1337 Quote
Dan Cole Posted November 4, 2010 Posted November 4, 2010 Dan, Thank you so much, you have been a great help! It works perfect! :) - Steve I didn't do much Steve but you're very welcome. Glad it worked out... Dan Quote Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
Recommended Posts
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.