Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Making product description non-mandatory

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-01-2006, 07:55 AM
 
interstellarsounds interstellarsounds is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 32
 

Default Making product description non-mandatory

When adding a product I need to be able to make the 'short description' field non-mandatory. I do not want to remove the field completely but just make it so it can be left blank. I've searched around the main/product_details.tpl and main/product_modify.tpl but do not know which code to modify?

Any help would be appreciated.
__________________
v4.0.18
Reply With Quote
  #2  
Old 03-15-2006, 04:36 AM
 
danraymo danraymo is offline
 

Newbie
  
Join Date: Sep 2003
Location: MA
Posts: 1
 

Default Required Fields for Product Modify

The required fields can be changed by adjusting line 82 in product_modify.php ----

$fillerror = (($categoryid == "") || empty($product) || empty($descr) || ($price == "") || ($avail == "") || empty($low_avail_limit));

remove "empty($descr) || "
__________________
Dan
dan@raymo.com
Reply With Quote

The following user thanks danraymo for this useful post:
chamberinternet (06-04-2013)
  #3  
Old 04-08-2006, 07:27 AM
  alelover's Avatar 
alelover alelover is offline
 

Newbie
  
Join Date: Mar 2006
Posts: 7
 

Default

I can't seem to find that line.
__________________
Scott
X-Cart Gold 4.0.18
PHP 4.3.9
MySQL 4.1.18
Apache 2.0.55
Windows 2000 Pro
Reply With Quote
  #4  
Old 04-09-2006, 01:48 PM
  alelover's Avatar 
alelover alelover is offline
 

Newbie
  
Join Date: Mar 2006
Posts: 7
 

Default Required fields?

Ahhh. I got it. It was at line 269 in my version.
__________________
Scott
X-Cart Gold 4.0.18
PHP 4.3.9
MySQL 4.1.18
Apache 2.0.55
Windows 2000 Pro
Reply With Quote
  #5  
Old 04-09-2006, 10:29 PM
  Dongan's Avatar 
Dongan Dongan is offline
 

X-Wizard
  
Join Date: Jul 2005
Location: www.mercuryminds.com
Posts: 1,531
 

Default

glad to know that you got it. but, however does it solve your problem exactly what you want?
Reply With Quote
  #6  
Old 04-12-2006, 04:02 PM
  ryno's Avatar 
ryno ryno is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: Tempe, Az
Posts: 30
 

Default

The problem with removing that error checking function from that line (269 for me too btw) is that now it won't validate the Full Description field and that field can now be submitted without being filled out, which is a bad thing.

I'm also wanting to remove the short description box from the admin products page and have had some resistance thusfar. I'm going to dig further, but I believe some further hacking is going to be required.

Any suggestions? If I beat you guys to it I'll reply my findings.
__________________
gold v4.0.18 -> live
...working on another soon
Reply With Quote
  #7  
Old 04-12-2006, 04:28 PM
  ryno's Avatar 
ryno ryno is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: Tempe, Az
Posts: 30
 

Default

Okay - here's the deal.


Don't worry about include/product_modify.php
Leave it alone - it does what it's supposed to.

Edit: /yourSkin/main/product_details.tpl

Instead of this:
Code:
<tr> {if $productids ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[descr]" /></td>{/if} <td class="FormButton" valign="top" nowrap>{$lng.lbl_short_description}* :</td> <td class="ProductDetails"> <textarea name="descr" cols="45" rows="8" class="InputWidth">{$product.descr|escape:"html"}</textarea> {if $top_message.fillerror ne "" and $product.descr eq ""}<font class="Star">&lt;&lt;</font>{/if} </td> </tr>

I replaced that whole row with a hidden field:
Code:
<input type=hidden value=" " name="descr" />

So the textarea doesn't have to be a textarea, its just that the variable "descr" just has to have SOME value - hence the 'space' in the value attribute.

The BEST way to do this, would be to go hack out every insert and validation rule for this field but - time is money and money talks so... It's semi-ugly but extremely effective.

rYno
__________________
gold v4.0.18 -> live
...working on another soon
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:36 AM.

   

 
X-Cart forums © 2001-2020