Files
module-free-shipping-message/README.md

102 lines
2.4 KiB
Markdown
Raw Normal View History

# Shopkeeper Free Shipping Message
A Magento 2 module that displays a customizable CMS block message below the "Add to Cart" button on product pages.
## Features
- Displays a CMS block on product pages
- Positioned below the "Add to Cart" button
- Fully customizable content through Magento admin
- Only displays when the CMS block is active
## Installation
### Via Composer (Recommended)
```bash
composer require shopkeeper/module-free-shipping-message
php bin/magento module:enable Shopkeeper_FreeShippingMessage
php bin/magento setup:upgrade
php bin/magento cache:flush
```
### Manual Installation
1. Create directory: `app/code/Shopkeeper/FreeShippingMessage`
2. Copy all files to the directory
3. Run the following commands:
```bash
php bin/magento module:enable Shopkeeper_FreeShippingMessage
php bin/magento setup:upgrade
php bin/magento cache:flush
```
## Configuration
1. Log into Magento Admin
2. Navigate to **Content > Blocks**
3. Create a new CMS block with the following settings:
- **Block Title**: Free Shipping Message (or your preferred title)
- **Identifier**: `free_shipping_message`
- **Status**: Enabled
- **Store View**: Select appropriate store views
- **Content**: Add your free shipping message content
## Module Structure
```
FreeShippingMessage/
├── Block/
│ └── Product/
│ └── View/
│ └── Message.php
├── etc/
│ └── module.xml
├── view/
│ └── frontend/
│ ├── layout/
│ │ └── catalog_product_view.xml
│ └── templates/
│ └── product/
│ └── view/
│ └── message.phtml
├── registration.php
└── README.md
```
## Customization
### Change CMS Block Identifier
To use a different CMS block, modify the `cms_block_id` argument in `view/frontend/layout/catalog_product_view.xml`:
```xml
<argument name="cms_block_id" xsi:type="string">your_block_identifier</argument>
```
### Styling
The message is wrapped in a `<div class="free-shipping-message">` element. Add custom CSS to your theme to style it:
```css
.free-shipping-message {
margin-top: 15px;
padding: 10px;
background-color: #f0f0f0;
}
```
## Requirements
- Magento 2.3.x or higher
- PHP 7.3 or higher
## License
Proprietary
## Support
For support, contact Shopkeeper development team.