Make Price Required

I know we can create a custom field for price and make it required.

But the site is already built and with many items.

If we create a new field and make it required, we will need to change many things around our template.

So I wonder if we can just make the price default field required when posting or selling?

See attached image.

Tagged:

Comments

  • Hello

    Please in file components/com_djclassifieds/views/additem/tmpl/default.php change lines 881 and 890
    from
    <?php if($par->get('show_tooltips_newad','0')){ ?>

    <?php }else{ ?>

    <?php } ?>
    to

    <?php if($par->get('show_tooltips_newad','0')){ ?>

    <?php }else{ ?>

    <?php } ?>


    and also lines 893 and 914 from
    get('price_only_numbers','0')){echo ' validate-numeric';}?>" type="text" name="price" id="price" size="30" maxlength="250" value="<?php echo $this->item->price; ?>" />
    to
    get('price_only_numbers','0')){echo ' validate-numeric';}?>" type="text" name="price" id="price" size="30" maxlength="250" value="<?php echo $this->item->price; ?>" />


    This should make price required.

    Best Regards,
    Lukasz
  • Your second snippet is the same
  • edited September 19
    Hello

    I see that forum editor parsed my code , regarding to second change please in lines 893 and 914 modify code from


    get('price_only_numbers','0')){echo ' validate-numeric';}?>" type="text" name="price" id="price" size="30" maxlength="250" value="<?php echo $this->item->price; ?>" />

    to

    get('price_only_numbers','0')){echo ' validate-numeric';}?> required" type="text" name="price" id="price" size="30" maxlength="250" value="<?php echo $this->item->price; ?>" />


    Best Regards,
    Lukasz
Sign In or Register to comment.