Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Timo

    (@worschtebrot)

    Yes, this is the new URL format of PA API 5.0.

    With ASA1 1.4.x this URL comes from

    lib/Asa/Service/Amazon/Item/PaApi5.php::getDetailPageURL() (Line 119)

    I will add a hook ‘asa1_detail_page_url’ for convenience with the next update. Until then, you can add your former hack to this method and move it to e.g. functions.php with the next update and the new hook.

    Thread Starter WPDoode

    (@wpdoode)

    Thanks for the quick change in ASA1 1.4.3.

    What code do I have to use in functions.php to change the URL format like this?

    https://www.amazon.xx/dp/ASIN?SubscriptionId=XXX&tag=AssociateID

    I use the Subscription ID to indicate that these sales come from the PA-API.

    What exactly do these parameters say?

    &linkCode=ogi&th=1&psc=1

    Plugin Author Timo

    (@worschtebrot)

    Sorry for the late reply.

    This is an example code for what you need to adjust the URL format:

    
    function fetch_asa1_detail_page_url($url) {
        // where $ulr would be something like
        // https://www.amazon.de/dp/B0756CYWWD?tag=xyz-21&linkCode=ogi&th=1&psc=1
        // to add another parameter:
        $url .= '&SubscriptionId=XXX';
        return $url;
    }
    
    add_filter('asa1_detail_page_url', 'fetch_asa1_detail_page_url');
    

    Honestly I currently don’t know what the parameters linkCode, th and psc are there for. Probably it wouldn’t hurt to cut them out, but I wouldn’t recommend it. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘{$AmazonUrl} with ASA 1.41 and PA API 5.0’ is closed to new replies.