Advertisement:

Author Topic: I want to add astrix on price field label via css  (Read 165 times)

moinuddin

  • Full Member
  • ***
  • Posts: 102
I want to add astrix on price field label via css
« on: July 14, 2019, 04:07:12 pm »
Hi,

I want to add asterix to price field label on add products / publish page so that users can come to know that it is compulsory..


I have even found a link

https://forums.osclass.org/general-help/adding-an-asterix-to-custom-field/

The only thing is that i dont know the identifier name of the price field.

Hence can anyone help me out ?

Thanks in advance




BritWeb

  • Hero Member
  • *****
  • Posts: 770
  • If it ain't broke, don't fix it.
Re: I want to add astrix on price field label via css
« Reply #1 on: July 14, 2019, 05:34:53 pm »
Do the following

Add this to your 'main.css'

Code: [Select]
.price_asterisk:before{font-family:"FontAwesome";content:"\f069"; padding-right:5px; color:#C00}
On your 'item-post.php', find the line '<label class="control-label" for="price"><?php _e('Price', 'bender'); ?></label>' and replace it with '<label class="control-label price_asterisk" for="price"><?php _e('Price', 'bender'); ?></label>'


Regards

moinuddin

  • Full Member
  • ***
  • Posts: 102
Re: I want to add astrix on price field label via css
« Reply #2 on: July 14, 2019, 05:43:45 pm »
Can you let me know the name of identifier of price?..in customer field we can define it by ourselves from admin panel(please look at the attachment)..but in the default fields provided by osclass how can we know their identifier?
« Last Edit: July 14, 2019, 05:46:01 pm by moinuddin »

BritWeb

  • Hero Member
  • *****
  • Posts: 770
  • If it ain't broke, don't fix it.
Re: I want to add astrix on price field label via css
« Reply #3 on: July 14, 2019, 05:50:33 pm »
Show me the page with these custom fields on and I will see if I can help.

Regards

WEBmods

  • Hero Member
  • *****
  • Posts: 936
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: I want to add astrix on price field label via css
« Reply #4 on: July 14, 2019, 06:34:51 pm »
Hello.

If you think price field ID, it's #price, I believe. Just use the suggestion by @BritWeb.

Regards.

moinuddin

  • Full Member
  • ***
  • Posts: 102
Re: I want to add astrix on price field label via css
« Reply #5 on: July 15, 2019, 11:47:49 am »
<div class="control-group control-group-price">
                            <label class="control-label" for="price">Price</label>
                            <div class="controls">
                                <input id="price" type="text" name="price" value="" />                                <select name="currency" id="currency"><option value="INR" selected="selected">indian Rupees ₹ per pair</option><option value="USD">Dollar US$</option></select>                            </div>
                        </div>

This is the html code of the page for price field
« Last Edit: July 15, 2019, 12:09:37 pm by moinuddin »

BritWeb

  • Hero Member
  • *****
  • Posts: 770
  • If it ain't broke, don't fix it.
Re: I want to add astrix on price field label via css
« Reply #6 on: July 15, 2019, 01:34:16 pm »
<div class="control-group control-group-price">
                            <label class="control-label" for="price">Price</label>
                            <div class="controls">
                                <input id="price" type="text" name="price" value="" />                                <select name="currency" id="currency"><option value="INR" selected="selected">indian Rupees ₹ per pair</option><option value="USD">Dollar US$</option></select>                            </div>
                        </div>

This is the html code of the page for price field

Just put the following line of code into your 'main.css'

Code: [Select]
#price:after{font-family:"FontAwesome";content:"\f069"; padding-left:5px; color:#C00}

Regards

WEBmods

  • Hero Member
  • *****
  • Posts: 936
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: I want to add astrix on price field label via css
« Reply #7 on: July 15, 2019, 01:56:07 pm »
<div class="control-group control-group-price">
                            <label class="control-label" for="price">Price</label>
                            <div class="controls">
                                <input id="price" type="text" name="price" value="" />                                <select name="currency" id="currency"><option value="INR" selected="selected">indian Rupees ₹ per pair</option><option value="USD">Dollar US$</option></select>                            </div>
                        </div>

This is the html code of the page for price field

Just put the following line of code into your 'main.css'

Code: [Select]
#price:after{font-family:"FontAwesome";content:"\f069"; padding-left:5px; color:#C00}

Regards


To add to label, not input:

Code: [Select]
label[for=price]:after{font-family:"FontAwesome";content:"\f069"; padding-left:5px; color:#C00}

Regards.

WEBmods

  • Hero Member
  • *****
  • Posts: 936
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: I want to add astrix on price field label via css
« Reply #8 on: July 15, 2019, 01:58:08 pm »
You can even do it without Fontawesome:

Code: [Select]
label[for=price]:after {
    content: "*";
    color: #C00;
    font-size: 20px;
}

Regards.