steinsgate Posted August 14, 2012 Share Posted August 14, 2012 Hi, I am trying to put additional information in the invoice, manufacturer and a feature "internalcode". I have SKU and "internalcode" as a features, imported using a products CSV file. My problem is I cannot get product features when generating the PDF, or from any other place except the Product controller. In the Order controller the attributes I have for a product are the basic so I don't have custom features. I didn't see any way to get products by id like "getProductById($id)", but I see there is a getProductByReference(). How can I get a product with ALL attributes and features from a controller other than ProductController or from a class, I don't have to use it from a template just create the PDF in my case. Editing PDF.php in line ~945 I try to put something like: // get features $internalcode=Product::getByReference($product['product_reference'])->getFrontFeatures(1); foreach ($internalcode as $feature){ if ($feature['name']=="internalcode") { $id=$feature['value']; } } But even getting the features in the array, I get an error when I call getFrontFeatures or any similar method (I tried with static and non static methods, creating a Product, etc.). I used getFeatures() also but I cannot get the features, sometimes I get an array with the attributes but also an error, saying that I cannot call the method, but it's working. However, I cannot get the PDF because of the error. If someone can give me some information for Get features for a product selected by reference or id from any controller. Add product features in the Invoice. Select products by id. Select all products from an invoice with all attributes as a product objects. Will be useful and will solve this problem. All comments will be appreciated. Thanks in advance. Link to comment Share on other sites More sharing options...
Docki Posted May 24, 2014 Share Posted May 24, 2014 Hello, Did you manage to get custom features in the invoice pdf? Kindly thanks! Link to comment Share on other sites More sharing options...
SPKF Posted August 23, 2014 Share Posted August 23, 2014 up up up Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now