PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
← All changes | includes/Services/Receipt_Data_Schema.php +69 -0 1.10.21 → 1.10.17 View file →
@@ -1586,5 +1586,74 @@
1586 1586 default:
1587 1587 return 'string';
1588 1588 }
1589 1589 }
1590 +
1591 + /**
1592 + * Get mock receipt data for template preview.
1593 + *
1594 + * Returns a representative receipt payload with realistic values
1595 + * for use in the template editor preview and tests.
1596 + *
1597 + * @return array Mock receipt data.
1598 + */
1599 + public static function get_mock_receipt_data(): array {
1600 + $created = Receipt_Date_Formatter::from_timestamp( strtotime( '2024-01-15 10:30:00 UTC' ) );
1601 + $paid = Receipt_Date_Formatter::from_timestamp( strtotime( '2024-01-15 10:35:00 UTC' ) );
1602 + $completed = Receipt_Date_Formatter::from_timestamp( strtotime( '2024-01-15 10:42:00 UTC' ) );
1603 + $printed = Receipt_Date_Formatter::from_timestamp( strtotime( '2024-01-15 10:45:00 UTC' ) );
1604 +
1605 + return array(
1606 + 'has_tax_summary' => true,
1607 + 'order' => array(
1608 + 'id' => 1001,
1609 + 'number' => '1001',
1610 + 'currency' => 'USD',
1611 + 'customer_note' => '',
1612 + 'wc_status' => 'completed',
1613 + 'status_label' => 'Completed',
1614 + 'created_via' => 'woocommerce-pos',
1615 + 'created' => $created,
1616 + 'paid' => $paid,
1617 + 'completed' => $completed,
1618 + 'printed' => $printed,
1619 + 'needs_payment' => false,
1620 + 'payment_url' => '',
1621 + ),
1622 + 'store' => array(
1623 + 'id' => 1,
1624 + 'name' => 'My Store',
1625 + 'address' => array(
1626 + 'address_1' => '123 Main St',
1627 + 'address_2' => '',
1628 + 'city' => 'Anytown',
1629 + 'state' => 'CA',
1630 + 'postcode' => '90210',
1631 + 'country' => 'US',
1632 + ),
1633 + 'address_lines' => array( '123 Main St', 'Anytown, CA 90210' ),
1634 + 'tax_ids' => array(
1635 + array(
1636 + 'type' => 'us_ein',
1637 + 'value' => '12-3456789',
1638 + 'country' => 'US',
1639 + 'label' => 'EIN',
1640 + ),
1641 + ),
1642 + 'phone' => '+1 (555) 123-4567',
1643 + 'email' => '[email protected]',
1644 + 'logo' => 'https://example.com/logo.png',
1645 + 'opening_hours' => "Mon\u{2013}Fri 9:00 AM \u{2013} 5:00 PM\nSat 10:00 AM \u{2013} 4:00 PM\nSun Closed",
1646 + 'opening_hours_vertical' => "Mon 9:00 AM \u{2013} 5:00 PM\nTue 9:00 AM \u{2013} 5:00 PM\nWed 9:00 AM \u{2013} 5:00 PM\nThu 9:00 AM \u{2013} 5:00 PM\nFri 9:00 AM \u{2013} 5:00 PM\nSat 10:00 AM \u{2013} 4:00 PM\nSun Closed",
1647 + 'opening_hours_inline' => "Mon\u{2013}Fri 9:00 AM \u{2013} 5:00 PM, Sat 10:00 AM \u{2013} 4:00 PM, Sun Closed",
1648 + 'opening_hours_notes' => 'Closed on public holidays',
1649 + 'personal_notes' => '',
1650 + 'policies_and_conditions' => '',
1651 + 'footer_imprint' => '',
1652 + ),
1653 + 'cashier' => array(
1654 + 'id' => 1,
1655 + 'name' => 'Admin',
1656 + ),
1657 + );
1658 + }
1590 1659 }