WordPress.org

Forums

Amazon Reloaded for WordPress
[resolved] Fix for broken image links (2 posts)

  1. Thoms
    Member
    Plugin Contributor

    Posted 3 years ago #

    Today, I have noted, the plugin not longer display's working image-links. Since I use the plugin for a long time and found no alternative wich works as easy as this plugin, I have doing a little bit of debugging and found a workaround for this issue.

    There is a new node in the small-result in the amazon webservice response. This has also URL-Nodes. The plugin extract all nodes by name 'URL' and use the add-to-wishlist links instead of the image-links.

    So I have added 2 lines of code to remove the ItemLinks-Node. This works for now, but it looks like a hot-fix. Maybe it's better to work with the image-nodes directly.

    So, here is the hotfix: After line 71 add these lines, so it looks like:

    $responseDocument = DOMDocument::loadXML($response['body']);
    
    				// Start - Remove ItemLinks node for working imagelinks
    				$itemlinks = $responseDocument->getElementsByTagName('ItemLinks')->item(0);
    				$itemlinks->parentNode->removeChild($itemlinks);
    				// End - Remove ItemLinks node for working imagelinks
    
    				$errorFields = $responseDocument->getElementsByTagName('Error');

    I hope this helps people like me, using this plugin.

    http://wordpress.org/extend/plugins/amazon-reloaded-for-wordpress/

  2. Thoms
    Member
    Plugin Contributor

    Posted 3 years ago #

    First fix only worked on the first item. Move the block in the loop and modify the object on wich it removes.

    It's now after the line 82 and looks like this:

    $detailPageUrl = $this->getFirstElementValueForTagName($item, 'DetailPageURL');
    
    // Start - Remove ItemLinks node for working imagelinks
    $itemlinks = $item->getElementsByTagName('ItemLinks')->item(0);
    $itemlinks->parentNode->removeChild($itemlinks);
    // End - Remove ItemLinks node for working imagelinks
    
    $imageUrls = array();

    This works on all results from a search.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Amazon Reloaded for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic