Home › Forums › WoodMart support forum › DISPLAY COLOR AND SIZE BUT NOT PRICE IN SINGLE PRODUCT
DISPLAY COLOR AND SIZE BUT NOT PRICE IN SINGLE PRODUCT
- This topic has 9 replies, 2 voices, and was last updated 2 months, 3 weeks ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
December 15, 2024 at 10:55 pm #622640
aceitcreatorParticipantActually, i Hide add to cart and price but… is there any shortcode where i can display the color and size when you click the product?
December 16, 2024 at 2:57 pm #622854
Aizaz Imtiaz AwanKeymasterHello,
Do you want to show the add to cart button and price on the product page only when the user clicks or selected the variations from the product?
Best Regards.
December 16, 2024 at 7:27 pm #622965
aceitcreatorParticipantI want to display variations such as size and colors on the single product page, but show the price only to registered users.
December 17, 2024 at 1:43 am #623025
aceitcreatorParticipantAs shown in the screenshot, I cannot select the color or size options when I hide the prices. I would like to know if there is any shortcode or method that allows users to select colors and sizes on the single product page, while keeping the prices hidden so that only registered users can see them.
December 17, 2024 at 4:57 pm #623259
Aizaz Imtiaz AwanKeymasterHello,
Please try to use the below code and paste it to Child Theme’s Functions.php file:
add_action('init', 'remove_price_ifnotloggedin'); function remove_price_ifnotloggedin() { if ( !is_user_logged_in() ) { // Hide price on single product pages remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10); // Add a custom message add_action('woocommerce_single_product_summary', 'price_message', 10); } } function price_message() { echo '<span>Please login to see price!</span>'; }
This code will remove the price for the unregistered users and the variations are also clickable.
Best Regards
December 17, 2024 at 7:50 pm #623343
aceitcreatorParticipantthe code is not working.
Also the color is not showing anymore. Could you check it?
I’m testing it in this link https://staging2.holiclothing.com.ar/Attachments:
You must be logged in to view attached files.December 18, 2024 at 3:53 am #623393
aceitcreatorParticipanti had to delete and reset the staging link because color and size was not displaying in single product.
December 18, 2024 at 4:12 pm #623608
Aizaz Imtiaz AwanKeymasterHello,
Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.
Best Regards
December 19, 2024 at 3:28 am #623746
aceitcreatorParticipantAs you can see from this link: [link], the page is working. However, when you ‘add to cart,’ the price is still displayed. Is it possible to make it so that items can only be added to the cart if the user is registered? Also, on the product page, the price continues to show.
Attachments:
You must be logged in to view attached files.December 19, 2024 at 11:22 am #623831
Aizaz Imtiaz AwanKeymasterHello,
Thank you for your inquiry. Unfortunately, the current Theme Settings do not provide an option to accommodate your request. Achieving the desired functionality will require more extensive customization within the theme files, and potentially within WooCommerce plugin files as well.
Please note that this level of customization goes beyond the scope of our standard support policy. We appreciate your understanding regarding our limitations in this matter.
Regards.
Xtemos Studios -
AuthorPosts
- You must be logged in to create new topics. Login / Register