Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help - Default text for product description


superFreakE

Recommended Posts

Posted

When creating a new product how would I set it so the description box has some default text already in it to save the client typing the same thing every time?

 

Can anyone please point me in the right direction?

Posted

I worked it out if anyone is interested :

 

Put this at the top and add the string $default_description to the text area value.

 

// default product description

if(isset($HTTP_GET_VARS['pID'])){

$default_description = "";

} else { $default_description = "<b>Some default text</b>";

}

  • 7 months later...
Posted

This is exactly what I'm looking for, but I don't wquite understand, put it in the top of what? and where is the text area value? to put the "$default_description" in?

 

 

I worked it out if anyone is interested :

 

Put this at the top and add the string $default_description to the text area value.

 

// default product description

if(isset($HTTP_GET_VARS['pID'])){

$default_description = "";

} else { $default_description = "<b>Some default text</b>";

}

  • 3 weeks later...
Posted
This is exactly what I'm looking for, but I don't wquite understand, put it in the top of what? and where is the text area value? to put the "$default_description" in?

 

 

File: admin/categories.php

 

After line 18 (approx):

 

Add:

 

// default product description
// you can put anything instead of the HTML code I have entered
if(isset($HTTP_GET_VARS['pID'])){
 $default_description = ""; 
} else {   $default_description = "<b>Dimensions:</b> <br>
<b>Length:</b> <br>
<b>Width:</b> <br>
<b>Height:</b> <br>
<b>Depth:</b> <br>
<b>Diameter: </b>"; 
}

 

 

Then around line 538:

 

Replace:

 

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

With:

 

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($HTTP_GET_VARS['pID']) ? tep_get_products_description($pInfo->products_id, $languages[$i]['id']) : stripslashes($default_description))); ?></td>

Posted

Thank you so much, it works Great! I can't thank you enough, I was also wondering if you knew a way to add several drop down menus, just in the admin and when a selection is made while adding a new product from the drop downs it would show in the description, any help or direction on documents that can help me do this would be great if you know of any, Again THANKS SO MUCH FOR YOUR HELP!

 

 

File: admin/categories.php

 

After line 18 (approx):

 

Add:

 

// default product description
// you can put anything instead of the HTML code I have entered
if(isset($HTTP_GET_VARS['pID'])){
 $default_description = ""; 
} else {   $default_description = "<b>Dimensions:</b> <br>
<b>Length:</b> <br>
<b>Width:</b> <br>
<b>Height:</b> <br>
<b>Depth:</b> <br>
<b>Diameter: </b>"; 
}

Then around line 538:

 

Replace:

 

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

With:

 

<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($HTTP_GET_VARS['pID']) ? tep_get_products_description($pInfo->products_id, $languages[$i]['id']) : stripslashes($default_description))); ?></td>

Archived

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

×
×
  • Create New...