Classifieds Single Template in my Child Theme showing an error

Hi Support

I would like to change the output of the cost field to auto include a currency symbol. I get the following error on a single classified page.

Using $this when not in object context

What I did was to copy the classifieds\ui-front\general\single-classifieds.php from the plugin and move it into the root of my child theme. (the parent theme is canvas from WooThemes)

I check the usage tab on the classified directory page on the wpmudev.org site and you dont mention anything about being able to overwrite the templates.

Can I overwrite the templates like this or should I be using a filter to modify the output. Am I missing something that should be included?

  • aristath
    • Recruit

    Hello feedmymedia,

    Just thinking a bit out of the box here, but if all you want to do is to include the currency symbol, why don't you simply enter your price including the currency?

    Classifieds is using CustomPress at its core so it's a bit more complicated if you want to automate it.

    Please advise,
    Aristeides.

  • feedmymedia
    • Design Lord, Child of Thor

    Hi Aristath

    Our problem is end users, the variations they enter there are along these lines.

    0, free, R0, R100, 100 and just left blank. We made a little filter that always out puts it as "Free" or "R{value}".

    I have just fixed the problem though :slight_smile: , I did some digging and found the global $Classifieds_Core. I simply replaced all of the "$this->" statements with "$Classifieds_Core->" in the single-classifieds.php template i copied to my theme.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.