Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core sArticles deprecated #56

Closed
terwey opened this issue Feb 1, 2013 · 2 comments
Closed

Core sArticles deprecated #56

terwey opened this issue Feb 1, 2013 · 2 comments

Comments

@terwey
Copy link

terwey commented Feb 1, 2013

Hi,

according to annotation in the sArticle Class: https://github.com/ShopwareAG/shopware-4/blob/master/engine/core/class/sArticles.php#L35 it's been deprecated.
However it's still being actively used by code and I wanted to modify this file itself. However since it doesn't (to me anyway, considering the only docs I could find on Shopware Extending were in German (which I understand most of the time :p)) seem to follow the other Classes in naming/extending I'm not totally sure how to Extend this file.
I need to do this cause I want to take function sGetCategoryProperties https://github.com/ShopwareAG/shopware-4/blob/master/engine/core/class/sArticles.php#L1247
And replace it with a modified version. I now for testing purposes just hacked it in and it works flawlessly but I'd like to release it as a Plugin :)

So two questions:

  1. What will replace sArticles
  2. How do I currently extend upon sArticles in a way I can release it as a Plugin? Referring me to docs is absolutely not an issue. I might have overlooked/not found the correct one.

Thank you

@dnoegel
Copy link
Contributor

dnoegel commented Feb 3, 2013

Hi terwey,

  1. Currently there is no replacement for the core classes and right now I can not tell you, when and how this will happen. So working with the core classes is perfectly fine until we have a transition plan.
  2. You might be interested in this tutorial about our Hook System: http://wiki.shopware.de/_detail_981.html#Hooks
    There is even an example of replacing a method in sArticle with a custom method.

A (very) stripped down example of such a plugin can be found here: http://wiki.shopware.de/_detail_934_487.html Just download the archive (the link is titled "Download: Gepackte Beispiel Plugins aus der Entwicklerschulung") and navigate to /Core/EventsHookExample3.

Right now most of our developer-docs are still german - I hope this will change over time :)

Best regards

@terwey
Copy link
Author

terwey commented Feb 4, 2013

Hi @dnoegel,

thank you for your reply. I've managed to build a Plugin now instead of hacking on top of Core code :) This is a bit slower (cause it loops twice through data now) but eventually more "Plug 'n Play".

If your interested it's here: https://github.com/terwey/YTCategoryProperties
A license I have not picked yet.

Concerning the docs, yes it's a shame most of them are now in German. It makes sense with Shopware being a German company and all but on a global market it's a bit of a shame cause Shopware is a LOT more modern then the alternatives (which either lack docs or have none at all either haha).

@terwey terwey closed this as completed Feb 4, 2013
bcremer added a commit that referenced this issue Feb 18, 2013
…mer-emotion to master

* commit '52f58bd39d221eb9dab6763159eb118e5ae811de':
  SW-4668 code cleaning
  SW-4668 duplicate entries in newcomer emotion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants