Support » Plugin: Auto Amazon Links - Amazon Associates Affiliate Plugin » How to remove kg label in prices?

  • Resolved yoneo12



    I am using the following shortcodes:

    [amazon_link asins='B08591QTKW' template='amzfuer' store='cleverpedia04-21' marketplace='DE' link_id='2403256db0a17701114363cd35937247']

    For some products, the price is displayed as follows: “120,47 € (177,16 € / kg) 114,99 € (169,10 € / kg)”. That doesn´t makes sense (because I link to scientific calculators, where the kg price is not relevant).

    I want to show the price for all products in standard format like “100 € 90,47 €”.

    Where can I force this? I haven´t found a setting yet.

    Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author miunosoft



    I checked the product page,, and it seems they have that price format such as 149,99 € (208,32 € / kg). So it is something that the Amazon API gives.

    To force the price text to remove the part enclosed in parentheses, you need to use a filter hook. I uploaded an example here. Try it and let me know if that is what you are looking for.

    Thread Starter yoneo12


    Thank you so much for the detailed explanation and the code example. I have placed the code into the functions.php file.

    It works nearly perfectly. There is just one bug: Only the proper price is displayed, the offer price is missing for the products that have had before a kg price.

    Do you know how I can fix this? It would be also ok if in general only the offer/normal price is displayed and the proper price aren´t shown.

    I´m sorry, I am not familiar with customizing filters yet.

    Plugin Author miunosoft


    I see.

    I updated the code on Gist. Hope this helps.

    By the way, in case you are not ware, it can be run as a plugin by downloading it as zip with the button at the top right corner.

    Thread Starter yoneo12


    Works perfectly. Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to remove kg label in prices?’ is closed to new replies.