Files
wc-tier-and-package-prices/assets/css/frontend.css
magdev 88e30d028c Release version 1.1.4 - WooCommerce Blocks support and improved styling
Added comprehensive WooCommerce Blocks support for quantity restrictions
and improved "View Options" button styling to match standard WooCommerce
Add to Cart buttons.

Features:
- WooCommerce Blocks cart/mini-cart quantity restriction support
- Store API integration for block-based carts
- Improved "View Options" button styling with WooCommerce standards
- Enhanced hover effects and transitions

Technical Changes:
- Added woocommerce_store_api_product_quantity_editable filter
- Added block_quantity_editable() method in WC_TPP_Cart class
- Enhanced CSS for .wc-block-components-quantity-selector targeting
- Updated button styling: padding (0.618em × 1em), font-weight (700)
- Added transition effects for smooth hover states

Fixed:
- WooCommerce blocks cart quantity selector now properly hidden
- WooCommerce blocks mini-cart quantity selector visibility
- "View Options" button now matches Add to Cart button appearance

Updated Files:
- includes/class-wc-tpp-cart.php (WooCommerce Blocks support)
- assets/css/frontend.css (enhanced button styling)
- wc-tier-and-package-prices.php (version 1.1.4)
- composer.json (version 1.1.4)
- CHANGELOG.md (v1.1.4 section)
- All translation files (.pot, .po, .mo) updated to version 1.1.4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 19:33:34 +01:00

227 lines
4.1 KiB
CSS

/**
* Frontend styles for WooCommerce Tier and Package Prices
*/
.wc-tpp-pricing-container {
margin: 20px 0;
padding: 20px;
background: #f9f9f9;
border: 1px solid #e0e0e0;
border-radius: 8px;
}
.wc-tpp-tier-pricing-table,
.wc-tpp-package-pricing-table {
margin-bottom: 30px;
}
.wc-tpp-tier-pricing-table:last-child,
.wc-tpp-package-pricing-table:last-child {
margin-bottom: 0;
}
.wc-tpp-tier-pricing-table h3,
.wc-tpp-package-pricing-table h3 {
margin: 0 0 15px 0;
font-size: 1.2em;
color: #333;
}
/* Tier pricing table */
.wc-tpp-table {
width: 100%;
border-collapse: collapse;
background: #fff;
border-radius: 4px;
overflow: hidden;
}
.wc-tpp-table thead {
background: #333;
color: #fff;
}
.wc-tpp-table th {
padding: 12px;
text-align: left;
font-weight: 600;
font-size: 0.9em;
}
.wc-tpp-table tbody tr {
border-bottom: 1px solid #e0e0e0;
transition: background-color 0.2s;
}
.wc-tpp-table tbody tr:hover {
background: #f5f5f5;
}
.wc-tpp-table tbody tr.wc-tpp-active-tier {
background: #e7f3e7;
font-weight: 600;
}
.wc-tpp-table td {
padding: 12px;
font-size: 0.95em;
}
/* Package pricing */
.wc-tpp-packages {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 15px;
}
.wc-tpp-package {
background: #fff;
border: 2px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
text-align: center;
transition: all 0.3s;
cursor: pointer;
}
.wc-tpp-package:hover {
border-color: #333;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.wc-tpp-package.wc-tpp-selected {
border-color: #4CAF50;
background: #f0f8f0;
}
.wc-tpp-package-header h4 {
margin: 0 0 15px 0;
font-size: 1.1em;
color: #333;
}
.wc-tpp-package-details {
margin-bottom: 15px;
}
.wc-tpp-package-qty {
font-size: 1.4em;
margin-bottom: 10px;
}
.wc-tpp-package-qty strong {
color: #333;
}
.wc-tpp-package-price {
font-size: 1.6em;
font-weight: 700;
color: #4CAF50;
margin-bottom: 5px;
}
.wc-tpp-package-unit-price {
font-size: 0.85em;
color: #666;
}
.wc-tpp-select-package {
width: 100%;
padding: 10px 20px;
background: #333;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.95em;
transition: background 0.3s;
}
.wc-tpp-select-package:hover {
background: #555;
}
.wc-tpp-package.wc-tpp-selected .wc-tpp-select-package {
background: #4CAF50;
}
.wc-tpp-package.wc-tpp-selected .wc-tpp-select-package:hover {
background: #45a049;
}
/* Cart notices */
.wc-tpp-notice {
color: #4CAF50;
font-style: italic;
}
/* Catalog "View Options" button */
a.wc-tpp-view-options {
display: inline-block;
text-align: center;
text-decoration: none;
position: relative;
/* Match WooCommerce button styling */
font-size: 1em;
font-weight: 700;
padding: 0.618em 1em;
line-height: 1.5;
border-radius: 3px;
cursor: pointer;
transition: all 0.2s ease;
}
a.wc-tpp-view-options::before {
content: "\f06e";
font-family: "dashicons";
margin-right: 5px;
display: inline-block;
font-size: 1em;
vertical-align: middle;
line-height: 1;
}
/* Hover state for View Options button */
a.wc-tpp-view-options:hover {
opacity: 0.85;
text-decoration: none;
}
/* Cart quantity display for restricted products */
.wc-tpp-cart-quantity {
display: inline-block;
padding: 5px 10px;
background: #f5f5f5;
border: 1px solid #ddd;
border-radius: 3px;
font-weight: 600;
}
/* Restriction notice */
.wc-tpp-restriction-notice {
padding: 10px 15px;
background: #fff3cd;
border: 1px solid #ffc107;
border-radius: 4px;
margin-bottom: 15px;
color: #856404;
font-size: 0.95em;
}
/* Responsive design */
@media (max-width: 768px) {
.wc-tpp-packages {
grid-template-columns: 1fr;
}
.wc-tpp-table {
font-size: 0.9em;
}
.wc-tpp-table th,
.wc-tpp-table td {
padding: 8px;
}
}