Adding a service to a product card
-
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.
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 4 months, 3 weeks ago by
foxsale55.
Attachments:
You must be
logged in to view attached files.
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
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.
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
I applied the updates in the theme patcher, everything worked.
Great, we are glad that you sorted it out. Feel free to contact us if you have any further questions.
The topic ‘Adding a service to a product card’ is closed to new replies.