Add + tax” string to cart editing popup”

Home – SaaS Forums Support questions WooPrice Calculator (Pro) Add + tax” string to cart editing popup”

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #5172
    Dario Poma
    Participant

    Good morning,
    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?

    #5185
    bill
    Participant

    Hello Dario,
    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

    #5184
    Dario Poma
    Participant

    [quote=”bill” post=2076]
    Regarding your request, the hook changes the string of the price only on shop and the product page, its not available on the cart.
    [/quote]

    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

    #5182
    bill
    Participant

    Hello Dario,

    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[‘price’] = $params[‘price’].” included taxes”;
    return $response;
    }

    Waiting for you feedback
    Kind Regards,
    Bill
    AT1078

    #5180
    Dario Poma
    Participant

    [quote=”bill” post=2078]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;
    }[/quote]

    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

    #5179
    bill
    Participant

    Hello Dario,

    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[‘price’] = $params[‘price’].” included taxes”;
    return $response;
    }

    Waiting for your feedback
    Kind Regards,
    Bill
    AT1078

    #5178
    Dario Poma
    Participant

    [quote=”bill” post=2082]
    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;
    }
    [/quote]

    Hi,
    I tried the code (which is the same as the one you wrote in the previous message) but it [b]doesn’t work[/b] 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: https://retisumisura.sviluppo.host/shop/reti-protezione/teli-ombreggianti/telo-ombreggiante-su-misura/

    #5177
    bill
    Participant

    Hello Dario,

    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

    #5176
    Dario Poma
    Participant

    [quote=”bill” post=2086]
    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;
    }[/quote]

    Good morning,
    I tried the code and it’s working now.
    However, I would like this code to be executed [b]only in the shopping cart[/b] (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!

    #5174
    Enrico
    Participant

    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 https://altoswebsolutions.com/contact-us

    Kind Regards,
    Enrico
    AT1078

    #5173
    Dario Poma
    Participant

    [quote=”Enrico” post=2111]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 https://altoswebsolutions.com/contact-us
    [/quote]

    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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.