Forums / Features Wish List / Wish: Product label print option

Wish: Product label print option

Views: 89

Results 1 to 5 of 5
3 Jan 2024, 4:07 AM
#1
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Wish: Product label print option

What would be really useful is a way to produce a list of product labels for an order. For example, if I have an order with 10 products, I could just hit a button and it would throw 10 separate labels to a label printer to produce 10 labels which can then be attached to product bags etc.

I sell electronic components and each type of component is individually bagged and has the contents manually written on it, which is a real pain. It would be great to have labels that I can just stick on. Most suppliers I buy from operate this way, it saves printing packing lists, you just use the list of labels to pack from.

I envisage the module having the following capabilities:

Produce a label for each item in an order, which includes:

Product quantity
Product name
Product SKU
Possibly other options

Be able to set the label size, including label width, label height, any margins between labels
Be able to left align or centre align the text
Be able to set the text size and font (or at least the size)

If something like this already exists, I couldn't find it...

3 Jan 2024, 6:00 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Wish: Product label print option

Note: I do not find a products_sku in a standard 1.5.8a database. If you are using a Numinix mod that calls for this, the MySQL would need to be changed accordingly.

SELECT op.products_id, p.products_model, p.products_nameINTO OUTFILE '/path/to/output.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM orders_products op
JOIN products p ON op.products_id = p.products_id
WHERE op.orders_id = your_orders_id;

Here's a breakdown of the statement:

Select the columns products_id, products_model, and products_name from the orders_products table.

Specify the INTO OUTFILE clause to indicate that the query should output the results into a CSV file. Replace '/path/to/output.csv' with the actual file path where you want to save the CSV file.

Use FIELDS TERMINATED BY ',' to specify that the fields in the CSV should be separated by commas.

OPTIONALLY ENCLOSED BY '"' specifies that fields are optionally enclosed by double quotes.

LINES TERMINATED BY '\n' indicates that each row in the CSV should be terminated by a newline character.

Use a JOIN statement to link the orders_products table with the products table based on the products_id column to retrieve additional product information.

Finally, the WHERE clause filters the results to include only rows where the orders_id matches the value you supply (replace your_orders_id with the actual order ID you want to query).

Make sure to replace '/path/to/output.csv' with the desired file path and your_orders_id with the specific order ID you are interested in. When you run this SQL query, it will generate a CSV file with the specified data from the "orders_products" table for the given order ID.

You could then use the CSV file to do a mail merge in something like Word to print to your defined labels.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

3 Jan 2024, 6:52 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Wish: Product label print option

That's certainly how I would approach this. Zen Cart is not going to drive your label printer; you need something on your PC to do this.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Jan 2024, 7:23 PM
#4
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Wish: Product label print option

swguy:

That's certainly how I would approach this. Zen Cart is not going to drive your label printer; you need something on your PC to do this.

zen-cart can certainly drive a label printer; or any printer for that matter.

it, however, is not easy. but it can be done.

i say this from experience.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

3 Jan 2024, 8:39 PM
#5
lance_turner avatar

lance_turner

New Zenner

Join Date:
Jul 2016
Posts:
61
Plugin Contributions:
0

Re: Wish: Product label print option

Thanks, yes, by SKU I was referring to the product model field. Wouldn't need the Product ID field as that is just a number specific to each product that means nothing to the customer, whereas the Product model is displayed to the customer so is a useful reference.

I was hoping someone had looked at this in the past as it's a pretty common requirement when packing orders for some types of products, to label each item to ID them. I'm surprised this hasn't been requested in the past, although I can see how it would take some fairly complex code to make it versatile across more than one specific printer type.