Home Forums Space themes support forum Adding a service to a product card

Adding a service to a product card

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #643188

    foxsale55
    Participant

    The store sells air conditioners, we install them, how do we add to the product profile the option to choose a service, with or without installation, in addition to buying the product itself? When adding a service, the price should change. Is it possible?

    Attachments:
    You must be logged in to view attached files.
    #643200

    foxsale55
    Participant

    It can be done with standard variations on the screenshot, but I need the second price not to be displayed! Perhaps you can tell me more methods of solving this issue.

    It is necessary that only one price is displayed in the product and on all pages, which is rectangle in red.

    • This reply was modified 3 weeks ago by foxsale55.
    Attachments:
    You must be logged in to view attached files.
    #643383

    Luke Nielsen
    Keymaster

    Hello,

    Add the code below to the functions.php in your child theme:

    if ( ! function_exists('xts_variable_single_price')) {
    	function xts_variable_single_price( $price, $product ) {
    		if ( $product->is_type( 'variable' ) ) {
    			$prices = $product->get_variation_prices( true );
    			$min_price = current( $prices['price'] );
    
    			$price = wc_price( $min_price );
    		}
        	return $price;
    	}
    
        add_filter( 'woocommerce_get_price_html', 'xts_variable_single_price', 10, 2 );
    }

    Clear the cache and check how it works.

    Kind Regards

    #643614

    foxsale55
    Participant

    Yes? its work!
    Tnx.

    I ran into another problem. There is a brand block on the main page. There are images when editing in the elementor, but there are no images when viewing the site page. What could be the problem? I am developing the website on a local server.

    Attachments:
    You must be logged in to view attached files.
    #643745

    Luke Nielsen
    Keymaster

    Hello,

    Please disable all plugins except these ones:

    Elementor
    Core plugin
    WooCommerce
    Enable the Parent theme

    Then activate the plugins one by one, checking the issue to detect which one causes the problem.

    Let me know the result.

    Kind Regards

    #643988

    foxsale55
    Participant

    I applied the updates in the theme patcher, everything worked.

    #644436

    Artem Temos
    Keymaster

    Great, we are glad that you sorted it out. Feel free to contact us if you have any further questions.

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

The topic ‘Adding a service to a product card’ is closed to new replies.