Displaying “You Save $XXX” on Magento Go Product Listing Pages
If you’re looking to add a “you save $XXX” message to your product listing pages in Magento Go, you’ve come to the right place. In this post, we’ll walk through step-by-step instructions to achieve exactly that.
Why Add a Savings Message?
Displaying savings amounts on product listings helps create urgency and entices customers to make purchases. It’s a proven tactic for boosting conversion rates.
Prerequisites
Before starting, ensure you have:
- Access to your Magento Go admin panel
- Basic knowledge of PHP and HTML/CSS
Step-by-Step Process
1. Create a Custom Attribute
First, let’s create an attribute that will store the savings value for each product.
- Log in to your Magento Go admin panel.
- Navigate to “Catalog” > “Attributes”.
- Click on “Add New Attribute”.
- Fill in the details:
- Attribute Code:
savings_amount - Frontend Label: Savings Amount
- Input Type: Decimal Number
- Scope: Global
- Attribute Code:
- Click “Save Attribute”.
2. Add Savings Amount to Products
Now, add the savings amount for each product:
- Go to “Catalog” > “Manage Products”.
- Select a product and click “Edit”.
- Scroll down to find the new
Savings Amountfield. - Enter the desired savings value (e.g., 10.99).
- Click “Save Product”.
3. Modify the List.phtml File
Next, we’ll modify the list.phtml file to display the savings message:
- Using an FTP client or your web host’s file manager, navigate to
app/design/frontend/base/default/template/catalog/product/list.phtml. - Download a backup copy of this file.
- Open it in a text editor.
4. Add PHP Logic
Search for the following line (around line 270):
$_product = Mage::getModel('catalog/product')->loadItem($_item->getId());
Add the following code right after it:
$specialPrice = $_product->getSpecialPrice();
$savingsAmount = $_product->getSavingsAmount();
if ($specialPrice && $savingsAmount) {
// Calculate savings amount
$amountSaved = round($specialPrice - $_product->getFinalPrice(), 2);
}
5. Output the Savings Message
Scroll down to where the product price is displayed (around line 370):
<span class="price"><?php echo Mage::helper('core')->currency($_product->getFinalPrice(), true, false) ?></span>
Replace it with:
<?php if ($amountSaved): ?>
<span class="price"><?php echo Mage::helper('core')->currency($_product->getFinalPrice(), true, false) ?></span>
<span class="savings">You save: <?php echo Mage::helper('core')->currency($amountSaved, true, false) ?></span>
<?php endif; ?>
6. Update the CSS
Finally, add some basic styling to make the savings message stand out:
- Open
skin/frontend/base/default/css/styles.cssin a text editor. - Add the following at the end of the file:
.product-list .savings {
font-weight: bold;
color: #f00; /* You can change this to any color you like */
}
Conclusion
And there you have it! By following these steps, you should now see a “You Save $XXX” message displayed alongside each product in your listing pages, promoting urgency and encouraging more sales.
Remember, it’s crucial to test your changes thoroughly before deploying them to a live site. Always make sure to backup important files first.
For more advanced customizations and best practices in Magento Go development, feel free to explore our Magento resources at Laravel Company. We offer expert guidance for all your e-commerce needs.