Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Product Availability Options v1.0


Snowman

Recommended Posts

This module give you the ability to assign various estimated despatch dates and product availability messages

to your customers (ala amazon.com)

 

eg:

 

This product ships in 24 hours

or

This product ships in 2 to 3 Days

 

etc etc

 

You can assing various messages to each product and these are then displayed immediately under the

products price on the product_info.php page

 

DOWNLOAD HERE

 

enjoy :)

Link to comment
Share on other sites

  • Replies 76
  • Created
  • Last Reply

Top Posters In This Topic

Hi Steve, I've installed your mod and it is working for the most part (Milestone 2.2), although seemed to be missing an entry in product_availability.sql script to add products_availability_id to the Products Table ;-) (unless I missed something in your instructions). I added it manually and it now works.

 

Also, phpmyAdmin which I used to add the SQL script, doesn't seem to like varchar(256) so I changed to varchar(255).

 

One final thing you might be able to help me on. In the Products Availibility admin page whenever I Insert another entry, it only accepts the second character of whatever I type when I Save. When I go back and edit the entry, it accepts whatever I type and saves succesfully that time. It still works OK once I've gone back and edited it, just weird. Not sure if this is related to the mod or my customised OSC site. Any ideas?

 

Cheers, Rob

 

P.S. Thanks for your work on this, a very useful contribution.

 

P.P.S. Small suggestion for others, I added some code to product_info.php to hide the additional products availability row if there is no entry against the product (saves on space). See below:

 

<?php
? ?if (tep_not_null($products_availability_info['products_availability_name'])) {
?>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="main" align="right" valign="top"></td>
? ? ? ? ? ?<td class="main" align="right" valign="top"><?php echo TEXT_AVAILABILITY; ?>: <?php echo $products_availability_name; ?></td>
? ? ? ? ?</tr>
<?php
? ?}
?>

Edited by RobAnderson
Link to comment
Share on other sites

Thanks for pointing out the bugs...

 

ive found a few mistakes i made when stripping the mod out of my own store.

 

I'll fix the bugs and add your code and re-contribute it shortly.

 

As for the issue on Products Avability when entering an option....i cant seem to recreate that bug.

Link to comment
Share on other sites

Hi Snowman

 

I have installed the contribution and all works well until i go to add a availability to product I get the following error

 

1146 - Table 'db86081255.TABLE_products_availability' doesn't exist

 

select products_availability_id, products_availability_name from TABLE_products_availability order by products_availability_name

 

[TEP STOP]

 

The table does exist I can see it in phpmyadmin

 

any ideas

 

thanks

 

mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

You need a define('TABLE_PRODUCTS_AVAILABILITY', 'products_availability'); in includes/database_tables.php or includes/application_top.php, or the capitalization is wrong in the file (capitalization needs to match; all caps is the standard for defines).

 

Hth,

Matt

Link to comment
Share on other sites

thanks Matt

 

I have changed the capitilization b4 i sawy our post and that resolved it - sorry to bother you but i now don't see the drop down in the edit/add product sections??

 

any ideas

 

Thanks

 

Mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Things seem to be showing all ok except for the drop down when i want to edit the product??

 

Any ideas

 

I have checked and double checked everything and still not able to get it to show

 

would it help if i posted the code for you to have a look at?

 

If so what page?

 

Thanks

 

Mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

If there is no drop down then youve missed a part of the code in categories.php in your admin.

 

find the lines:

 

<tr>
           <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(YYYY-MM-DD)</small></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' '; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
         </tr>
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>

 

 

and add the following immediately afterwards:

 

<?php
  if (tep_not_null($products_availability_info['products_availability_name'])) {
?>
        <tr>
          <td class="main" align="right" valign="top"></td>
          <td class="main" align="right" valign="top"><?php echo TEXT_AVAILABILITY; ?>: <?php echo $products_availability_name; ?></td>
        </tr>
<?php
  }
?>

 

also check the file to make sure that the refernce to TABLE_PRODUCTS_AVAILABILITY says that and not TABLE_products_availability in the section you should have added immediately after

 

      $pInfo->objectInfo($product);
   } elseif (tep_not_null($HTTP_POST_VARS)) {
     $pInfo->objectInfo($HTTP_POST_VARS);
     $products_name = $HTTP_POST_VARS['products_name'];
     $products_description = $HTTP_POST_VARS['products_description'];
     $products_url = $HTTP_POST_VARS['products_url'];
   }

Link to comment
Share on other sites

I've got that code in place, and had sussed out the capitalization problem, but still no show.

Is this really all the code needed to display the dropdown?

<?php echo TEXT_AVAILABILITY; ?>: <?php echo $products_availability_name;

I don't know my way around osCommerce very well still, but should it have a 'tep_draw_pull_down_menu' somewhere?

 

jon

:: Web Jetty

:: ...bringing art to the digital world

:: http://webjetty.co.uk/

Link to comment
Share on other sites

bingo...staring me rihg tin the face...

 

i forgot to transfer the line across to the readme.

 

change that section to:

 

          <tr>
           <td class="main"><?php echo TEXT_PRODUCTS_SHIPPINGETA; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('shippingeta_id', $shippingeta_array, $pInfo->shippingeta_id); ?></td>
         </tr>

Edited by Snowman
Link to comment
Share on other sites

also remove the

 

<?php
  if (tep_not_null($products_availability_info['products_availability_name'])) {
?>

 

section before it and the

 

<?php
  }
?>

section that i said to add immediately after it.

 

that should do it...

 

I built this mod up in a highly modded site and when i stripped it back out i thinkid only had 8 cups of coffee for the day.

 

I will repost the contribution shortly for those who want to start from scratch

Link to comment
Share on other sites

Great..

I'm still not getting the dropdown showing up tho. I guess the test whether to show it or not is saying not to.

<?php
 if (tep_not_null($products_availability_info['products_availability_name'])) {
?>

Any idea why?

jon

:: Web Jetty

:: ...bringing art to the digital world

:: http://webjetty.co.uk/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...