Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

delay shipping message on CERTAIN 0 qty items


Recommended Posts

Hi,

I've done a bit of searching for this in the contribution section, google, and in the forums. I might not be putting together the proper search phrase, so I apologize if this has been covered already (which I'm sure it likely has)

 

I don't want to make all my products purchasable with 0 qty, but I would like for some of them to be and have a small message in the product info page (and checkout if possible) that handling time for the item will be 7 business days (so I can order them).

 

I'm using the current v2 store.

 

Anyone ideas?

 

Thanks

Link to comment
Share on other sites

SORRY for double post, but was still at the top so I didn't bump anyone. Edit time ran out.

 

I just realized that you can indeed make the item available with 0 qty by simply making 'in stock'...duhhh :rolleyes:

And I can adjust the text in the shopping cart as I need. So then, my only question is how to add the message to product info? Something along the lines 'if qty=0, echo message.." I'm assuming.

 

 

Thanks

Link to comment
Share on other sites

Sorry for the second bump, but I'm still on top, so I guess it's been a slow day! :lol:

 

After spending a Saturday afternoon grepping, I fixed all my problems. Rather then leave an empty thread, I thought I'd list the edits I made, all basic stuff I'm sure to somebody that's fluent in OSC, but maybe can help someone else in the future that doesn't know.

 

This is for 2.3.1 store

 

Mission: I didn't want physical quantities (numbers) displayed for stock levels. If somethings out, I can order it and have it shipped within a week or so, so want to relay that message to the online customer the moment they look at a product. So rather than "Out of Stock" or "0" which might make them leave, I wanted "Short Delay"..also didn't want to disable the buy now button (obviously).

 

Please note I found a contribution called "Stock Status in Product Listing" (recommend v1.21 by sosidge). It's a bit dated if your using a 2.3.1 store, but great for reference. Didn't think I should update it as my needs are slightly different than what it was intended for and I'd make a mess of it.

 

Pages I needed to change:

product_info.php....(the products main description page)..wanted a note that said "Slight Delay: This item will ship in 7-10 days" for 0 QTy items.

shopping_cart.php....wanted more notification that product would be 'delayed' before person pays. It only had 3 asterisks(***) and then simply said something like 'products marked with *** don't have quantity....'

product_listing.php/advanced_search.php...If someone chooses a category with multiple items or does an advanced search, a column based list of items comes up. you can decide not to use quantity via the admin panel in this list, however I wanted to. Problem again for me was physical inventory numbers...just wanted 'in stock' or 'slight delay'

products_new.php...I really don't use the new products box, but fixed it anyway in the event an osc expert comes by my shop and, well, for you...

 

Note: Backup your files. A lot of these messages you can add wherever you want on the page, change the text color, yada yada. Also my shop is modded, so line numbers are approximations of where they are on your pages...

 

catalog/product_info.php

find around line 64:

<div>
 <h1 style="float: right;"><?php echo $products_price; ?></h1>
 <h1><?php echo $products_name; ?></h1>
</div>

add next line:

<!--bof stock announcement-->
<?php
if ((STOCK_CHECK == 'true')&&($product_info['products_quantity'] < 1)) {
?>
<tr>
 <td><span class="markProductOutOfStock"><b>Slight Delay: This item will ship in 7-10 days</b></span></td>
</tr>
<tr>
 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
} elseif ((STOCK_CHECK == 'true')&&($product_info['products_quantity'] > 0)) {
?>
<tr>
 <td><span class="markProductOutOfStock"><b>In Stock</b></span></td>
</tr>
<tr>
 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<!--eof stock announcement-->

 

Next,

catalog/shopping_cart.php (aka 'cart contents')

I'm saving you here. As I said it had 3 asterisks with a message about insufficient stock at the bottom. You can grep till the cows come home but will never find the ***. This is because it's in the admin panel under configuration>stock>mark product out of stock. I changed mine to "*slight delay". This will appear next to the item in the cart contents.

To change the text that says, "Products marked with *** dont exist in desired quantity in our stock.You can buy them anyway and check the quantity we have in stock for immediate deliver in the checkout process."

go to: catalog/includes/languages/engilsh/shopping_cart.php

find:

define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' dont exist in desired quantity in our stock.<br />Please alter the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '), Thank you');

change to something you want, for example mine is now:

define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' will take 7-10 days before they are shipped or delivered.');

 

Next,

product_listing.php...

Note, this is also the same for advanced search results. I added a mouse over text for more details since the spacing is limited. Again, you can control if you even want a quantity on these lists via the admin panel (configuration>product listing). If your columns seem out of whack with their headings, it is likely because you have two titles sorted with the same number.<don't do that. If you don't want to have a quantity on these list pages, then you don't have to make this edit, but I would in case things change later.

go to catalog/includes/modules/product_listing.php

around line 121, find:

case 'PRODUCT_LIST_QUANTITY':
           $prod_list_contents .= '        <td align="right">' . $listing['products_quantity'] . '</td>';
           break;

 

change to:

 

case 'PRODUCT_LIST_QUANTITY':
 if ($listing['products_quantity'] < 1) {
   $prod_list_contents .= '<td align="right"><span class="markProductOutOfStock"><span title="Will ship in 7-10 business days"><b>Slight Delay</b></span></span></td>';
 } else {
   $prod_list_contents .='<td align="right"><span title="Ready to ship">In Stock</span></td>';
 }
 break;

 

Now the lists on the product listing and advanced search pages don't have numbers anymore, but you're saying to yourself "that Quantity sort title now looks a bit odd up there," right? lol. I changed mine to the word "Stock"...To do this:

for product listings,

open catalog/includes/languages/english/index.php

find:

 

define('TABLE_HEADING_QUANTITY', 'Quantity');

 

change to:

 

define('TABLE_HEADING_QUANTITY', 'Stock');

 

one more for the avanced search list page:

open catalog/includes/languages/advanced_search.php

find:

 

define('TABLE_HEADING_QUANTITY', 'Quantity');

 

change to:

 

define('TABLE_HEADING_QUANTITY', 'Stock');

 

Lastly, the new product list page:

open catalog/products_new.php

and around line 64 find:

 

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
       <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><strong><u>' . $products_new['products_name'] . '</u></strong></a><br />' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br />' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br /><br />' . TEXT_PRICE . ' ' . $products_price; ?>

 

Now this is a little tricky. You will notice a

</td>

in that code block AT THE VERY END. Delete that and then hit the enter button on your keyboard to go down a line. Also note, the next code block afterwords involves the buy now button, so you want to get this part in correctly before that without messing this up.

 

add the following:

 

<br /> <?php    $stock_level = tep_get_products_stock($products_new['products_id']);
if ((STOCK_CHECK == "true")&&($stock_level < 1) ) {
 echo '<span class="markProductOutOfStock"><span title="Will ship in 7-10 business days"><b>Slight Delay</b></span></span>';
} elseif ((STOCK_CHECK == 'true')&&($stock_level > 0 )) {
 echo '<span title="Ready to ship">In Stock</span>';
} ?>  
       </td>

 

If you did this correctly, your new items should look something like:

Item Title

Date Added

Manufacturer

(line space)

Price

Stock Message

 

Another note: I didn't like that extra line between Manufacturer and Price. To get rid of that, in the first code block, remove one of the

<br />

(there are 2 of them) that come before

' . TEXT_PRICE . 

 

Well, that's it. I spent my day doing this, but reached my goals and hopefully this will help someone.

 

Later

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...