- Posts: 12
- Thank you received: 0
Add "+ tax" string to cart editing popup
- Dario Poma
-
Topic Author
- Offline
Enrico wrote: Dear Dario,
I think the best way would be that we do some tests in your test environment. But as you can understand this activity is out of WPC Support because it's a specific customization.
If you are interested in having a quotation, please send the same request here altoswebsolutions.com/contact-us
Or you can simply tell me how to add this filter only in the cart page. Please, I need just this information.
Have a nice day.
Please Log in or Create an account to join the conversation.
- Enrico
-
- Offline
- Posts: 367
- Thank you received: 18
I think the best way would be that we do some tests in your test environment. But as you can understand this activity is out of WPC Support because it's a specific customization.
If you are interested in having a quotation, please send the same request here altoswebsolutions.com/contact-us
Kind Regards,
Enrico
AT1078
Please Log in or Create an account to join the conversation.
- Dario Poma
-
Topic Author
- Offline
- Posts: 12
- Thank you received: 0
bill wrote: add_filter('awspc_filter_calculate_price_ajax_response', 'custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response[/'price'] = $params[/'price']." included taxes";
return $response;
}
Good morning,
I tried the code and it's working now.
However, I would like this code to be executed only in the shopping cart (i.e. only in the popup that appears when you click on "edit"). I tried the "if ( is_cart() )" condition but it doesn't work.
Could you help me?
Thank you!
Please Log in or Create an account to join the conversation.
- bill
-
- Offline
- Posts: 52
- Thank you received: 8
sorry for the misunderstanding, i just added the code correctly. When you will try to insert the code just need to take off the "/" where i have inserted it
add_filter('awspc_filter_calculate_price_ajax_response', 'custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response[/'price'] = $params[/'price']." included taxes";
return $response;
}
Waiting for your feedback
Kind Regards,
Bill
AT1078
Please Log in or Create an account to join the conversation.
- Dario Poma
-
Topic Author
- Offline
- Posts: 12
- Thank you received: 0
bill wrote: add_filter('awspc_filter_calculate_price_ajax_response', 'custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response = $params." included taxes";
return $response;
}
Hi,
I tried the code (which is the same as the one you wrote in the previous message) but it doesn't work and it's a failure.
Can you please check it? With your code the calculation is no longer done and the price disappears.
Here the site: retisumisura.sviluppo.host/shop/reti-pro...reggiante-su-misura/
Please Log in or Create an account to join the conversation.
- bill
-
- Offline
- Posts: 52
- Thank you received: 8
sorry for the delay of giving you an answer.
Here is the code that you need to use and works correctly
add_filter('awspc_filter_calculate_price_ajax_response', 'custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response = $params." included taxes";
return $response;
}
Waiting for your feedback
Kind Regards,
Bill
AT1078
Please Log in or Create an account to join the conversation.
- Dario Poma
-
Topic Author
- Offline
- Posts: 12
- Thank you received: 0
bill wrote: add_filter('awspc_filter_calculate_price_ajax_response','custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response = $params." included taxes";
return $response;
}
Good morning,
I tried the code you wrote but it doesn't seem to work.
With the code active, in fact, the price disappears and the calculation of the final price is not successful.
Is there something wrong or something I didn't understand?
Thank you
Please Log in or Create an account to join the conversation.
- bill
-
- Offline
- Posts: 52
- Thank you received: 8
regarding your request you can use the code above:
add_filter('awspc_filter_calculate_price_ajax_response','custom_awspc_filter_calculate_price_ajax_response', 10, 2);
function custom_awspc_filter_calculate_price_ajax_response($response, $params){
$response = $params." included taxes";
return $response;
}
Waiting for you feedback
Kind Regards,
Bill
AT1078
Please Log in or Create an account to join the conversation.
- Dario Poma
-
Topic Author
- Offline
- Posts: 12
- Thank you received: 0
bill wrote: Regarding your request, the hook changes the string of the price only on shop and the product page, its not available on the cart.
Good morning,
is it possible to have another solution to add the string "+ tax" in the popup where indicated by the image attached to the previous post? Is there another hook or something else I can use to insert the string?
Thank you and have a nice day
Please Log in or Create an account to join the conversation.
- bill
-
- Offline
- Posts: 52
- Thank you received: 8
sorry for the delay of giving you an answer.
Regarding your request, the hook changes the string of the price only on shop and the product page, its not available on the cart.
Kind Regards,
Bill
AT1078
Please Log in or Create an account to join the conversation.
- Dario Poma
-
Topic Author
- Offline
- Posts: 12
- Thank you received: 0
I used this code to insert the string "+ tax" into the prices in the products single page and categories.
function change_product_price_html($price) {
$newPrice = $price;
$newPrice .= '+ tax';
return $newPrice;
}
add_filter('woocommerce_get_price_html', 'change_product_price_html');
When I click on the "Edit" button of a product in the shopping cart, the popup for editing the fields of your plugin appears. In the price, however, does not appear the string "+ tax" after the price displayed (see attachment).
How can I solve and insert the string?
Please Log in or Create an account to join the conversation.