Advertisement:

Author Topic: [SOLVED] How to solve the "zero" free price  (Read 3956 times)

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: [SOLVED] How to solve the "zero" free price
« Reply #30 on: September 20, 2017, 12:02:55 am »
In which case?  Price 0 or price null(=price disabled) ?
Normally it should remove de custom text only while the price is null / disabled.

The other hook should work for price==0.

Aficionado

  • Guest
Re: [SOLVED] How to solve the "zero" free price
« Reply #31 on: September 20, 2017, 01:29:12 am »
In which case?  Price 0 or price null(=price disabled) ?
Normally it should remove de custom text only while the price is null / disabled.

The other hook should work for price==0.

When the price is disabled in that category, when the second hook is removed, i get the Osclass languages text.

Aficionado

  • Guest
Re: [SOLVED] How to solve the "zero" free price
« Reply #32 on: September 20, 2017, 01:37:28 am »
Actually maybe i'm doing something wrong. Just hold this for a while pls.

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: [SOLVED] How to solve the "zero" free price
« Reply #33 on: September 20, 2017, 06:33:17 am »
Code: [Select]
function cust_item_price_zero(){
    return __('Your own text');
}

if (osc_price_enabled_at_items()) {
    osc_add_filter ('item_price_zero', 'cust_item_price_zero');
    osc_add_filter ('item_price_null', 'cust_item_price_zero');
}


maybe this is helpful

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: [SOLVED] How to solve the "zero" free price
« Reply #34 on: September 20, 2017, 10:14:31 am »
In which case?  Price 0 or price null(=price disabled) ?
Normally it should remove de custom text only while the price is null / disabled.

The other hook should work for price==0.

When the price is disabled in that category, when the second hook is removed, i get the Osclass languages text.

Exactly my point.This is how it should work. In this case if price is disabled you see 'Check with seller' because in that case price is null.

If the price is 0 you see 'your custom text'.

Doesn't this resolve your issue about price disabled/enabled that you mentioned?

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: How to solve the "zero" free price
« Reply #35 on: September 26, 2017, 02:25:58 pm »
The way the price is used in Osclass is by design, a choice once made and a fundamental one.
Your users seem to enter a 0 price as where they mean 'Ask me' so the first thing you need if not already in your theme is the price explanation ie. 0 = FREE / Empty = ASK and if your users are blind or just ignorant what are you going to fix? 8)

In case you want a different price approach it is best to make these in the theme & functions.php ie. the Liath solution is doable however the category pricing is still being handled in core JS according to price design.

Here's another possible theme solution trying to help your users selecting a price:

-- * Price * ----------------------------------------------
|  O Free  O Ask  O [ 0,00 ]  [ currency dropdown ]  |
-----------------------------------------------------------

OR

-- * Price * -----------------------------
|  O Free                                         |
|  O Ask                                          |
|  O [ 0,00 ]  [ currency dropdown ]  |
------------------------------------------

OR

-- * Price * ------------
|  [ price dropdown ] |
-------------------------

With the options; "Free", "Ask Seller", "Enter Price" so when the latter is selected the price input field and currency selector are displayed.

"Ask" can be set to default so it would save many of your users the extra input and making it vast impossible to post using incorrect price. There's no need to change the price logic with regard to the price input design is there?

"What" is being displayed based on user selection is handled in PO/MO files, no need to add filters really.
If you want to 'swap' '' and 0 text display you could also simply change this in PO/MO ie. the text "Ask seller" becomes "Free" and "Free" becomes "Ask seller" and ofcourse you would also have to change the price explanation for this and any related search text. This way labels are kept consistent by Osclass and users can enter a zero and see the text "Ask Seller" insetad of "Free". It is all a matter of how you want your users to "SELECT" the correct price.


You could recplace the "free" word in language files with "ask for price".

Tried that, BUT the price field is also shows at Items and the label was totally wrong to display.

Maybe i could inject a message in there, apart from the language file. Next to the Price field or above.