Import svg from JSON Feed
-
Hello,
thanks for your plugin! I think that is what I am searching for – I just have problems finding the correct config I guess. I want to import svg information from a JSON feed (via another plugin) into a WooCommerce product description. It seems to work fine, except the svg part gets stripped out. The pure number count of the reviews is imported. So there is a correct connection, but I cannot make the svg part get imported. The JSON part looks like this:
<div class='amazon-customer-rating-stars'><div class='crIFrameNumCustReviews' data-rating='40' data-review-count='10601' data-review-url='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx'><span class='crAvgStars'><span class='review-stars'><a href='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx' target='_blank' rel='nofollow noopener'><svg style='position: absolute; width: 0; height: 0; overflow: hidden;' xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' width=0 height=0 viewBox='0 0 160 32'><g id='amazon-rating-stars'><path stroke='#E17B21' stroke-width='2' d='M 16.025391 0.58203125 L 11.546875 10.900391 L 0 12.099609 L 8.8222656 19.849609 L 6.1269531 31.382812 L 16.021484 25.294922 L 25.914062 31.382812 L 23.265625 19.849609 L 32 12.099609 L 20.388672 10.900391 L 16.025391 0.58203125 z M 32 12.099609 L 40.822266 19.849609 L 38.126953 31.382812 L 48.021484 25.294922 L 57.914062 31.382812 L 55.265625 19.849609 L 64 12.099609 L 52.388672 10.900391 L 48.025391 0.58203125 L 43.546875 10.900391 L 32 12.099609 z M 64 12.099609 L 72.822266 19.849609 L 70.126953 31.382812 L 80.021484 25.294922 L 89.914062 31.382812 L 87.265625 19.849609 L 96 12.099609 L 84.388672 10.900391 L 80.025391 0.58203125 L 75.546875 10.900391 L 64 12.099609 z M 96 12.099609 L 104.82227 19.849609 L 102.12695 31.382812 L 112.02148 25.294922 L 121.91406 31.382812 L 119.26562 19.849609 L 128 12.099609 L 116.38867 10.900391 L 112.02539 0.58203125 L 107.54688 10.900391 L 96 12.099609 z M 128 12.099609 L 136.82227 19.849609 L 134.12695 31.382812 L 144.02148 25.294922 L 153.91406 31.382812 L 151.26562 19.849609 L 160 12.099609 L 148.38867 10.900391 L 144.02539 0.58203125 L 139.54688 10.900391 L 128 12.099609 z' /></g><defs><linearGradient id='star-fill-gradient-40'><stop offset='80%' stop-color='#FFA41C'/><stop offset='80%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-47'><stop offset='94%' stop-color='#FFA41C'/><stop offset='94%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-46'><stop offset='92%' stop-color='#FFA41C'/><stop offset='92%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><defs><linearGradient id='star-fill-gradient-43'><stop offset='86%' stop-color='#FFA41C'/><stop offset='86%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><image src='https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-4-0.gif' /></svg><svg xmlns='https://www.w3.org/2000/svg' xmlns:xlink='https://www.w3.org/1999/xlink' viewBox='0 0 160 32' enable-background='new 0 0 160 32'><title>4.0 out of 5 stars</title><defs><linearGradient id='star-fill-gradient-40'><stop offset='80%' stop-color='#FFA41C'/><stop offset='80%' stop-color='transparent' stop-opacity='1' /></linearGradient></defs><use xlink:href='#amazon-rating-stars' fill='url(#star-fill-gradient-40)' /><image src='https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-4-0.gif' /></svg></a></span><span class='review-count'>(<a href='https://www.amazon.de/product-reviews/B076FQHCMH?tag=xxx' target='_blank' rel='nofollow noopener'>10601</a>)</span></span></div></div>
If I copy that into WooCommerce manually it also works fine and shows up correctly.
Your help would be highly appreciated! Thanks a lot!
- The topic ‘Import svg from JSON Feed’ is closed to new replies.