Formatting %wc_price%

#166004
  • Resolved Frank
    Rank Math free

    Hi there,

    I’d need to adapt the %wc_price% variable for the meta title. Here I only want to display prices without any after-comma values (e.g. 49€). The default %wc_price% displays prices as 39,00 EUR, which makes the title unattractive and long. Thanks for help.

    Frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    Since the %wc_price% variable gets the price you have setup in WooCommerce, you can adjust your settings in WooCommerce > Settings > General: Currency Options like this:
    wc_price adjust

    Then, your %wc_price% will look like this:
    wc_price

    I hope that helps. Thank you, and looking forward to your update.

    Frank
    Rank Math free

    Thanks a lot for your detailed answer. I understand that Rankmath takes the formatting from Woocommerce, but what if I want to have a format without values behind the comma for Meta titles and keep the Woocommerce format with values behind the comma for the shop? Thanks, Frank

    Hello,

    Thank you for the follow-up, and sorry for the delay.

    The variable %wc_price% is activated in Rank math product variables when WooCommerce is activated, and couldn’t be modified.

    In that case, you may have to create your own variable and add it to the titles and meta variables using this filter:
    https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-variables.

    I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Formatting %wc_price%’ is closed to new replies.