Porpoise Posted January 11, 2013 Share Posted January 11, 2013 We have to print custom labels as per example (from our existing osCommerce site - custom code). I'm trying to determine the best place to inject the code within Presta - I'm thinking the order page is the logical place. I'm just trying to work out which variables I need to use for the values - as I'll simply place a button which will POST the variables to "shipping_label.php" (custom file). Can anyone help? I think once this and the payment module is sorted, that will be about it configuration-wise to enable us to load all the products and go live. Link to comment Share on other sites More sharing options...
tuk66 Posted January 11, 2013 Share Posted January 11, 2013 For printing custom labels like this one on the example is perfectly suited M4 PDF Extensions module. Actually there are several similar built-in labels in the module which can be good beginning for creating the own one. Link to comment Share on other sites More sharing options...
Porpoise Posted January 11, 2013 Author Share Posted January 11, 2013 Hi tuk66, Thank you for the link but I don't think we really need anything that sophisticated - I just need to know the Prestashop variables to change our existing ones to, using our existing template (it has to determine whether the destination is UK, Jersey or Rest of World as the label is different in each case and the code is already there - I just have to replace the variables). Name & Address Delivery Country Total Goods (excl. tax) Shipping Amount (excl. tax) Tax Amount Then it's just a case of where to stick the button for POSTing the form. Link to comment Share on other sites More sharing options...
Audrius Posted January 11, 2013 Share Posted January 11, 2013 (edited) Just create a new module and use hooks on order page to add your own interface. In that way you'll have an independent code and not modified core files. More about hooks: http://doc.prestasho...and+using+hooks http://doc.prestasho...ation+via+Hooks http://doc.prestasho...+PrestaShop+1.5 Edited January 11, 2013 by Audrius (see edit history) Link to comment Share on other sites More sharing options...
Porpoise Posted January 11, 2013 Author Share Posted January 11, 2013 Just create a new module and use hooks on order page to add your own interface. In that way you'll have an independent code and not modified core files. More about hooks: http://doc.prestasho...and+using+hooks http://doc.prestasho...ation+via+Hooks http://doc.prestasho...+PrestaShop+1.5 Hi Audrius, Thank you for that information. I've pretty much sorted it now thanks but it's certainly something I'll look at in the future once the site is up and running, for future house-keeping. There is not much added code in the view.tpl - just the button with form to POST the data. The actual labelling part is a completely separate file so it won't take much to transfer the code to a new view.tpl if I should need to upgrade before tidying up the mods. Cheers, Steve Link to comment Share on other sites More sharing options...
Porpoise Posted January 13, 2013 Author Share Posted January 13, 2013 Well, famous last words and all that. I can't seem to pull all the variables I need from within the orders page, so I'm going to have to re-think my strategy on this. I can pick up all the variables from within the order page but I cannot get the form to post the variable values via the form into the shipping_labels.php file (obviously a scope issue). I seem to be now wasting so much time going round in circles on this and I really need to get this site up and functioning as soon as possible. The variables at issue are the shipping weight and the order#. Basically, the osCommerce structure was far simpler than Prestashop but I guess that was its limitation. I'm just not familiar enough with the structure of Prestashop to be able to code this myself at this stage and I just don't have the time to spend on that until after I have the site up and running and can relax a bit. So any suggestions would be gratefully received. Link to comment Share on other sites More sharing options...
Porpoise Posted January 15, 2013 Author Share Posted January 15, 2013 Actually, the Order# was only of importance in the process of trying to extract the shipping weight from somewhere. I've now got everything else working fine. I just need a way to extract the shipping weight and it'll be finished (until such time as I have time to re-do it the Prestashop way). The problem seems to be that I can't get it from the scope (_shipping.tpl) which data is displayed on the order page via _view.tpl Link to comment Share on other sites More sharing options...
Porpoise Posted February 23, 2013 Author Share Posted February 23, 2013 Hi Tuk, OK. I've got to the stage where I've got all the data variables I need for the labels and have made a start on costructing the layout of the labels. However, I have hit a snag with the formatting due to the necessary font not being installed in the module (in the previous setup, it was just an HTML page, so it used the fonts on the PC). I need to use a narrow font due to the amount of text required on the labels (the font used is PT Utah Condensed). Can you walk me through installing this font into M4 Module please? Thanks, Steve PS. I also emailed you about this. Link to comment Share on other sites More sharing options...
tuk66 Posted February 28, 2013 Share Posted February 28, 2013 Hi, I created a small cookbook for using own font in M4 PDF Extensions module on http://www.prestashop.com/forums/index.php?/topic/86671-module-m4-pdf-extensions/page__view__findpost__p__1125364. Link to comment Share on other sites More sharing options...
Recommended Posts