This is one of those things you would think would already be in place with Magento Commerce but it isn’t. We want to have line breaks in our product descriptions in our Magento stores. Our clients want these as well so you don’t have to teach someone to add the <br> tags at each line break.
So here is how to add line breaks to product descriptions in Magento:
- Open /app/design/frontend/default/yourtheme/template/catalog/product/view/attributes.phtml
- Find this bit of code: productAttribute($_product, $_data['value'], $_data['code']) ?>
- Change that code to this: productAttribute($_product, nl2br ($_data['value']), $_data['code']) ?>
- Save your file.
Simply edit your home landing CMS Page and add this code. You’ll have to change the names of the files below and add the complete URL of where you want to be taken when clicking a particular image.
Let’s say you have brochures or additional product information you want to add to products in Magento and you want to allow people to download this information from your Magento Commerce site.
We’ve come up with a little cheat on how to add PDF files to products in Magento. It may not be perfect, but it works for us.
- First, go to your admin section of Magento and go to Catalog>Manage Categories
- Now select “Add Subcategory”
- Fill in all the info for your new category and click “Save Category”
- Go to Catalog>Manage Products
- Click “Add Product”
- As a helpful note, click “Save and Continue Edit” button regularly to keep from being kicked out of Magento Admin.
- For Product Type, select “Downloadable Product” then click continue
- Fill in all your information for your PDF file like any other product. We like to add an image as well for the file.
- In the “Related Products” section in the left menu, select all the products that this PDF file is related to.
- Now, notice in the menu on the left, there is an additional choice, one for “Downloadable Information“.
- Click the expand arrow for “Samples” and rename this to what you like. We’ll call this one “Download Information”.
- Now click “Add a Row” and name it for the file you want to add. For this example, we did “Backup Camera Installation Guide For Mobile Awareness Backup Cameras“
- Save your new “Downloadable Product“
- Now for the little bit tedious procedure. In the “Manage Products” section of Magento Admin, search for the products that are related to your PDF file. In this example, products would be “backup cameras“. Now open each product and select your new PDF file as a related item and save that product.
Now, when someone goes to your product, they can see in the related items section, your information file which is available for download.
This was another tough one here. Magento uses tons of files to accomplish different bits of tasks for all kinds of things. One of those tasks is creating the PDF packing slip that Magento generates when you are printing a “Shipment”. When you click “Print” on the Shipments section of Magento Admin, Magento automatically creates a PDF file for you to use for whatever reason. We use this “Packing Slip” as a purchase order with our vendors who then are supposed to “Blind Drop Ship” the product directly to our customers, including this Packing Slip we email them. The blind shipping is another story there, but if you’re a non-stocking dealer like we are, you can only do so much.
Back to the modification. On this Magento Packing Slip, one thing that annoyed me was the fact that in the Shipping Methods box, there was text “Total Shipping Charges” followed by the amount of shipping. This is a packing slip, not an invoice, so to me, the shipping charges are irrelevant. It’s probably just me, since in searching Google, I found no one else with this question, How To Get Rid of Total Shipping Charges on packing slip in Magento, but maybe someone else will want this. I just don’t think it should be on the packing slip!
MAKE A BACKUP OF YOUR FILE FIRST. YOU HAVE BEEN WARNED!
- Navigate through the files on your server to /app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php
- Open the file Abstract.php.
- On our version (188.8.131.52) the line that needs modification is on #309.
- You’ll see where it reads: $totalShippingChargesText = “(” . Mage::helper(’sales’)->__(’Total Shipping Charges’) . ” ” . $order->formatPriceTxt($order->getShippingAmount()) . “)”;
- Change it to read: $totalShippingChargesText = “”;
- Color of text above was done by me just for emphasis.
- Save your file, do not close it yet in case you messed up.
- Go to your shipments section of Magento Admin, open a shipment and click print. You should come up with a nice clean packing slip with no Shipping Charges Total line!