Site logo

Archived topic

Login to view prices

5 replies · Started by Georgi on June 16, 2019

Viewing posts 1–6 of 6

Hello,

Is there a way to make my shop hide prices and instead show a button "Login to view prices" or something along these lines?

Kind regards,
Georgi

Thank you, it worked.

However "Login to see prices" is displayed as text. Do you know how it can be turned to a button instead?

Kind regards,
Georgi

this line of code:

echo '<a href="' . get_permalink(wc_get_page_id('myaccount')) . '">' . __('Login to see prices', 'theme_name') . '</a>';

You can add a button class to the <a> tag like so:

echo '<a class="button" href="' . get_permalink(wc_get_page_id('myaccount')) . '">' . __('Login to see prices', 'theme_name') . '</a>';

Thank you, thank you so much! <3

Glad to be of help

This archived topic is closed to new replies.