Wildhoney / Magento-on-Angular

Angular.js application using Magento as the backend API
360 stars 120 forks source link

Magento Product custom field and Laravel API #93

Closed creaux closed 9 years ago

creaux commented 9 years ago

I'm looking for a way to extend Laravel API with custom field from magento. I checked the product object and its _data children that is comming from catalog/product_collection or catalog/product model and custom not contain my custom field.

Is it necessary to somehow (magento way) extend api or it should be presented simply automatically in api.

aonic commented 9 years ago

If you look here https://github.com/Wildhoney/Magento-on-Angular/blob/master/api/app/classes/Moa/API/Provider/Magento/Product.php#L19 you can see its just loading the Magento product object. If the Product object does not contain your attribute then the attribute is not configured properly in Magento admin

creaux commented 9 years ago

Many thanks Aonic, yes I found this place as well. I'm just not sure if there is some special configuration needed in Magento. I'm expecting when I add some custom attribute into product in admin area it should be visible in API. On place which you mentioned.

On the other hand in case if my assumption is incorrect there should be some configuration on Magento side. I need to find a way how to do it. There is no proper source with documentation about this case.

aonic commented 9 years ago

There is some visibility or "available in search" type value that you need to set when creating a custom attribute

Raja Kapur

On Thu, Feb 19, 2015 at 4:30 AM, Petr Juna notifications@github.com wrote:

Many thanks Aonic, yes I found this place as well. I'm just not sure if there is some special configuration needed in Magento. I'm expecting when I add some custom attribute into product in admin area it should be visible in API. On place which you mentioned.

On the other hand in case if my assumption is incorrect there should be some configuration on Magento side. I need to find a way how to do it. There is no proper source with documentation about this case.

— Reply to this email directly or view it on GitHub https://github.com/Wildhoney/Magento-on-Angular/issues/93#issuecomment-75021029 .

aonic commented 9 years ago

How did you end up fixing it?

Raja Kapur

On Mon, Feb 23, 2015 at 3:56 AM, Petr Juna notifications@github.com wrote:

Closed #93 https://github.com/Wildhoney/Magento-on-Angular/issues/93.

— Reply to this email directly or view it on GitHub https://github.com/Wildhoney/Magento-on-Angular/issues/93#event-239991366 .

creaux commented 9 years ago

As you mentioned in your previous comment. Each attribute contain visibility option as well as extension of visibility which is defined by visibility per listing or detail view. Cheers