2 questions (string customization + package upgrades)

This topic contains 3 replies, has 2 voices, and was last updated by  Kor 7 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #439720

    Ervin Domonkos
    Free User
    Post count: 1

    Hello,

    I am a developer and customizing a GeoDir based site for my client. I have 2 questions for you:

    1. Is it possible to use conditional constant definitions in language.php in the future versions?
    E.g. if I want to use a custom string for
    define(‘NEW_USER_TEXT’, __(“New User? Register Now”, ‘geodirectory’));

    then I can pre-define this string in my child theme like this:
    define(‘NEW_USER_TEXT’, __(“Click here to Register”, ‘geodirectory’));

    However, in this case WP_DEBUG throws me warnings (I always develop with DEBUG ON, so it’s a bit annoying).

    If you used conditional constant definitions in language.php, like:
    if ( !defined( ‘NEW_USER_TEXT’ ) ) define(‘NEW_USER_TEXT’, __(“New User? Register Now”, ‘geodirectory’));

    then I could simply overwrite these strings and wouldn’t need to use tricky and hacky solutions in some places.

    2. Upgrade listing packages in the front end

    We are using the Payment Manager add-on (my client has the license for it, thus I’m asking here), however, I couldn’t figure out yet how we could Upgrade a free listing to a paid one.

    We have 2 packages: Free and Premium.

    What I would like to achieve is the following:
    – User adds a Free listing
    – Later, thanks for our marketing strategy, they decide to upgrade to the Premium one
    – User goes to the listing’s single page, clicks on a link that says “Upgrade to Premium” (or something similar)
    – Fills out the Premium form and pays

    Is it something we can achieve somehow? Did I just miss something is the setup screens?

    Our theme is based on Supreme Directory.

    Thanks in advance,
    Ervin

    #439723

    Kor
    Moderator
    Post count: 16516

    Hi Ervin,

    Thanks for your post. Let me try to answer your questions accordingly.

    1. You can just use the translation method here to change the texts. https://docs.wpgeodirectory.com/translate-core/

    2. You’ll have to log in to the account where your client purchased the “Payment Manager” addon in order for us to assist you further with this.

    #439755

    Ervin Domonkos
    Free User
    Post count: 1

    Hi Kor,

    Thank you for your answers.

    1. I’m feeling like using the translation files would be an overkill here as I just need to modify 1-2 strings (unfortunately not all of them can be filtered). So I think I’ll be able to live with the PHP warning.

    Is there any technical barrier why these constants can’t be added as conditionals? If there is no such barrier, I’m happy to contribute an update to this part of the plugin as it seems it just needs a regexp replace to be run on this file.

    2. OK, I understand. I’ve just got the login credentials from my client, so I’ll ask it again in the add-on’s forum.

    Thanks,
    Ervin

    #439895

    Kor
    Moderator
    Post count: 16516

    Hi Ervin,

    Thanks for your reply. We wouldn’t recommend editing the core files just to change the texts and the translation method would be the best way to achieve this. Anyway, feel free to add this to our official feature request list here https://wpgeodirectory.com/requests/

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount