
Spreadshirt ist ein Onlineservice, bei dem man sich seine eigenen T-Shirts designen und in einem Shop zum Verkauf anbieten kann. Bietet sich vor allem für Vereine an, die ein kleines Budget haben und somit nicht die finanziellen Mittel um große Mengen an T-Shirts drucken zu lassen um diese dann zu verkaufen.
Für die Band ChaoZ hatte ich nun den Auftrag ein einfaches Plugin für WordPress zu entwerfen, welches die Artikel des Spreadshirt-Shops auch in WordPress anzeigt und verlinkt. Entstanden ist dabei WP Spreadshirt, ein Plugin mit dem per Shortcode auf jeder beliebigen Seite innerhalb von WordPress diese Artikel angezeigt werden.
Der Shortcode selbst benötigt zwei Optionen, die Shop-ID und die Shop-URL. Beides erfährt man im Backend von Spreadshirt.
Beispiel:
1 | [spreadshirt shop_url="http://chaoz.spreadshirt.de/shop/" shop_id="602194" shop_location="eu/na"] |
Oder:
1 | [spreadshirt shop_url="http://chaoz.spreadshirt.de/" shop_id="602194" shop_location="eu/na"] |
Wichtig dabei ist nur der Slash „/“ am Ende der URL.
Version: 1.6.3
02. November 2012
- Tested up to WordPress 3.8-alpha
Version: 1.6.2
- More sanitizing of article-uri. Spreadshirt has a very inconsistent way to rewrite special chars -.-
Version: 1.6.1
- Fixed sanitizing of the article-uri
Version: 1.6
- New option for shortcode.
shop_location
Set this to „eu“ for european based shops or to „na“ for northern america based shops. Spreadshirt has two separated APIs for this location. This will hopefully fix some problems displaying the wrong articles.
Version: 1.5
- Link sanitizing: Removed the comma (,) from the article-links.
Version: 1.4
- Changed the XML-URL for the API to prevent double entries. Thanks to Thomas Sluyter for the hint.
Version: 1.3
- You can enter the shop url now with or without „shop/“ at the end.
Version: 1.2
- Added Translations
Version: 1.1
- Minor Code Changes
- Upload to WP Plugin Repo
Version: 1.0
- Initial Release
Download “wp-spreadshirt” wp-spreadshirt.latest-stable.zip – 939-mal heruntergeladen – 178 B
Hi H.-Peter!
I’m very happy with your WP Spreadshop plugin; it’s a great way to include our dojo’s webshop onto our new website. If you don’t mind, I have three questions for you:
1. How do I reset the cached files? Changes I made to our shop are not showing up on the WordPress page.
2. Are there any characters we should avoid in product names? I don’t know why, but many of our products get listed twice on the WordPress shop page, while they’re only listed once at Spreadshirt. I’m thinking it might have something to do with us using “ or , or ! in the product name+URL.
3. Are you aware of any issues with your plugin combined with the „Facebook Button“ plugin? When both plugins are active, a Facebook error about having two URLs, is thrown over part of the shop.
Thanks again for your hard work!
Ah, no edit button.
The answer to #3 lies in part in where the FBB plugin gets shown. If it’s at the top of a page/post, there’s no problem. If it’s at the bottom, then FB complains about multiple domain URLs.
I’m sorry for this deluge of comments! I’m learning on the go.
I tried solving #1 by using delete_transient (once of course) on ’spreadshirt-article-data‘, which I believe should then render an empty array. Which in turn should prompt the plugin to redownload the XML from Spreadshirt. But that didn’t seem to do the trick.
Right. Final reply. I’m really sorry for this mess :p
Forget about #1. It appears that the XML feed from Spreadshirt is messed up. My spreadshop of 24 articles provides an XML feed with 42 items!
Of course, it wouldn’t be a bad idea to adjust your plugin to prevent duplicates from making it into the articles array ;)
Hi – I am trying out your plugin but have a problem.
The code I am using is this:
This makes the page look fine – all products show perfectly, but clicking on one takes the user to an incorrect URL format like this:
There is a missing ‚/‘ after the co.uk
How is it possible for me to fix this?
Thanks
Gareth
Also it does not work if the shortcode is this:
For info the page is here:
http://vroommedia.biz/merchandise/
On my tests with your Shop URL and ID everything works fine. There has been some trouble with the spreadshirt-API in the last days. Maybe its on this. You can wait a hour until the plugins cache is regenerated.
Sorry for the extra comments – I seem to have solved this now by deactivating some other plugins.
Thanks! Great plugin :-)
No problem.
Just, woul’d you like to tell me wich plugins you have deactivated? So I can take a look at these to get rid of this problem.
Hi again!
Remember how I mentioned that most of my articles were being displayed twice, sometimes three times? I asked about it one the Spreadshirt API forum and they said it’s because i was using the wrong XML URL. I used the one they suggested and my shop now works.
I changed one line in your PHP:
$var_sXmlShop = wp_remote_retrieve_body(wp_remote_get(‚http://api.spreadshirt.net/api/v1/shops/‘ . $var_sShopId . ‚/articleCategories/510/articles‘));
So „/articles“ became „/articleCategories/510/articles“.
Forum thread -> http://forum.spreadshirt.net/threads/18317-Articles-listed-multiple-times-in-XML-Why
Thanks for the hint. Update is coming soon :-)
Wow you’re fast! I already have the upgrade! :D Works like a charm.
Thank you very much for your hard work!
If I may make a suggestion, it could be interesting to add three boolean config items at the top, to enable/disable parts of the output. Personally, I only want the price incl tax to be shown.
Like so: http://www.renshinjuku.nl/webshop/?lang=nl
Right now I have to hack parts away from your script (and need to remember it every upgrade) :)
I installed the plugin but it is not showing my products, instead it shows a different product not in my store. How do I get it to show my products. Here is the page http://www.joyfilledparenting.com/im-full-of-it-t-shirts-new/
Hello,
I’ve been trying to use the plugin for my client’s site and it keep bringing in the wrong shop/products. I’ve tried deactivating, uninstalling, and nothing works. I have the correct shop URL and ID in the shortcode. Please help if you can.
Thanks.
Mine is showing the products now but it doesn’t update when I change the products or product name in my spreadshirt shop.
I see the issue when I click on the pic in my wp store it takes me here http://fullofit.spreadshirt.com/shop/i’m-full-of-it:-love-men’s-A10925437 instead of here http://fullofit.spreadshirt.com/i-m-full-of-it-love-men-s-A10925437
What do I change remove shop/ to have it go to the right page.
Also to update the wp when i change the spread shirt page.
Hi!
Dies ist mein Quellcode: [spreadshirt shop_url=“http://9397.spreadshirt.de/“ shop_id=“9397″]
Leider verschwindet immer der Punkt vor dem „de“…
Woran könnte das liegen!
Dankeschön für Deine Hilfe (und übrigens ein Super-Plugin)!
LG Dirk
Mit den Daten getestet und URL wird richtig generiert bei mir.
Hello, love the plugin but I can only get it to work with your sample script. The formatting works great but I cannot get it to work with my shop. The page doesn’t seem to import the data. Might there be something I am missing?
[spreadshirt shop_url=“http://meettheshannons.spreadshirt.com/“ shop_id=“312546″]
I also found this other shortcode referenced but that doesn’t seem to work either for me.
[spreadshirt shop_url=“http://meettheshannons.spreadshirt.com/“ customers_host_address=“312546″]
Thank you for any help.
It seems more and more the spreadshirt-API is a bunch of bullcrap -.-
This is your Link to the XML-Api: http://api.spreadshirt.net/api/v1/shops/312546/articleCategories/510/articles
I have no idea why there is no propper response.
I agree. It seems that the API is buggy and they keep on tweaking things left and right. Refer to their own forums for this, which I did as well. Many of the things we notice, they’ll say „yes, that’s a bug we’ll work on“. :|
how do i get the plugin to go to http://fullofit.spreadshirt.com/ instead of http://fullofit.spreadshirt.com/shop/
First, thank you for this plugin and am very excited to try it! When I enter the short-code; my product is not displayed… it is showing someone else’s. Is there a way to fix this? Once you click on the product it takes you to the correct page though.
Thanks again.
This issue is not new to me. It seems to be a problem with the spredashirt API itself. The API ist not stable, its still a beta-state.
moin,
vielen Dank erst einmal für das tolle Plugin.
Ich hab das Problem das nicht in meinen Spreadshirt Shop sondern in den von der Chaoz Band verlinkt wird?
Woran liegts, ich hab bereits die Seite neu angelegt. Cache ist leer, sowohl von WP als auch von diversen Browsern.
Dies wäre der Link zu meiner Seite http://pixeltunes.de/pixelshirts/
Vielen Dank für einen Tip :)
Es sieht so aus, als hättest Du bei shop_url nicht Deine eingegeben :-)
1000%ig nicht! *tz*
Ich habe den Aufruf aus meinem Blog gefühlte 80x kontrolliert. Der Eintrag in dem og Beispiel wurde wie folgt editiert: aus chaoz wurde pixeltees und aus der Shop-ID wurde die aus meinem Shop.
Im Blog waren dann meine Produkte zu sehen, allerdings führte der Link immer zu dem Chaoz Shop.
Ich habe das Plugin mehrmals deaktiviert und immer brav die Einträge aus DB und WP Cache danach geleert und Browsercache geleert.
Plugin wieder aktiviert – gleicher Fehler!
Brachte alles nix, die Verlinkung führte immer noch zum falschen Shop.
Ähm, wird doch richtig verlinkt, zumindest der Shop. Allerdings habe ich noch etwas gefunden, was im Link des Artikels selbst nicht richtig maskiert wird. Das Komma muss aus den Links entfernt werden. Update kommt :-)
Hallo,
erstmal Glückwunsch zu diesem klasse Plugin… Leider kann ich es so noch nicht ganz nutzen und hoffe Sie können mir helfen. Deswegen meine Frage: Ich habe einige Artikel in meinem Shop. Gibt es eine Möglichkeit nur einzelne Artikel anzuzeigen bzw. Nur eine bestimmte Anzahl pro Seite? Wenn ich nämlich meinen Shop einbinden möchte, weisst er auf einer Seite jede Menge Artikel aus, was die Seite sehr lang erscheinen lässt.
Danke im Vorfeld, für eine kurze Antwort.
LG
Nein, eine seitenweise Anzeige oder nur bestimmte Artikel ist nicht vorgesehen.
Hallo Peter,
Ich fand das Problem! (für mich) The api is default set to the European site .net. We have an American based site, so our site is .com. My link to the XML-Api: http://api.spreadshirt.com/api/v1/shops/312546/articleCategories/510/articles. If you cannot set up the php to utilize both call to lines without a conflict, perhaps there can be made a small note on the txt file about this? Maybe helpful for those that have an issue.
Tschüss,
Eric
Danke für den Hinweis. Ich hab im Update (Version 1.6) einen weiteren Schalter in den Shortcode eingebaut. Nennt sich „shop_location“ und wird dann entweder zu „eu“ für Europa oder zu „na“ für Nordamerika gesetzt. Dies sind die beiden API-Regionen von Spreadshirt die ich auf Grund Deines Hinweises gefunden habe. Ich hoffe, dass dies nun einige Probleme behebt.
Ich spreche ein bisschen, aber mein Deutsch ist schrecklich. I hope it helps some other folks. Have a great day Peter.
Ah sorry, so I translate my last comment for you.
Thanks for the hint, I’ve added a new option to the shortcode, calles „shop_location“. You can set this to „eu“ for european based shops or to „na“ for north american based shops. These are the two API regions I’ve found after your hint. Hopefully this will fix the problems.
hey,
ich habe folgendes problem. die artikel werden alle angezeigt aber kein einziger link davon funktioniert, ich weiß nicht woran das liegt
hier schau mal bitte: http://www.benikaya.com/?page_id=75
LG
Sollte mit Version 1.6.1 (kommt in ein paar Minuten) gefixt sein.
Man having trouble here: http://chief-keef.org/shop/
I have posted the shrt code just as described, changing the URL, and shop ID and nothing will show up on my page… Looking for help and direction. Thanks for your help!
You need to set your shop_location option in the shortcode to „na“.
But wait for the update to version 1.6.2, there is a bit more of link-sanitizing. Spreadshirt has a very inconsistent way to rewrite special chars in links -.-
I did what you said…still not showing up for me :(
When is that update and I can fix this?
Well, I’ve tested with yout Spreadshirt Shop and for me, it works. Maybe you have to wait until the transient cache will be regenerated from WordPress.
Hi Peter,
I’m trying to get your plugin working, but whatever I do, the page says: ‚The Shop doesn’t exist‘. This text also shows up when I use your sample code. Can you tell me what I’m doing wrong?
Thnx!
Roy
I tried both of these codes on my wordpress pages: and nothing comes up Thanks:
[spreadshirt shop_url=“http://hiphopucit.spreadshirt.com/“ shop_id=“51544″ shop_location=“eu/na“]
[spreadshirt shop_url=“http://hiphopucit.spreadshirt.com/shop/“ shop_id=“51544″ shop_location=“eu/na“]
May I point you to the changelog?
That worked great thanks! Now, when I click on the product instead of it linking to wordpress it says page cannot be displayed. Hiow can I fix this? Thanks!
Hi Peter,
first thanks for this neat little plugin.
I’m having the same problem as Gareth has had.
The link is given without the ‚/‘ between domain and path.
I also tried to deactivate other plug ins but this didn’t help.
Vielen Dank erstmal für das tolle Plugin.
Ich suche die Möglichkeit, gezielt Kategorien (aus dem Spreadshirt Shop) auf meiner Wp-Seite ausgeben zu können.
Also nicht alle einzelnen Produkte, sondern quasi die Kategorien. Dort dann ruhig das neueste Produkt. Die Ausgabe in WP kann ruhig in mehreren Zeilen und Spalten erfolgen.
Ist das möglich?
Möglich ist das bestimmt irgendwie, aber nicht mit diesem Plugin. Ist so nicht vorgesehen und ich weiß nicht, ob ich dies in dieses Plugin integrieren werden, da dann eventuell der Shortcode zu umfangreich wird.
Hallo
wenn ich einen Artikel im Shop lösche erscheint der immer noch trotzdem im eingebundenen Plugin, Cache leeren und Plugin neu installieren hilft alles nichts
Brauche da mal dringend bitte hilfe
Danke
Das Plugin selbst hat nen eigenen Cache, welcher im Stundentakt generiert wird. Also einfach ne Stunde warten und der gelöschte Artikel sollte raus sein.
leider sind mehere Stunden schon vergangen aber im Shop wird immer noch was angezeigt was es nicht mehr gibt siehe die Jacke unter http://eisernerblog.de/shop/
Das Plugin liest nur die Daten aus der API von Spreadshirt aus. Diese wird im Stundentakt abgefragt und in die Datenbank geschrieben.
I have the same problem with the Cahce. I update my shop but the changes are not reflected on my website via the pluggin. There should be a clear way to execute this, or instructions in the readme.
Hallo Herr Pfeufer,
ich habe das PlugIn installiert und folgenden Shortcode auf meiner WP-Seite eingesetzt:
[spreadshirt shop_url=“http://cantoaldente.spreadshirt.de/“ shop_id=“752010″ shop_location=“eu“]
aber es kommt nix obwohl der Shop aktiv ist.
Gibt es Inkompatibilitäten mit anderen PlugIns?
Grad getestet, funktioniert wunderbar.
Hallo Herr Pfeufer,
ich habe ihr Plugin auch schon seit einige Zeit im Einsatz.Hier ein dickes Lob. Allerdings kann ich mich den Post meines Vorgängers anschließen. Seit einiger Zeit bekomme ich kein Anzeige mehr. Ich habe es auch mal mit dem Plugin allein probiert, das Ergebnis ist leider eine leer Seite. Die Produkte werden leider nicht mehr angezeigt.
Wie ich auch dem Vorredner schon geantwortet habe. Getestet und funktioniert.
Hab mir mal dein Plug-in heruntergeladen – hab gerade ein Projekt am laufen wo ich das verwenden könnte.
Läuft das unter WordPress 4.4?
Viele Grüße aus Augsburg
Spricht zu mindestens nichts dagegen.
Kann man da auch einzelne Artikel aus dem Spreadshirt shop in meine eigene Seite einbinden,also nicht den ganzen, nur einzelne Artikel davon?
Nein.