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

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #622640

    aceitcreator
    Participant

    Actually, 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?

    #622854

    Hello,

    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.

    #622965

    aceitcreator
    Participant

    I want to display variations such as size and colors on the single product page, but show the price only to registered users.

    #623025

    aceitcreator
    Participant

    As 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.

    #623259

    Hello,

    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

    #623343

    aceitcreator
    Participant

    the 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.
    #623393

    aceitcreator
    Participant

    i had to delete and reset the staging link because color and size was not displaying in single product.

    #623608

    Hello,

    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

    #623746

    aceitcreator
    Participant

    As 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.
    #623831

    Hello,

    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

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