• Resolved Michael

    (@miklog)


    Greetings!

    I use APIAP to display prices which I arrange in a table using the popular and free TablePress plugin.

    When using any of the price variables the prices are displayed with comma between the thousands and a dot between the full dollar and cent values. (e.x. $1,999.99 USD)

    The formatting breaks the sorting possibility in the published TablePress table. (see e.x.: https://michaelkowalczyk.eu/gear/ricoh-gr-smallest-lightest-fixed-prime-lens-camera/)

    Would it be possible to parse the price without the comma and dot? (ex. $1999 USD)

    This would allow to sort the price from low to high in a proper way.

    Thank you for the support and have a good week!

    Best, Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    thanks for your question, and sorry for the trouble.
    This is Tobias, the developer of TablePress.

    It’s not the , or . that is breaking the sorting here, from what I can see. It might be the extra HTML code around the price value (like

    <div class="amazon-element-wrapper">
    <div class="amazon-element-LowestNewPrice">$1,299.00 USD</div>
    </div>

    but it could also be that there is both a $ symbol and the USD.

    Regards,
    Tobias

    Thread Starter Michael

    (@miklog)

    Hallo Tobias! @tobiasbg and thanks for your quick reply!

    I solved the problem a bit by switching to another Amazon Plugin (ASA1).
    This is to my research, trial and error the only plugin which displays prices so that they can be sorted using TablePress! There is another which is called EAPI that might work, but it is currently only working with German Amazon API.

    So ASA1 seems to work, although only when “asynchronous” product load is disabled. The page loading can take a looong time, which is not so good in terms of user friendliness. I wonder if anyone has better experience with the ASA2 Plugin?!.

    Sorry about discussing this in the support forum of “Amazon Product in a Post” Plugin!

    Best, Michael

    Hi,

    yeah, asynchronous loading does not work, as the DataTables JS library needs the data for the sorting right away ?? Anything else would require custom JavaScript code.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Price Formatting (Removing comma and dot) for sorting using TablePress’ is closed to new replies.