AddToCartButton
1 year ago
Address
2 years ago
BumpLineItem
3 years ago
Button
3 years ago
BuyButton
1 year ago
Card
3 years ago
Cart
1 year ago
CartBumpLineItem
3 years ago
CartCoupon
3 years ago
CartHeader
3 years ago
CartItems
3 years ago
CartMenuButton
1 year ago
CartMessage
3 years ago
CartSubmit
2 years ago
CartSubtotal
2 years ago
Checkbox
3 years ago
CheckoutErrors
3 years ago
CheckoutForm
3 years ago
CollapsibleRow
3 years ago
CollectionPage
1 year ago
Column
2 years ago
Columns
1 year ago
ConditionalForm
3 years ago
Confirmation
2 years ago
Coupon
3 years ago
CustomerDashboardButton
1 year ago
Dashboard
1 year ago
Divider
3 years ago
Donation
2 years ago
DonationAmount
3 years ago
Email
3 years ago
ExpressPayment
3 years ago
FirstName
3 years ago
Form
1 year ago
Heading
3 years ago
Input
3 years ago
InvoiceDetails
1 year ago
InvoiceDueDate
1 year ago
InvoiceMemo
1 year ago
InvoiceNumber
1 year ago
InvoiceReceiptDownload
1 year ago
LastName
3 years ago
LineItemShipping
3 years ago
LineItems
3 years ago
LogoutButton
1 year ago
Name
3 years ago
NameYourPrice
3 years ago
OrderBumps
2 years ago
OrderConfirmationCustomer
3 years ago
OrderConfirmationLineItems
3 years ago
Password
2 years ago
Payment
2 years ago
Phone
3 years ago
PriceChoice
2 years ago
PriceSelector
2 years ago
Product
1 year ago
ProductCollection
1 year ago
ProductCollectionDescription
1 year ago
ProductCollectionImage
2 years ago
ProductCollectionTitle
1 year ago
ProductDonation
1 year ago
ProductDonationAmount
2 years ago
ProductDonationAmounts
2 years ago
ProductDonationCustomAmount
2 years ago
ProductDonationPrices
2 years ago
ProductDonationRecurringPrices
2 years ago
ProductItem
2 years ago
ProductItemImage
2 years ago
ProductItemList
1 year ago
ProductItemPrice
2 years ago
ProductItemTitle
2 years ago
Radio
3 years ago
RadioGroup
3 years ago
SessionDetail
3 years ago
ShippingChoices
3 years ago
StoreLogo
2 years ago
Submit
2 years ago
Subtotal
2 years ago
Switch
3 years ago
TaxIdInput
2 years ago
TaxLineItem
3 years ago
Textarea
3 years ago
Total
2 years ago
Totals
1 year ago
Upsell
1 year ago
VariantPriceSelector
1 year ago
BaseBlock.php
3 years ago
BlockService.php
3 years ago
BlockServiceProvider.php
3 years ago
CartBlock.php
2 years ago
CartBlock.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCartBlocks\Blocks; |
| 4 | |
| 5 | /** |
| 6 | * Cart block. |
| 7 | */ |
| 8 | abstract class CartBlock extends BaseBlock { |
| 9 | /** |
| 10 | * Get the cart block style. |
| 11 | * |
| 12 | * @param array $attributes Array of block attributes. |
| 13 | * |
| 14 | * @return string |
| 15 | */ |
| 16 | public function getStyle( $attributes ) { |
| 17 | $styles = ''; |
| 18 | if ( ! empty( $attributes['border'] ) ) { |
| 19 | $styles .= 'border-bottom:var(--sc-drawer-border);'; |
| 20 | } |
| 21 | if ( ! empty( $attributes['backgroundColor'] ) ) { |
| 22 | $styles .= 'background-color:' . esc_attr( $attributes['backgroundColor'] ) . ';'; |
| 23 | } |
| 24 | if ( ! empty( $attributes['textColor'] ) ) { |
| 25 | $styles .= 'color:' . esc_attr( $attributes['textColor'] ) . ';'; |
| 26 | $styles .= '--sc-input-label-color:' . esc_attr( $attributes['textColor'] ) . ';'; |
| 27 | $styles .= '--sc-line-item-description-color:' . esc_attr( $attributes['textColor'] ) . ';'; |
| 28 | } |
| 29 | if ( ! empty( $attributes['padding']['top'] ) ) { |
| 30 | $styles .= 'padding-top:' . esc_attr( $attributes['padding']['top'] ) . ';'; |
| 31 | } |
| 32 | if ( ! empty( $attributes['padding']['bottom'] ) ) { |
| 33 | $styles .= 'padding-bottom:' . esc_attr( $attributes['padding']['bottom'] ) . ';'; |
| 34 | } |
| 35 | if ( ! empty( $attributes['padding']['left'] ) ) { |
| 36 | $styles .= 'padding-left:' . esc_attr( $attributes['padding']['left'] ) . ';'; |
| 37 | } |
| 38 | if ( ! empty( $attributes['padding']['right'] ) ) { |
| 39 | $styles .= 'padding-right:' . esc_attr( $attributes['padding']['right'] ) . ';'; |
| 40 | } |
| 41 | return $styles; |
| 42 | } |
| 43 | } |
| 44 |