Jump to content

Get database value from order details in backoffice


Recommended Posts

Hello everyone.

 

It is the first time I work with prestashop and also my first post. I'm developing an online store with some modifications.

 

I have created a new field in ps_cart_product with the name obs. When the client add a product to cart and if the product meet some pre defined criteria the field obs from ps_cart_product will be updated with some additional information.

 

At this point all works perfectly.

 

Now I'm trying to receive the value of obs field from order details in backoffice with no sucess. I have printed the smarty array $products but I can not find the obs field. Where can I found the right db query so I can add the custom field?

 

Thanks for your time and colaboration.

Edited by Rapha3lm (see edit history)
Link to comment
Share on other sites

The table ps_cart_product is for the ObjectModel Cart and if you want to add your custom field into $products you'll need to override function getProducts(). As a best practice is best to not alter the core tables, but to create your own table that you link with the main through the primary key.

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...