Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Labels Fix


Recommended Posts



The contribution I downloaded doesn't print labels properly, always missing the first label for each page and I haven't seen a fix on here. I found the problem with this. The logic works in a loop, getting the first order, then calling the template with this order, then advancing the page.


The labels thing doesn't work well in this paradigm because it's printing multiple orders per page. The first order is retrieved, then the template code gets called, and the template code then asks for the next order, prints it out, next order... etc until the end of the page, then the other loop starts... anyways, every time the main handling code gets the order for the template but the template always gets the next one before doing anything with this.


How to fix this - the hack (that I've employed right now) is to take the label printing code into the template, then using the first order passed into the template, and only calling for the next one if you are still printing on the page. That way I use the first order passed in, then the template manually keeps getting more until no more can fit.


The prefered way to do this would be to take the '$pdf->EzNewPage();' call out of the batch_print.php code and allow the template writer to call this manually. This would only mean adding that line to the start of all the rest of the templates right now. But it would also allow in this case the option of not calling new page after each order. The template writer could use the $num variable to ensure they advance the page at the right time, or it might be better to add a variable called $pagePosition or something that could be set by the template to keep track of positon in the page. Anyways, whoever's maitaining this, it's up to them, if you want more of an explanation let me know.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...