From b5418c721c76052214ea54714b25c7be0dc99137 Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Mon, 20 Jan 2025 16:27:04 +0100 Subject: [PATCH 1/9] First work --- .../Apiary/Providers/AssetServiceProvider.php | 36 + .../Providers/ThemeComponentProvider.php | 23 + .../Apiary/Providers/WordPress/Formatting.php | 47 + app/Themes/Apiary/Walkers/MenuPrimary.php | 132 +++ .../Apiary/inc/helpers/image-helpers.php | 30 + .../Apiary/inc/helpers/post-helpers.php | 57 + app/Themes/Apiary/inc/helpers/wrapper.php | 22 + .../Apiary/inc/image-customizations.php | 71 ++ app/Themes/Apiary/inc/template-functions.php | 72 ++ app/Themes/Apiary/inc/template-tags.php | 185 +++ .../inc/woocommerce/archive-product.php | 100 ++ app/Themes/Apiary/inc/woocommerce/cart.php | 62 + .../Apiary/inc/woocommerce/checkout.php | 76 ++ app/Themes/Apiary/inc/woocommerce/core.php | 30 + app/Themes/Apiary/inc/woocommerce/medias.php | 33 + app/Themes/Apiary/inc/woocommerce/order.php | 44 + app/Themes/Apiary/inc/woocommerce/related.php | 23 + app/Themes/Apiary/inc/woocommerce/review.php | 103 ++ .../Apiary/inc/woocommerce/single-product.php | 54 + routes/web.php | 39 +- themes/apiary/.gitignore | 10 + themes/apiary/.php_cs.dist | 64 ++ themes/apiary/README.md | 23 + themes/{default => apiary}/assets/app.js | 4 +- themes/apiary/assets/css/backend/app.css | 3 + .../components/limit-login-attempts.css | 10 + .../css/backend/components/redis-object.css | 4 + .../backend/components/variation-swatches.css | 12 + themes/apiary/assets/css/editor/app.css | 3 + .../assets/css/editor/blocks}/.gitkeep | 0 .../apiary/assets/css/editor/buttons/icon.css | 1 + .../assets/css/editor/buttons/primary.css | 1 + .../assets/css/editor/buttons/secondary.css | 1 + themes/apiary/assets/css/editor/gutenberg.css | 16 + .../apiary/assets/css/editor/layout/align.css | 13 + .../apiary/assets/css/editor/layout/grid.css | 1 + .../assets/css/editor/layout/spacing.css | 1 + .../assets/css/editor/typography/fonts.css | 5 + .../assets/css/editor/typography/headings.css | 1 + .../assets/css/editor/typography/links.css | 1 + themes/apiary/assets/css/frontend/app.css | 9 + .../css/frontend/components/privacy-text.css | 3 + .../assets/css/frontend/components/rte.css | 3 + .../css/frontend/components/select2.css | 24 + .../components/variation-swatches.css | 122 ++ .../assets/css/frontend/components/wpgb.css | 40 + .../css/frontend/layout/single-product.css | 3 + themes/apiary/assets/css/login/app.css | 72 ++ themes/apiary/assets/fonts/.gitkeep | 0 .../assets/fonts/Inter-Italic.woff2 | Bin .../assets/fonts/Inter-Regular.woff2 | Bin themes/apiary/assets/img/.gitkeep | 0 themes/apiary/assets/js/frontend/app.js | 9 + themes/apiary/assets/js/frontend/cart.js | 5 + .../apiary/assets/js/frontend/components.js | 229 ++++ .../assets/js/frontend/link-obfuscator.js | 27 + themes/apiary/assets/js/frontend/reviews.js | 10 + themes/apiary/assets/media/.gitkeep | 0 themes/apiary/config/admin.php | 30 + themes/apiary/config/config.php | 55 + themes/apiary/config/disable.php | 22 + .../{default => apiary}/config/gutenberg.php | 7 +- themes/{default => apiary}/config/images.php | 10 +- themes/apiary/config/menus.php | 16 + .../{default => apiary}/config/providers.php | 3 +- themes/apiary/config/sidebars.php | 19 + .../config/support.php} | 33 +- themes/apiary/config/templates.php | 13 + themes/apiary/config/woocommerce.php | 115 ++ themes/apiary/functions.php | 2 + themes/apiary/index.php | 15 + themes/apiary/languages/fr_FR.mo | Bin 0 -> 18705 bytes themes/apiary/languages/fr_FR.po | 1020 +++++++++++++++++ themes/apiary/languages/readme.txt | 7 + themes/apiary/license.txt | 339 ++++++ themes/apiary/package.json | 39 + themes/apiary/postcss.config.js | 27 + .../resources/Cms/Disabled/Comments.php | 71 ++ .../apiary/resources/Cms/Disabled/Medias.php | 39 + .../resources/Cms/Disabled/RestUser.php | 31 + .../apiary/resources/Cms/Disabled/jQuery.php | 36 + themes/apiary/resources/Core/Filesystem.php | 61 + .../resources/Core/ViteJs/AssetLoader.php | 160 +++ .../apiary/resources/Core/ViteJs/Helpers.php | 96 ++ .../Providers/AdminCustomizerProvider.php | 171 +++ .../Providers/AssetServiceProvider.php | 46 + .../resources/Providers/Cms/Blocks/.gitkeep | 0 .../resources/Providers/Cms/Fields/.gitkeep | 0 .../Providers/Cms/Fields/ExampleField.php | 28 + .../resources/Providers/Cms/Menu/.gitkeep | 0 .../Providers/Cms/MetaBoxes/.gitkeep | 0 .../Providers/Cms/OptionPage/.gitkeep | 0 .../resources/Providers/Cms/Plugins/.gitkeep | 0 .../resources/Providers/Cms/Widgets/.gitkeep | 0 .../Providers/Fields/MenuFieldsProvider.php | 51 + .../Gutenberg/BlockServiceProvider.php | 63 + .../Gutenberg/PatternServiceProvider.php | 197 ++++ .../Providers/MenuServiceProvider.php | 55 + .../Providers/RouteServiceProvider.php | 36 + .../Providers/Store/ArchiveProduct.php | 42 + .../Providers/ThemeComponentProvider.php | 23 + .../Providers/ViewServiceProvider.php | 68 ++ .../Providers/ViteAssetsServiceProvider.php | 19 + .../Providers/WordPress/DisabledFeatures.php | 121 ++ .../Providers/WordPress/Formatting.php | 47 + .../resources/Providers/WordPress/Widgets.php | 31 + .../Providers/WpViewServiceProvider.php | 42 + .../apiary/resources/View/FileViewFinder.php | 78 ++ themes/apiary/resources/View/ViewFinder.php | 96 ++ themes/apiary/resources/View/WpView.php | 136 +++ themes/apiary/routes.php | 8 + themes/apiary/screenshot.png | Bin 0 -> 28572 bytes themes/apiary/style.css | 13 + themes/{default => apiary}/tailwind.config.js | 1 + themes/apiary/tailwind.safelist.txt | 0 themes/{default => apiary}/theme.json | 47 +- themes/apiary/views/blocks/example/block.json | 19 + themes/apiary/views/blocks/example/config.php | 5 + .../views/blocks/example/view.blade.php | 4 + themes/apiary/views/blog/archive.blade.php | 17 + themes/apiary/views/blog/single.blade.php | 13 + themes/apiary/views/comments/list.blade.php | 19 + themes/apiary/views/comments/template.php | 11 + .../views/components/button-large.blade.php | 3 + themes/apiary/views/errors/404.blade.php | 29 + themes/apiary/views/layouts/main.blade.php | 53 + themes/apiary/views/pages/default.blade.php | 11 + themes/apiary/views/pages/front.blade.php | 18 + themes/apiary/views/pages/search.blade.php | 16 + .../apiary/views/parts/content-none.blade.php | 28 + .../apiary/views/parts/content-page.blade.php | 37 + .../views/parts/content-search.blade.php | 20 + .../views/parts/content.blade.php | 20 +- themes/apiary/views/parts/footer.blade.php | 37 + themes/apiary/views/parts/header.blade.php | 144 +++ .../views/patterns/example.blade.php | 2 +- .../views/woocommerce/archive.blade.php | 59 + .../archive/archive-description.blade.php | 3 + .../archive/product-image.blade.php | 3 + .../woocommerce/archive/product.blade.php | 74 ++ .../woocommerce/archive/sidebar.blade.php | 16 + .../woocommerce/cart/cart-empty.blade.php | 42 + .../woocommerce/cart/cart-item-data.blade.php | 18 + .../woocommerce/cart/cart-shipping.blade.php | 124 ++ .../woocommerce/cart/cart-totals.blade.php | 107 ++ .../views/woocommerce/cart/cart.blade.php | 181 +++ .../woocommerce/cart/mini-cart.blade.php | 144 +++ .../cart/proceed-to-checkout-button.blade.php | 3 + .../cart/shipping-calculator.blade.php | 99 ++ .../views/woocommerce/checkout.blade.php | 29 + .../checkout/cart-errors.blade.php | 27 + .../checkout/form-billing.blade.php | 63 + .../checkout/form-checkout.blade.php | 77 ++ .../checkout/form-coupon.blade.php | 28 + .../woocommerce/checkout/form-login.blade.php | 43 + .../woocommerce/checkout/form-pay.blade.php | 124 ++ .../checkout/form-shipping.blade.php | 64 ++ .../checkout/order-receipt.blade.php | 52 + .../checkout/payment-method.blade.php | 39 + .../woocommerce/checkout/payment.blade.php | 62 + .../checkout/review-order.blade.php | 113 ++ .../woocommerce/checkout/terms.blade.php | 39 + .../woocommerce/checkout/thankyou.blade.php | 97 ++ .../woocommerce/content-product.blade.php | 73 ++ .../content-single-product.blade.php | 61 + .../woocommerce/global/breadcrumb.blade.php | 27 + .../woocommerce/global/form-login.blade.php | 120 ++ .../global/quantity-input.blade.php | 44 + .../woocommerce/global/rating-stars.blade.php | 15 + .../woocommerce/layouts/checkout.blade.php | 23 + .../woocommerce/loop/add-to-cart.blade.php | 18 + .../woocommerce/loop/loop-start.blade.php | 23 + .../views/woocommerce/loop/orderby.blade.php | 22 + .../views/woocommerce/loop/price.blade.php | 16 + .../woocommerce/loop/result-count.blade.php | 49 + .../woocommerce/myaccount/dashboard.blade.php | 78 ++ .../woocommerce/myaccount/downloads.blade.php | 51 + .../form-add-payment-method.blade.php | 68 ++ .../myaccount/form-edit-account.blade.php | 97 ++ .../myaccount/form-edit-address.blade.php | 48 + .../myaccount/form-login.blade.php | 130 +++ .../myaccount/form-lost-password.blade.php | 56 + .../myaccount/form-reset-password.blade.php | 57 + .../lost-password-confirmation.blade.php | 29 + .../myaccount/my-account.blade.php | 39 + .../myaccount/my-address.blade.php | 81 ++ .../myaccount/my-downloads.blade.php | 63 + .../woocommerce/myaccount/my-orders.blade.php | 127 ++ .../myaccount/navigation.blade.php | 38 + .../woocommerce/myaccount/orders.blade.php | 108 ++ .../myaccount/payment-methods.blade.php | 108 ++ .../myaccount/view-order.blade.php | 77 ++ .../views/woocommerce/notices/error.blade.php | 29 + .../woocommerce/notices/notice.blade.php | 29 + .../woocommerce/notices/success.blade.php | 28 + .../woocommerce/order/form-tracking.blade.php | 38 + .../woocommerce/order/order-again.blade.php | 25 + .../order/order-details-customer.blade.php | 49 + .../order/order-details-item.blade.php | 87 ++ .../woocommerce/order/order-details.blade.php | 177 +++ .../order/order-downloads.blade.php | 99 ++ .../woocommerce/order/tracking.blade.php | 73 ++ .../parts/footer/footer-checkout.blade.php | 8 + .../parts/header/header-checkout.blade.php | 38 + .../views/woocommerce/php/form-login.php | 60 + .../single-product-reviews.blade.php | 155 +++ .../add-to-cart/external.blade.php | 34 + .../add-to-cart/grouped.blade.php | 141 +++ .../add-to-cart/simple.blade.php | 60 + .../add-to-cart/variable.blade.php | 101 ++ .../variation-add-to-cart-button.blade.php | 37 + .../single-product/description.blade.php | 6 + .../woocommerce/single-product/meta.blade.php | 37 + .../product-attributes.blade.php | 36 + .../single-product/product-image.blade.php | 47 + .../single-product/rating-form.blade.php | 57 + .../single-product/rating.blade.php | 43 + .../single-product/related.blade.php | 53 + .../single-product/review-avatar.blade.php | 3 + .../single-product/review-comment.blade.php | 3 + .../single-product/review-meta.blade.php | 37 + .../single-product/review.blade.php | 65 ++ .../short-description.blade.php | 31 + .../tabs/additional-information.blade.php | 36 + .../single-product/tabs/description.blade.php | 27 + .../single-product/tabs/tabs.blade.php | 60 + .../single-product/title.blade.php | 1 + .../apiary/views/woocommerce/single.blade.php | 31 + themes/{default => apiary}/vite.config.js | 0 themes/{default => apiary}/yarn.lock | 685 +++++++---- themes/default/assets/css/app.css | 3 - themes/default/assets/images/pollora.svg | 10 - themes/default/assets/js/bootstrap.js | 31 - themes/default/config/config.php | 27 - themes/default/config/menus.php | 13 - themes/default/config/sidebars.php | 15 - themes/default/config/templates.php | 18 - themes/default/favicon.png | Bin 12559 -> 0 bytes themes/default/index.php | 4 - themes/default/package.json | 22 - themes/default/postcss.config.js | 6 - themes/default/style.css | 11 - themes/default/views/home.blade.php | 70 -- themes/default/views/layouts/app.blade.php | 89 -- themes/default/views/page.blade.php | 10 - themes/default/views/parts/search.blade.php | 10 - themes/default/views/post.blade.php | 7 - 247 files changed, 11886 insertions(+), 622 deletions(-) create mode 100644 app/Themes/Apiary/Providers/AssetServiceProvider.php create mode 100644 app/Themes/Apiary/Providers/ThemeComponentProvider.php create mode 100644 app/Themes/Apiary/Providers/WordPress/Formatting.php create mode 100644 app/Themes/Apiary/Walkers/MenuPrimary.php create mode 100644 app/Themes/Apiary/inc/helpers/image-helpers.php create mode 100644 app/Themes/Apiary/inc/helpers/post-helpers.php create mode 100644 app/Themes/Apiary/inc/helpers/wrapper.php create mode 100644 app/Themes/Apiary/inc/image-customizations.php create mode 100644 app/Themes/Apiary/inc/template-functions.php create mode 100644 app/Themes/Apiary/inc/template-tags.php create mode 100644 app/Themes/Apiary/inc/woocommerce/archive-product.php create mode 100644 app/Themes/Apiary/inc/woocommerce/cart.php create mode 100644 app/Themes/Apiary/inc/woocommerce/checkout.php create mode 100644 app/Themes/Apiary/inc/woocommerce/core.php create mode 100644 app/Themes/Apiary/inc/woocommerce/medias.php create mode 100644 app/Themes/Apiary/inc/woocommerce/order.php create mode 100644 app/Themes/Apiary/inc/woocommerce/related.php create mode 100644 app/Themes/Apiary/inc/woocommerce/review.php create mode 100644 app/Themes/Apiary/inc/woocommerce/single-product.php create mode 100644 themes/apiary/.gitignore create mode 100644 themes/apiary/.php_cs.dist create mode 100644 themes/apiary/README.md rename themes/{default => apiary}/assets/app.js (84%) create mode 100644 themes/apiary/assets/css/backend/app.css create mode 100644 themes/apiary/assets/css/backend/components/limit-login-attempts.css create mode 100644 themes/apiary/assets/css/backend/components/redis-object.css create mode 100644 themes/apiary/assets/css/backend/components/variation-swatches.css create mode 100644 themes/apiary/assets/css/editor/app.css rename themes/{default/assets/fonts => apiary/assets/css/editor/blocks}/.gitkeep (100%) create mode 100644 themes/apiary/assets/css/editor/buttons/icon.css create mode 100644 themes/apiary/assets/css/editor/buttons/primary.css create mode 100644 themes/apiary/assets/css/editor/buttons/secondary.css create mode 100644 themes/apiary/assets/css/editor/gutenberg.css create mode 100644 themes/apiary/assets/css/editor/layout/align.css create mode 100644 themes/apiary/assets/css/editor/layout/grid.css create mode 100644 themes/apiary/assets/css/editor/layout/spacing.css create mode 100644 themes/apiary/assets/css/editor/typography/fonts.css create mode 100644 themes/apiary/assets/css/editor/typography/headings.css create mode 100644 themes/apiary/assets/css/editor/typography/links.css create mode 100644 themes/apiary/assets/css/frontend/app.css create mode 100644 themes/apiary/assets/css/frontend/components/privacy-text.css create mode 100644 themes/apiary/assets/css/frontend/components/rte.css create mode 100644 themes/apiary/assets/css/frontend/components/select2.css create mode 100644 themes/apiary/assets/css/frontend/components/variation-swatches.css create mode 100644 themes/apiary/assets/css/frontend/components/wpgb.css create mode 100644 themes/apiary/assets/css/frontend/layout/single-product.css create mode 100644 themes/apiary/assets/css/login/app.css create mode 100644 themes/apiary/assets/fonts/.gitkeep rename themes/{default => apiary}/assets/fonts/Inter-Italic.woff2 (100%) rename themes/{default => apiary}/assets/fonts/Inter-Regular.woff2 (100%) create mode 100644 themes/apiary/assets/img/.gitkeep create mode 100644 themes/apiary/assets/js/frontend/app.js create mode 100644 themes/apiary/assets/js/frontend/cart.js create mode 100644 themes/apiary/assets/js/frontend/components.js create mode 100644 themes/apiary/assets/js/frontend/link-obfuscator.js create mode 100644 themes/apiary/assets/js/frontend/reviews.js create mode 100644 themes/apiary/assets/media/.gitkeep create mode 100644 themes/apiary/config/admin.php create mode 100644 themes/apiary/config/config.php create mode 100644 themes/apiary/config/disable.php rename themes/{default => apiary}/config/gutenberg.php (92%) rename themes/{default => apiary}/config/images.php (54%) create mode 100644 themes/apiary/config/menus.php rename themes/{default => apiary}/config/providers.php (80%) create mode 100644 themes/apiary/config/sidebars.php rename themes/{default/config/supports.php => apiary/config/support.php} (76%) create mode 100644 themes/apiary/config/templates.php create mode 100644 themes/apiary/config/woocommerce.php create mode 100644 themes/apiary/functions.php create mode 100644 themes/apiary/index.php create mode 100644 themes/apiary/languages/fr_FR.mo create mode 100644 themes/apiary/languages/fr_FR.po create mode 100644 themes/apiary/languages/readme.txt create mode 100644 themes/apiary/license.txt create mode 100644 themes/apiary/package.json create mode 100644 themes/apiary/postcss.config.js create mode 100644 themes/apiary/resources/Cms/Disabled/Comments.php create mode 100644 themes/apiary/resources/Cms/Disabled/Medias.php create mode 100644 themes/apiary/resources/Cms/Disabled/RestUser.php create mode 100644 themes/apiary/resources/Cms/Disabled/jQuery.php create mode 100644 themes/apiary/resources/Core/Filesystem.php create mode 100644 themes/apiary/resources/Core/ViteJs/AssetLoader.php create mode 100644 themes/apiary/resources/Core/ViteJs/Helpers.php create mode 100644 themes/apiary/resources/Providers/AdminCustomizerProvider.php create mode 100644 themes/apiary/resources/Providers/AssetServiceProvider.php create mode 100644 themes/apiary/resources/Providers/Cms/Blocks/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/Fields/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/Fields/ExampleField.php create mode 100644 themes/apiary/resources/Providers/Cms/Menu/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/MetaBoxes/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/OptionPage/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/Plugins/.gitkeep create mode 100644 themes/apiary/resources/Providers/Cms/Widgets/.gitkeep create mode 100644 themes/apiary/resources/Providers/Fields/MenuFieldsProvider.php create mode 100644 themes/apiary/resources/Providers/Gutenberg/BlockServiceProvider.php create mode 100644 themes/apiary/resources/Providers/Gutenberg/PatternServiceProvider.php create mode 100644 themes/apiary/resources/Providers/MenuServiceProvider.php create mode 100644 themes/apiary/resources/Providers/RouteServiceProvider.php create mode 100644 themes/apiary/resources/Providers/Store/ArchiveProduct.php create mode 100644 themes/apiary/resources/Providers/ThemeComponentProvider.php create mode 100644 themes/apiary/resources/Providers/ViewServiceProvider.php create mode 100644 themes/apiary/resources/Providers/ViteAssetsServiceProvider.php create mode 100644 themes/apiary/resources/Providers/WordPress/DisabledFeatures.php create mode 100644 themes/apiary/resources/Providers/WordPress/Formatting.php create mode 100644 themes/apiary/resources/Providers/WordPress/Widgets.php create mode 100644 themes/apiary/resources/Providers/WpViewServiceProvider.php create mode 100644 themes/apiary/resources/View/FileViewFinder.php create mode 100644 themes/apiary/resources/View/ViewFinder.php create mode 100644 themes/apiary/resources/View/WpView.php create mode 100644 themes/apiary/routes.php create mode 100644 themes/apiary/screenshot.png create mode 100644 themes/apiary/style.css rename themes/{default => apiary}/tailwind.config.js (88%) create mode 100644 themes/apiary/tailwind.safelist.txt rename themes/{default => apiary}/theme.json (91%) create mode 100644 themes/apiary/views/blocks/example/block.json create mode 100644 themes/apiary/views/blocks/example/config.php create mode 100644 themes/apiary/views/blocks/example/view.blade.php create mode 100644 themes/apiary/views/blog/archive.blade.php create mode 100644 themes/apiary/views/blog/single.blade.php create mode 100644 themes/apiary/views/comments/list.blade.php create mode 100644 themes/apiary/views/comments/template.php create mode 100644 themes/apiary/views/components/button-large.blade.php create mode 100644 themes/apiary/views/errors/404.blade.php create mode 100644 themes/apiary/views/layouts/main.blade.php create mode 100644 themes/apiary/views/pages/default.blade.php create mode 100644 themes/apiary/views/pages/front.blade.php create mode 100644 themes/apiary/views/pages/search.blade.php create mode 100644 themes/apiary/views/parts/content-none.blade.php create mode 100644 themes/apiary/views/parts/content-page.blade.php create mode 100644 themes/apiary/views/parts/content-search.blade.php rename themes/{default => apiary}/views/parts/content.blade.php (59%) create mode 100644 themes/apiary/views/parts/footer.blade.php create mode 100644 themes/apiary/views/parts/header.blade.php rename themes/{default => apiary}/views/patterns/example.blade.php (98%) create mode 100644 themes/apiary/views/woocommerce/archive.blade.php create mode 100644 themes/apiary/views/woocommerce/archive/archive-description.blade.php create mode 100644 themes/apiary/views/woocommerce/archive/product-image.blade.php create mode 100644 themes/apiary/views/woocommerce/archive/product.blade.php create mode 100644 themes/apiary/views/woocommerce/archive/sidebar.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/cart-empty.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/cart-item-data.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/cart-shipping.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/cart-totals.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/cart.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/mini-cart.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/proceed-to-checkout-button.blade.php create mode 100644 themes/apiary/views/woocommerce/cart/shipping-calculator.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/cart-errors.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-billing.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-checkout.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-coupon.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-login.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-pay.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/form-shipping.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/order-receipt.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/payment-method.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/payment.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/review-order.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/terms.blade.php create mode 100644 themes/apiary/views/woocommerce/checkout/thankyou.blade.php create mode 100644 themes/apiary/views/woocommerce/content-product.blade.php create mode 100644 themes/apiary/views/woocommerce/content-single-product.blade.php create mode 100644 themes/apiary/views/woocommerce/global/breadcrumb.blade.php create mode 100644 themes/apiary/views/woocommerce/global/form-login.blade.php create mode 100644 themes/apiary/views/woocommerce/global/quantity-input.blade.php create mode 100644 themes/apiary/views/woocommerce/global/rating-stars.blade.php create mode 100644 themes/apiary/views/woocommerce/layouts/checkout.blade.php create mode 100644 themes/apiary/views/woocommerce/loop/add-to-cart.blade.php create mode 100644 themes/apiary/views/woocommerce/loop/loop-start.blade.php create mode 100644 themes/apiary/views/woocommerce/loop/orderby.blade.php create mode 100644 themes/apiary/views/woocommerce/loop/price.blade.php create mode 100644 themes/apiary/views/woocommerce/loop/result-count.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/dashboard.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/downloads.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-add-payment-method.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-edit-account.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-edit-address.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-login.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-lost-password.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/form-reset-password.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/lost-password-confirmation.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/my-account.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/my-address.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/my-downloads.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/my-orders.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/navigation.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/orders.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/payment-methods.blade.php create mode 100644 themes/apiary/views/woocommerce/myaccount/view-order.blade.php create mode 100644 themes/apiary/views/woocommerce/notices/error.blade.php create mode 100644 themes/apiary/views/woocommerce/notices/notice.blade.php create mode 100644 themes/apiary/views/woocommerce/notices/success.blade.php create mode 100644 themes/apiary/views/woocommerce/order/form-tracking.blade.php create mode 100644 themes/apiary/views/woocommerce/order/order-again.blade.php create mode 100644 themes/apiary/views/woocommerce/order/order-details-customer.blade.php create mode 100644 themes/apiary/views/woocommerce/order/order-details-item.blade.php create mode 100644 themes/apiary/views/woocommerce/order/order-details.blade.php create mode 100644 themes/apiary/views/woocommerce/order/order-downloads.blade.php create mode 100644 themes/apiary/views/woocommerce/order/tracking.blade.php create mode 100644 themes/apiary/views/woocommerce/parts/footer/footer-checkout.blade.php create mode 100644 themes/apiary/views/woocommerce/parts/header/header-checkout.blade.php create mode 100644 themes/apiary/views/woocommerce/php/form-login.php create mode 100644 themes/apiary/views/woocommerce/single-product-reviews.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/add-to-cart/external.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/add-to-cart/grouped.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/add-to-cart/simple.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/add-to-cart/variable.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/description.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/meta.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/product-attributes.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/product-image.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/rating-form.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/rating.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/related.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/review-avatar.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/review-comment.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/review-meta.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/review.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/short-description.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/tabs/additional-information.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/tabs/description.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/tabs/tabs.blade.php create mode 100644 themes/apiary/views/woocommerce/single-product/title.blade.php create mode 100644 themes/apiary/views/woocommerce/single.blade.php rename themes/{default => apiary}/vite.config.js (100%) rename themes/{default => apiary}/yarn.lock (64%) delete mode 100644 themes/default/assets/css/app.css delete mode 100644 themes/default/assets/images/pollora.svg delete mode 100644 themes/default/assets/js/bootstrap.js delete mode 100644 themes/default/config/config.php delete mode 100644 themes/default/config/menus.php delete mode 100644 themes/default/config/sidebars.php delete mode 100644 themes/default/config/templates.php delete mode 100644 themes/default/favicon.png delete mode 100644 themes/default/index.php delete mode 100644 themes/default/package.json delete mode 100644 themes/default/postcss.config.js delete mode 100644 themes/default/style.css delete mode 100644 themes/default/views/home.blade.php delete mode 100644 themes/default/views/layouts/app.blade.php delete mode 100644 themes/default/views/page.blade.php delete mode 100644 themes/default/views/parts/search.blade.php delete mode 100644 themes/default/views/post.blade.php diff --git a/app/Themes/Apiary/Providers/AssetServiceProvider.php b/app/Themes/Apiary/Providers/AssetServiceProvider.php new file mode 100644 index 00000000000..27f92cdc46d --- /dev/null +++ b/app/Themes/Apiary/Providers/AssetServiceProvider.php @@ -0,0 +1,36 @@ +container('theme') + ->toFrontend() + ->useVite(); + //Asset::add('font-inter', 'https://rsms.me/inter/inter.css', [], $this->theme->getHeader('version'))->to('front'); + + Filter::add('woocommerce_enqueue_styles', function ($enqueueStyles) { + unset($enqueueStyles['woocommerce-general']); // Remove the default WooCommerce styles + unset($enqueueStyles['woocommerce-layout']); // Remove the layout + unset($enqueueStyles['woocommerce-smallscreen']); // Remove the smallscreen optimisation + + return $enqueueStyles; + }); + } +} diff --git a/app/Themes/Apiary/Providers/ThemeComponentProvider.php b/app/Themes/Apiary/Providers/ThemeComponentProvider.php new file mode 100644 index 00000000000..74dfdca7bfc --- /dev/null +++ b/app/Themes/Apiary/Providers/ThemeComponentProvider.php @@ -0,0 +1,23 @@ +bootBladeComponents(); + } + + protected function bootBladeComponents(): self + { + if (version_compare($this->app->version(), '8.0.0', '>=')) { + Blade::componentNamespace('App\Themes\Apiary\\View\\Components', 'theme'); + } + + return $this; + } +} diff --git a/app/Themes/Apiary/Providers/WordPress/Formatting.php b/app/Themes/Apiary/Providers/WordPress/Formatting.php new file mode 100644 index 00000000000..7ccff1a863f --- /dev/null +++ b/app/Themes/Apiary/Providers/WordPress/Formatting.php @@ -0,0 +1,47 @@ +currentItem = $item; + } + $hasChildren = in_array('menu-item-has-children', $item->classes); + + if ($hasChildren && $depth === 0) { + $output .= $this->createDropdownParent($item, $args); + } else { + $output .= $this->createMenuItem($item, $depth, $args); + } + } + + /** + * Ends the element output. + */ + public function end_el(&$output, $item, $depth = 0, $args = [], $id = 0): void + { + if (in_array('menu-item-has-children', $item->classes) && $depth === 0) { + $output .= ''; + } + } + + /** + * Starts the list wrapper. + */ + public function start_lvl(&$output, $depth = 0, $args = []): void + { + if ($depth === 0) { + $output .= '
+
'; + } + } + + /** + * Ends the list wrapper. + */ + public function end_lvl(&$output, $depth = 0, $args = []): void + { + if ($depth === 0) { + $parent_item = $this->currentItem; + $output .= '
'; + $output .= sprintf( + ' + %s %s + ', + esc_url($parent_item->url), + __('Access to'), + $parent_item->title + ); + $output .= '
'; + } + } + + /** + * Creates a dropdown parent element. + */ + protected function createDropdownParent($item, $args): string + { + $classes = empty($item->classes) ? [] : (array) $item->classes; + $classes[] = 'relative'; + + return sprintf( + '
+ ', + implode(' ', $classes), + $item->title + ); + } + + /** + * Creates a regular menu item. + */ + protected function createMenuItem($item, $depth, $args): string + { + $classes = empty($item->classes) ? [] : (array) $item->classes; + + // Classes de base pour les liens + if ($depth === 0) { + $classes[] = 'px-4 py-2 mt-2 text-sm font-semibold text-gray-900 bg-transparent rounded-lg md:mt-0 md:ml-4 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline'; + } else { + $classes[] = 'block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white'; + } + + $atts = [ + 'href' => !empty($item->url) ? $item->url : '#', + 'title' => !empty($item->attr_title) ? $item->attr_title : '', + 'target' => !empty($item->target) ? $item->target : '', + 'rel' => !empty($item->xfn) ? $item->xfn : '', + 'class' => implode(' ', $classes) + ]; + + $attributes = ''; + foreach ($atts as $attr => $value) { + if (!empty($value)) { + $value = ('href' === $attr) ? esc_url($value) : esc_attr($value); + $attributes .= ' ' . $attr . '="' . $value . '"'; + } + } + + return sprintf('%s', $attributes, $item->title); + } +} diff --git a/app/Themes/Apiary/inc/helpers/image-helpers.php b/app/Themes/Apiary/inc/helpers/image-helpers.php new file mode 100644 index 00000000000..a9562b3f7b3 --- /dev/null +++ b/app/Themes/Apiary/inc/helpers/image-helpers.php @@ -0,0 +1,30 @@ + get_the_title($post_id), + 'link' => get_permalink($post_id), + 'excerpt' => get_the_excerpt($post_id), + 'time' => get_post_time('c', true, $post_id), + 'date' => get_the_date('', $post_id), + 'author_name' => $author_name, + 'author_url' => $author_url, + 'img' => [ + 'url' => get_resized_image_url($img_id, $img_size), + 'alt' => get_image_alt($img_id), + ], + ]; +} + +/** + * Get single post data in nice array format. + * + * @param int $post_id + * @return array + */ +function get_single_post_data($post_id = 0) +{ + if (empty($post_id)) { + $post_id = get_the_id(); + } + + // We can get and use all teaser data + $data = get_post_teaser_data($post_id, 'medium'); + + // And add more data + return array_merge($data, [ + 'content' => apply_filters('the_content', get_post_field('post_content', $post_id, 'raw')), + ]); +} diff --git a/app/Themes/Apiary/inc/helpers/wrapper.php b/app/Themes/Apiary/inc/helpers/wrapper.php new file mode 100644 index 00000000000..c67afbb6418 --- /dev/null +++ b/app/Themes/Apiary/inc/helpers/wrapper.php @@ -0,0 +1,22 @@ +"; + if ($echo) { + echo $html; + } else { + return $html; + } +} + +function wrapper_close(string $tag = 'div', bool $echo = true) +{ + $tag = $tag === '' ? 'div' : $tag; + $html = ""; + if ($echo) { + echo $html; + } else { + return $html; + } +} diff --git a/app/Themes/Apiary/inc/image-customizations.php b/app/Themes/Apiary/inc/image-customizations.php new file mode 100644 index 00000000000..9b78a5328a7 --- /dev/null +++ b/app/Themes/Apiary/inc/image-customizations.php @@ -0,0 +1,71 @@ +\\s*?(<\\/a>|)?\\s*<\\/p>/s', '
$1
', $pee); +}, 50); + +/** + * Customized the output of caption, you can remove the filter to restore back to the WP default output. + * Courtesy of DevPress. http://devpress.com/blog/captions-in-wordpress/ + */ +add_filter('img_caption_shortcode', function ($output, $attr, $content) { + /* We're not worried abut captions in feeds, so just return the output here. */ + if (is_feed()) { + return $output; + } + + /* Set up the default arguments. */ + $defaults = [ + 'id' => '', + 'align' => 'alignnone', + 'width' => '', + 'caption' => '', + ]; + /* Merge the defaults with user input. */ + $attr = shortcode_atts($defaults, $attr); + + /* If the width is less than 1 or there is no caption, return the content wrapped between the [caption]< tags. */ + if (1 > $attr['width'] || empty($attr['caption'])) { + return $content; + } + + /* Set up the attributes for the caption
. */ + $attributes = ' class="media '.esc_attr($attr['align']).'"'; + /* Open the caption
. */ + $output = ''; + /* Allow shortcodes for the content the caption was created for. */ + $output .= do_shortcode($content); + /* Append the caption text. */ + $output .= '
'.$attr['caption'].'
'; + /* Close the caption
. */ + $output .= ''; + + /* Return the formatted, clean caption. */ + return $output; +}, 10, 3); + +/** + * @param string $img_classes Image classes (default : w-8 h-8) + * @param string $link_classes Link image (default: custom-logo-link) + * @param bool $enableLink Enable or disable the logo link (default : true) + * @return string Logo HTML code + */ +function custom_logo($img_classes = 'w-8 h-8', $link_classes = 'custom-logo-link', $enableLink = true) +{ + $custom_logo_id = get_theme_mod('custom_logo'); + + return $enableLink ? sprintf('
', + home_url(), + wp_get_attachment_image($custom_logo_id, 'full', false, [ + 'class' => $img_classes, + ]) + ) : wp_get_attachment_image($custom_logo_id, 'full', false, [ + 'class' => $img_classes, + ]); +} diff --git a/app/Themes/Apiary/inc/template-functions.php b/app/Themes/Apiary/inc/template-functions.php new file mode 100644 index 00000000000..80392d31e03 --- /dev/null +++ b/app/Themes/Apiary/inc/template-functions.php @@ -0,0 +1,72 @@ +base !== 'nav-menus') { + return $match; + } + + if ($rule['operator'] == '==') { + $match = isset($options['nav_menu_item_depth']) && (string) $options['nav_menu_item_depth'] === $rule['value']; + } + + return $match; +}, 10, 3); + +/** + * Add a pingback url auto-discovery header for single posts, pages, or attachments. + */ +Action::add('wp_head', function () { + if (is_singular() && pings_open()) { + echo ''; + } +}); + +/** + * Set the content width in pixels, based on the theme's design and stylesheet. + */ +Action::add('after_setup_theme', function () { + $GLOBALS['content_width'] = 640; +}, 0); diff --git a/app/Themes/Apiary/inc/template-tags.php b/app/Themes/Apiary/inc/template-tags.php new file mode 100644 index 00000000000..33e668c823c --- /dev/null +++ b/app/Themes/Apiary/inc/template-tags.php @@ -0,0 +1,185 @@ +%2$s'; + + if (get_the_time('U') !== get_the_modified_time('U')) { + $time_string = ''; + } + + $time_string = sprintf( + $time_string, + esc_attr(get_the_date(DATE_W3C)), + esc_html(get_the_date()), + esc_attr(get_the_modified_date(DATE_W3C)), + esc_html(get_the_modified_date()) + ); + + /* translators: %s: post date. */ + $posted_on = sprintf( + esc_html_x('Posted on %s', 'post date', 'apiary'), + ''.$time_string.'' + ); + + return ''.$posted_on.''; + } +} + +if (! function_exists('posted_by')) { + /** + * Prints HTML with meta information for the current author. + */ + function posted_by() + { + /* translators: %s: post author. */ + $byline = sprintf( + esc_html_x('by %s', 'post author', 'apiary'), + ''.esc_html(get_the_author()).'' + ); + + return ''; + } +} + +if (! function_exists('post_thumbnail')) { + /** + * Displays an optional post thumbnail. + * + * Wraps the post thumbnail in an anchor element on index views, or a div + * element when on single views. + */ + function post_thumbnail() + { + if (post_password_required() || is_attachment() || ! has_post_thumbnail()) { + return; + } + + if (is_singular()) { + return sprintf( + '
%s
', + get_the_post_thumbnail() + ); + } else { + return sprintf( + '', + get_permalink(), + get_the_post_thumbnail(null, 'post-thumbnail', [ + 'alt' => the_title_attribute(['echo' => false]), + ]) + ); + } + } +} + +if (! function_exists('entry_footer')) { + /** + * Prints HTML with meta information for the categories, tags and comments. + */ + function entry_footer() + { + // Hide category and tag text for pages. + if ('post' === get_post_type()) { + /* translators: used between list items, there is a space after the comma */ + $categories_list = get_the_category_list(esc_html__(', ', 'apiary')); + + if ($categories_list) { + /* translators: 1: list of categories. */ + printf( + ''.esc_html__('Posted in %1$s', 'apiary').'', + $categories_list + ); + } + + /* translators: used between list items, there is a space after the comma */ + $tags_list = get_the_tag_list('', esc_html_x(', ', 'list item separator', 'apiary')); + + if ($tags_list) { + /* translators: 1: list of tags. */ + printf( + ''.esc_html__('Tagged %1$s', 'apiary').'', + $tags_list + ); + } + } + + if (! is_single() && ! post_password_required() && (comments_open() || get_comments_number())) { + echo ''; + comments_popup_link( + sprintf( + wp_kses( + /* translators: %s: post title */ + __('Leave a Comment on %s', 'apiary'), + [ + 'span' => [ + 'class' => [], + ], + ] + ), + get_the_title() + ) + ); + echo ''; + } + + edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __('Edit %s', 'apiary'), + [ + 'span' => [ + 'class' => [], + ], + ] + ), + get_the_title() + ), + '', + '' + ); + } +} + +if (! function_exists('comments_title')) { + /** + * Return the comments title. + * + * @param int $count The number of comments. + * @return string + */ + function comments_title($count) + { + if (1 === $count) { + return sprintf( + esc_html__('One thought on “%1$s”', 'apiary'), + ''.get_the_title().'' + ); + } + + return sprintf( + esc_html(_nx('%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $count, 'comments title', 'apiary')), + number_format_i18n($count), + ''.get_the_title().'' + ); + } +} + +if (! function_exists('archive_content_message')) { + /** + * Return an archive content message. + * + * @return string + */ + function archive_content_message() + { + return sprintf( + '

'.esc_html__('Try looking in the monthly archives. %1$s', 'apiary').'

', + convert_smilies(':)') + ); + } +} diff --git a/app/Themes/Apiary/inc/woocommerce/archive-product.php b/app/Themes/Apiary/inc/woocommerce/archive-product.php new file mode 100644 index 00000000000..6a5b3513b3f --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/archive-product.php @@ -0,0 +1,100 @@ +description)) { + $description = wc_format_content(wp_kses_post($term->description)); + echo view('woocommerce.archive.archive-description', ['description' => $description]); + } + } +} + +/** + * Override the woocommerce_product_archive_description function + */ +function woocommerce_product_archive_description() +{ + // Don't display the description on search results page. + if (is_search()) { + return; + } + + if (is_post_type_archive('product') && in_array(absint(get_query_var('paged')), [0, 1], true)) { + $shop_page = get_post(wc_get_page_id('shop')); + if ($shop_page) { + + $allowed_html = wp_kses_allowed_html('post'); + + // This is needed for the search product block to work. + $allowed_html = array_merge( + $allowed_html, + [ + 'form' => [ + 'action' => true, + 'accept' => true, + 'accept-charset' => true, + 'enctype' => true, + 'method' => true, + 'name' => true, + 'target' => true, + ], + + 'input' => [ + 'type' => true, + 'id' => true, + 'class' => true, + 'placeholder' => true, + 'name' => true, + 'value' => true, + ], + + 'button' => [ + 'type' => true, + 'class' => true, + 'label' => true, + ], + + 'svg' => [ + 'hidden' => true, + 'role' => true, + 'focusable' => true, + 'xmlns' => true, + 'width' => true, + 'height' => true, + 'viewbox' => true, + ], + 'path' => [ + 'd' => true, + ], + ] + ); + + $description = wc_format_content(wp_kses($shop_page->post_content, $allowed_html)); + if ($description) { + echo view('woocommerce.archive.archive-description', ['description' => $description]); + } + } + } +} + +// Product title classes +Filter::add('woocommerce_product_loop_title_classes', function (string $classes) { + $product_title_class = config('woocommerce.archive-product.product_title.class', 'text-sm font-medium text-gray-900'); + + return $product_title_class.' '.$classes; +}, 90); diff --git a/app/Themes/Apiary/inc/woocommerce/cart.php b/app/Themes/Apiary/inc/woocommerce/cart.php new file mode 100644 index 00000000000..63ea0468da0 --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/cart.php @@ -0,0 +1,62 @@ +cart->cart_contents_count; + } +} + +// Cart count ajax fragment +Filter::add('woocommerce_add_to_cart_fragments', function ($fragments) { + $fragments['.cart-count'] = ''.wc_get_cart_item_count().''; + + return $fragments; +}); + +// Echo a hidden field with csrf token as value +Action::add('woocommerce_before_add_to_cart_button', function (): void { + echo ''; +}); + +// Enquey the cart variation script +Action::add('wp_enqueue_scripts', function (): void { + wp_enqueue_script('wc-add-to-cart-variation'); +}); + +// Remove attribute from the variation title +Filter::add('woocommerce_product_variation_title_include_attributes', '__return_false'); + +if (! function_exists('wc_cart_item_data_format')) { + /** + * Cart item data formatting + */ + function wc_cart_item_data_format(array $item_data): string + { + $formatted_metas = []; + foreach ($item_data as $key => $meta) { + $output = sprintf('%s: %s', $meta['key'], $meta['display']); + + $formatted_metas[] = $output; + } + + return implode(', ', $formatted_metas); + } +} + +/** + * Override the woocommerce_widget_shopping_cart_subtotal function + */ +function woocommerce_widget_shopping_cart_subtotal(): string +{ + return ''; +} + +Filter::add('wc_add_to_cart_message_html', function ($message) { + return str_replace('button wc-forward wp-element-button', 'button wc-forward inline-block w-auto bg-indigo-600 border border-transparent rounded-md py-3 px-8 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 mr-4', $message); +}); diff --git a/app/Themes/Apiary/inc/woocommerce/checkout.php b/app/Themes/Apiary/inc/woocommerce/checkout.php new file mode 100644 index 00000000000..8494d282af2 --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/checkout.php @@ -0,0 +1,76 @@ +query->get_current_endpoint() === ''; + } +} + +if (! function_exists('wc_get_shipping_method_index')) { + /** + * Get the shipping method index + */ + function wc_get_shipping_method_index(string $chosen_method, array $available_methods): int + { + return (int) array_search($chosen_method, array_keys($available_methods)); + } +} + +// Create shippping methods specific ajax fragment +Filter::add('woocommerce_update_order_review_fragments', function ($fragments) { + // Get checkout payment fragment. + ob_start(); + ?> +
+ cart->needs_shipping() && WC()->cart->show_shipping()) { ?> + + + + +
+ makeLoader(); + } + + return $template; +}); diff --git a/app/Themes/Apiary/inc/woocommerce/medias.php b/app/Themes/Apiary/inc/woocommerce/medias.php new file mode 100644 index 00000000000..7f177c88052 --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/medias.php @@ -0,0 +1,33 @@ + 696, + 'height' => '', + 'crop' => 0, + ]; +}); + +/** + * Override the woocommerce_get_product_thumbnail function + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\Factory|\Illuminate\View\View|string|\Pollora\Core\Application + */ +function woocommerce_get_product_thumbnail(string $size = 'woocommerce_thumbnail', int $deprecated1 = 0, int $deprecated2 = 0) +{ + global $product; + + $image_size = apply_filters('single_product_archive_thumbnail_size', $size); + $args['class'] = config('woocommerce.archive-product.product_thumbnail.class', 'w-full h-full object-center object-cover sm:w-full sm:h-full'); + $thumbnail = $product->get_image($image_size, $args); + + return $product ? view('woocommerce.archive.product-image', ['thumbnail' => $thumbnail]) : ''; +} + +// Product thumbnail sizing +Filter::add('woocommerce_checkout_item_thumbnail', fn ($html) => str_replace('attachment-woocommerce_thumbnail', 'attachment-woocommerce_thumbnail '.config('woocommerce.checkout.product_thumbnail.class', 'w-20 h-20 rounded-md object-center object-cover'), $html)); +Filter::add('woocommerce_thank_you_item_thumbnail', fn ($html) => str_replace('attachment-woocommerce_thumbnail', 'attachment-woocommerce_thumbnail '.config('woocommerce.thank_you.product_thumbnail.class', 'flex-none w-20 h-20 object-center object-cover bg-gray-100 rounded-lg sm:w-40 sm:h-40'), $html)); +Filter::add('woocommerce_cart_item_thumbnail', fn ($html) => str_replace('attachment-woocommerce_thumbnail', 'attachment-woocommerce_thumbnail'.config('woocommerce.cart.product_thumbnail.class', 'w-24 h-24 rounded-md object-center object-cover sm:w-48 sm:h-48'), $html)); diff --git a/app/Themes/Apiary/inc/woocommerce/order.php b/app/Themes/Apiary/inc/woocommerce/order.php new file mode 100644 index 00000000000..0e582cc3ffb --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/order.php @@ -0,0 +1,44 @@ +get_status(); + $final_statuses = ['completed', 'cancelled', 'refunded', 'failed']; + + if ($current_status !== 'on-hold') { + unset($order_statuses['wc-on-hold']); + } + + foreach ($final_statuses as $final_status) { + if ($current_status !== $final_status) { + if (! in_array($current_status, $final_statuses) && $final_status === 'completed') { + continue; + } + unset($order_statuses["wc-{$final_status}"]); + } + } + + return $order_statuses; + } +} + +if (! function_exists('wc_get_order_status_progress')) { + /** + * Get the percentage of the status progress of a WooCommerce Order + */ + function wc_get_order_status_progress(WC_Order $order): int + { + $statuses = wc_get_current_order_statuses($order); + $current_status = $order->get_status(); + $status_index = array_search("wc-{$current_status}", array_keys($statuses)); + $status_count = count($statuses); + $status_quotient = $status_index / ($status_count - 1); + + return min(100, ($status_quotient * 100 + 5)); + } +} diff --git a/app/Themes/Apiary/inc/woocommerce/related.php b/app/Themes/Apiary/inc/woocommerce/related.php new file mode 100644 index 00000000000..0f5ae0d3a8b --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/related.php @@ -0,0 +1,23 @@ + Filter::add('woocommerce_product_loop_start', 'th_inject_related_product_classes')); +Action::add('woocommerce_after_related_products', fn () => Filter::remove('woocommerce_product_loop_start', 'th_inject_related_product_classes')); diff --git a/app/Themes/Apiary/inc/woocommerce/review.php b/app/Themes/Apiary/inc/woocommerce/review.php new file mode 100644 index 00000000000..632b5b05624 --- /dev/null +++ b/app/Themes/Apiary/inc/woocommerce/review.php @@ -0,0 +1,103 @@ +
'; + + return $args; + } +} + +Filter::add('woocommerce_product_review_comment_form_args', 'wc_review_comment_form_args', 50); + +Filter::add('comment_form_field_cookies', function ($output) { + $label_class = config('woocommerce.review.form.cookie.label.class', 'text-sm font-medium text-gray-700 mb-1 ml-3'); + $wrapper_class = config('woocommerce.review.form.cookie.wrapper.class', 'py-3 flex items-start'); + $checkbox_class = config('woocommerce.review.form.cookie.checkbox.class', 'focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded'); + + $search = [ + '
- + \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/archive.blade.php b/themes/apiary/views/woocommerce/archive.blade.php new file mode 100644 index 00000000000..44203e6bcfa --- /dev/null +++ b/themes/apiary/views/woocommerce/archive.blade.php @@ -0,0 +1,59 @@ +@extends('layouts.main') + +@section('content') + @php + do_action('woocommerce_before_main_content') + @endphp +
+ @if(apply_filters('woocommerce_show_page_title', true)) +

{{ woocommerce_page_title(false) }}

+ @endif + @php + do_action('woocommerce_archive_description') + @endphp +
+
+
+ + @php + do_action('woocommerce_before_shop_loop') + @endphp +
+
+
+ @include('woocommerce.archive.sidebar') +
+ + @php + woocommerce_product_loop_start(); + + if ( wc_get_loop_prop( 'total' ) ) { + while ( have_posts() ) { + the_post(); + + /** + * Hook: woocommerce_shop_loop. + */ + do_action( 'woocommerce_shop_loop' ); + + wc_get_template_part( 'content', 'product' ); + } + } + + woocommerce_product_loop_end(); + @endphp + @php + do_action('woocommerce_after_shop_loop') + @endphp +
+
+ + @php + do_action('woocommerce_after_main_content') + @endphp +@endsection diff --git a/themes/apiary/views/woocommerce/archive/archive-description.blade.php b/themes/apiary/views/woocommerce/archive/archive-description.blade.php new file mode 100644 index 00000000000..d882bf33d96 --- /dev/null +++ b/themes/apiary/views/woocommerce/archive/archive-description.blade.php @@ -0,0 +1,3 @@ +
+ {!! $description !!} +
\ No newline at end of file diff --git a/themes/apiary/views/woocommerce/archive/product-image.blade.php b/themes/apiary/views/woocommerce/archive/product-image.blade.php new file mode 100644 index 00000000000..de7ad174d6e --- /dev/null +++ b/themes/apiary/views/woocommerce/archive/product-image.blade.php @@ -0,0 +1,3 @@ +
+ {!! $thumbnail !!} +
\ No newline at end of file diff --git a/themes/apiary/views/woocommerce/archive/product.blade.php b/themes/apiary/views/woocommerce/archive/product.blade.php new file mode 100644 index 00000000000..c576be45804 --- /dev/null +++ b/themes/apiary/views/woocommerce/archive/product.blade.php @@ -0,0 +1,74 @@ +{{-- + * The template for displaying product content within loops + * + * This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 +--}} + +@php + global $product; +@endphp + +@if ( empty( $product ) || ! $product->is_visible() ) + return; +@endif + +
+ @php + /** + * Hook: woocommerce_before_shop_loop_item. + * + * @hooked woocommerce_template_loop_product_link_open - 10 + */ + do_action( 'woocommerce_before_shop_loop_item' ); + + /** + * Hook: woocommerce_before_shop_loop_item_title. + * + * @hooked woocommerce_show_product_loop_sale_flash - 10 + * @hooked woocommerce_template_loop_product_thumbnail - 10 + */ + do_action( 'woocommerce_before_shop_loop_item_title' ); + @endphp +
+
+ @php + /** + * Hook: woocommerce_shop_loop_item_title. + * + * @hooked woocommerce_template_loop_product_title - 10 + */ + do_action( 'woocommerce_shop_loop_item_title' ); + + /** + * Hook: woocommerce_after_shop_loop_item_title. + * + * @hooked woocommerce_template_loop_rating - 5 + * @hooked woocommerce_template_loop_price - 10 + */ + do_action( 'woocommerce_after_shop_loop_item_title' ); + + /** + * Hook: woocommerce_after_shop_loop_item. + * + * @hooked woocommerce_template_loop_product_link_close - 5 + * @hooked woocommerce_template_loop_add_to_cart - 10 + */ + @endphp +
+
+ @php + do_action( 'woocommerce_after_shop_loop_item' ); + @endphp +
+
+
diff --git a/themes/apiary/views/woocommerce/archive/sidebar.blade.php b/themes/apiary/views/woocommerce/archive/sidebar.blade.php new file mode 100644 index 00000000000..28809a32bf8 --- /dev/null +++ b/themes/apiary/views/woocommerce/archive/sidebar.blade.php @@ -0,0 +1,16 @@ + diff --git a/themes/apiary/views/woocommerce/cart/cart-empty.blade.php b/themes/apiary/views/woocommerce/cart/cart-empty.blade.php new file mode 100644 index 00000000000..0004af21629 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/cart-empty.blade.php @@ -0,0 +1,42 @@ +{{-- + * @hooked wc_empty_cart_message - 10 + --}} +{{-- * + * Empty cart page + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-empty.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https: * @package WooCommerce\Templates + * @version 3.5.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +defined( 'ABSPATH' ) || exit; + + +do_action( 'woocommerce_cart_is_empty' ); +@endphp +@if ( wc_get_page_id( 'shop' ) > 0 ) + +

+ + {{-- * + * Filter "Return To Shop" text. + * + * @since 4.6.0 + * @param string $default_text Default text. + --}} +{!! esc_html( apply_filters( 'woocommerce_return_to_shop_text', __( 'Return to shop', 'woocommerce' ) ) ) !!} + +

+ +@endif + diff --git a/themes/apiary/views/woocommerce/cart/cart-item-data.blade.php b/themes/apiary/views/woocommerce/cart/cart-item-data.blade.php new file mode 100644 index 00000000000..080debfe217 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/cart-item-data.blade.php @@ -0,0 +1,18 @@ +{{-- * + * Cart item data (when outputting non-flat) + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-item-data.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 2.4.0 +--}} +
+ {!! wc_cart_item_data_format($item_data) !!} +
diff --git a/themes/apiary/views/woocommerce/cart/cart-shipping.blade.php b/themes/apiary/views/woocommerce/cart/cart-shipping.blade.php new file mode 100644 index 00000000000..cc6274a35c9 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/cart-shipping.blade.php @@ -0,0 +1,124 @@ +{{-- * + * Shipping Methods Display + * + * In 2.1 we show methods per package. This allows for multiple methods per order if so desired. + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-shipping.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + $formatted_destination = isset( $formatted_destination ) ? $formatted_destination : WC()->countries->get_formatted_address( $package['destination'], ', ' ); + $has_calculated_shipping = ! empty( $has_calculated_shipping ); + $show_shipping_calculator = ! empty( $show_shipping_calculator ); + $calculator_text = ''; +@endphp + +
+
+ @if ( $available_methods ) +
+ {!! wp_kses_post( $package_name ) !!} +
+ @if ( $available_methods ) + @php + $initialIndex = wc_get_shipping_method_index($chosen_method, $available_methods) + @endphp +
+ @foreach ( $available_methods as $method ) + + @php do_action('woocommerce_after_shipping_rate', $method, $index); @endphp + @endforeach +
+ @endif + + + @if ( is_cart() ) +

+ {{-- Translators: $s shipping destination. --}} + @if ( $formatted_destination ) + {!! sprintf( esc_html__( 'Shipping to %s.', 'woocommerce' ) . ' ', '' . esc_html( $formatted_destination ) . '' ) !!} + @php + $calculator_text = esc_html__( 'Change address', 'woocommerce' ); + @endphp + @else + {!! wp_kses_post( apply_filters( 'woocommerce_shipping_estimate_html', __( 'Shipping options will be updated during checkout.', 'woocommerce' ) ) ) !!} + @endif +

+ @endif + + {{-- Translators: $s shipping destination. --}} + + @elseif ( ! $has_calculated_shipping || ! $formatted_destination ) +

+ @if ( is_cart() && 'no' === get_option( 'woocommerce_enable_shipping_calc' ) ) + {!! wp_kses_post( apply_filters( 'woocommerce_shipping_not_enabled_on_cart_html', __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) ) ) !!} + @else + {!! wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) ) !!} + @endif +

+ @elseif ( ! is_cart() ) +

+ {!! wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) ) !!} +

+ @else + {!! wp_kses_post( apply_filters( 'woocommerce_cart_no_shipping_available_html', sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '' . esc_html( $formatted_destination ) . '' ) ) ) !!} + @php + $calculator_text = esc_html__( 'Enter a different address', 'woocommerce' ); + @endphp + @endif + + @if ( $show_package_details ) +

+ {{ $package_details }} +

+ @endif + + @if ( $show_shipping_calculator ) + @php woocommerce_shipping_calculator( $calculator_text ); @endphp + @endif +
+
diff --git a/themes/apiary/views/woocommerce/cart/cart-totals.blade.php b/themes/apiary/views/woocommerce/cart/cart-totals.blade.php new file mode 100644 index 00000000000..c74696c645a --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/cart-totals.blade.php @@ -0,0 +1,107 @@ +{{-- * + * Cart totals + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-totals.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 2.3.6 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
+ + @php do_action( 'woocommerce_before_cart_totals' ); @endphp +

@php esc_html_e( 'Cart totals', 'woocommerce' ); @endphp

+ +
+
+
@php esc_html_e( 'Subtotal', 'woocommerce' ); @endphp
+
@php wc_cart_totals_subtotal_html(); @endphp
+
+ @foreach ( WC()->cart->get_coupons() as $code => $coupon ) +
+
@php wc_cart_totals_coupon_label( $coupon ); @endphp
+
@php wc_cart_totals_coupon_html( $coupon ); @endphp
+
+ @endforeach + + @if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) + @php do_action( 'woocommerce_cart_totals_before_shipping' ); @endphp + @php wc_cart_totals_shipping_html(); @endphp + @php do_action( 'woocommerce_cart_totals_after_shipping' ); @endphp + @elseif ( WC()->cart->needs_shipping() && 'yes' === get_option( 'woocommerce_enable_shipping_calc' ) ) +
+
@php esc_html_e( 'Shipping', 'woocommerce' ); @endphp
+
+ {!! woocommerce_shipping_calculator() !!} +
+
+ @endif + + @foreach ( WC()->cart->get_fees() as $fee ) +
+
{!! esc_html( $fee->name ) !!}
+
@php wc_cart_totals_fee_html( $fee ); @endphp
+
+ @endforeach + + {{-- translators: %s location. --}} + @if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) + @php + $taxable_address = WC()->customer->get_taxable_address(); + $estimated_text = ''; + if ( WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ) { + $estimated_text = sprintf( ' ' . esc_html__( '(estimated for %s)', 'woocommerce' ) . '', WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] ); + } + @endphp + @if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) + @foreach ( WC()->cart->get_tax_totals() as $code => $tax ) +
+
+ {!! ($tax->label . $estimated_text) !!} +
+
+ {!! wp_kses_post( $tax->formatted_amount ) !!} +
+
+ @endforeach + @else +
+
+ {!! (WC()->countries->tax_or_vat() . $estimated_text) !!} +
+
+ {!! wc_cart_totals_taxes_total_html() !!} +
+
+ @endif + @endif + + @php do_action( 'woocommerce_cart_totals_before_order_total' ); @endphp + +
+
+ @php esc_html_e( 'Total', 'woocommerce' ); @endphp +
+
+ @php wc_cart_totals_order_total_html(); @endphp +
+
+ + @php do_action( 'woocommerce_cart_totals_after_order_total' ); @endphp + +
+ +
+ @php do_action( 'woocommerce_proceed_to_checkout' ); @endphp +
+ + @php do_action( 'woocommerce_after_cart_totals' ); @endphp + +
diff --git a/themes/apiary/views/woocommerce/cart/cart.blade.php b/themes/apiary/views/woocommerce/cart/cart.blade.php new file mode 100644 index 00000000000..0508d3d4d89 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/cart.blade.php @@ -0,0 +1,181 @@ +{{-- * + * Cart Page + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.8.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
+

{!! Loop::title() !!}

+
+ +@php + do_action( 'woocommerce_before_cart' ); +@endphp + +
+
+ @php do_action( 'woocommerce_before_cart_table' ); @endphp + +
    + @php do_action( 'woocommerce_before_cart_contents' ); @endphp + @foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) + @php + $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); + $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); + @endphp + + @if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) + @php + $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); + @endphp +
  • +
    + @php + $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); + @endphp + @if ( ! $product_permalink ) + {!! $thumbnail !!} + @else + {!! sprintf( '%s', esc_url( $product_permalink ), $thumbnail ) !!} + @endif +
    + +
    +
    +
    +
    +

    + {{-- Backorder notification. --}} + {{-- Meta data. --}} + + @if ( ! $product_permalink ) { + {!! wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . ' ' ) !!} + @else + {!! wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) ) !!} + @endif + @php + do_action( 'woocommerce_after_cart_item_name', $cart_item, $cart_item_key ); + @endphp + {!! wc_get_formatted_cart_item_data( $cart_item ) !!} + @if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) + {!! wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '

    ' . esc_html__( 'Available on backorder', 'woocommerce' ) . '

    ', $product_id ) ) !!} + @endif +

    + + +
    + +
    + {{-- PHPCS: XSS ok. --}} + {!! apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ) !!} x {{ $cart_item['quantity'] }} +
    +
    + {{-- PHPCS: XSS ok. --}} + {!! apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ) !!} +
    +
    +
    +
    + + {{-- PHPCS: XSS ok. --}} + @php + if ( $_product->is_sold_individually() ) { + $product_quantity = sprintf( '1 ', $cart_item_key ); + } else { + $product_quantity = woocommerce_quantity_input( + array( + 'input_name' => "cart[{$cart_item_key}][qty]", + 'input_value' => $cart_item['quantity'], + 'max_value' => $_product->get_max_purchase_quantity(), + 'min_value' => '0', + 'product_name' => $_product->get_name(), + ), + $_product, + false + ); + } + @endphp + {!! apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ) !!} +
    + +
    + {{-- phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --}} + {!! apply_filters('woocommerce_cart_item_remove_link', + sprintf( + ' + Remove + + ', + esc_url( wc_get_cart_remove_url( $cart_item_key ) ), + esc_html__( 'Remove this item', 'woocommerce' ), + esc_attr( $product_id ), + esc_attr( $_product->get_sku() ) + ), + $cart_item_key + ) !!} +
    +
    +
    +
    +
  • + @endif + @endforeach + + @if ( wc_coupons_enabled() ) +
  • + +
    + + +
    + @php do_action( 'woocommerce_cart_coupon' ); @endphp +
  • + @endif + + @php do_action( 'woocommerce_cart_contents' ); @endphp + +
  • +
    + +
    +
    + @php do_action( 'woocommerce_cart_actions' ); @endphp + + @php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); @endphp +
    +
  • + + @php do_action( 'woocommerce_after_cart_contents' ); @endphp +
+ + @php do_action( 'woocommerce_after_cart_table' ); @endphp +
+ + @php do_action( 'woocommerce_before_cart_collaterals' ); @endphp + +
+ {{-- * + * Cart collaterals hook. + * + * @hooked woocommerce_cross_sell_display + * @hooked woocommerce_cart_totals - 10 + --}} + @php + do_action( 'woocommerce_cart_collaterals' ); + @endphp +
+
+ +@php do_action( 'woocommerce_after_cart' ); @endphp \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/cart/mini-cart.blade.php b/themes/apiary/views/woocommerce/cart/mini-cart.blade.php new file mode 100644 index 00000000000..be0f54ea827 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/mini-cart.blade.php @@ -0,0 +1,144 @@ +{{-- + * Mini-cart + * + * Contains the markup for the mini-cart, used by the cart widget. + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/mini-cart.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 5.2.0 +--}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php do_action( 'woocommerce_before_mini_cart' ); @endphp +
+
+

+ {{ __('Cart', 'woocommerce') }} +

+
+ +
+
+
+ @if ( ! WC()->cart->is_empty() ) +
+
    + @php + do_action( 'woocommerce_before_mini_cart_contents' ); + @endphp + + @foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) + @php + $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); + $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); + @endphp + @if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) + @php + $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ); + $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); + $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); + $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); + @endphp +
  • +
    + @if ( empty( $product_permalink ) ) + {!! $thumbnail !!} + @else + + {!! $thumbnail . wp_kses_post( $product_name ) !!} + + @endif +
    +
    +
    +
    +

    + + {{ wp_kses_post( $product_name ) }} + +

    +

    + {!! $product_price !!} +

    +
    +
    + {!! wc_get_formatted_cart_item_data( $cart_item ) !!} +
    +
    +

    + {{ esc_html_e( 'Qty', 'woocommerce' ) }} {!! apply_filters( 'woocommerce_widget_cart_item_quantity', $cart_item['quantity'], $cart_item, $cart_item_key ) !!} +

    + +
    + {!! + apply_filters('woocommerce_cart_item_remove_link', + sprintf( + '%s', + esc_url( wc_get_cart_remove_url( $cart_item_key ) ), + esc_attr__( 'Remove this item', 'woocommerce' ), + esc_attr( $product_id ), + esc_attr( $cart_item_key ), + esc_attr( $_product->get_sku() ), + esc_attr__( 'Remove', 'woocommerce' ), + ), + $cart_item_key + ) + !!} +
    +
    +
    +
    +
  • + @endif + @endforeach + @php + do_action( 'woocommerce_mini_cart_contents' ); + @endphp +
+
+ @else +

{{ esc_html( 'No products in the cart.', 'woocommerce' ) }}

+ @endif +
+
+@if ( ! WC()->cart->is_empty() ) +
+
+

{!! esc_html__( 'Subtotal', 'woocommerce' ) !!}

+

{!! WC()->cart->get_cart_subtotal() !!}

+ {{-- * + * Hook: woocommerce_widget_shopping_cart_total. + * + * @hooked woocommerce_widget_shopping_cart_subtotal - 10 + --}} + @php + do_action( 'woocommerce_widget_shopping_cart_total' ); + @endphp +
+

{{ __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) }}

+ @php do_action( 'woocommerce_widget_shopping_cart_before_buttons' ); @endphp + +
+

+ {{ __('or', 'apiary') }} +

+
+ @php do_action( 'woocommerce_widget_shopping_cart_after_buttons' ); @endphp +
+@endif + +@php do_action( 'woocommerce_after_mini_cart' ); @endphp diff --git a/themes/apiary/views/woocommerce/cart/proceed-to-checkout-button.blade.php b/themes/apiary/views/woocommerce/cart/proceed-to-checkout-button.blade.php new file mode 100644 index 00000000000..3f1707b5edb --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/proceed-to-checkout-button.blade.php @@ -0,0 +1,3 @@ + + {{ __('Proceed to checkout', 'woocommerce' ) }} + diff --git a/themes/apiary/views/woocommerce/cart/shipping-calculator.blade.php b/themes/apiary/views/woocommerce/cart/shipping-calculator.blade.php new file mode 100644 index 00000000000..26c86f0c7d1 --- /dev/null +++ b/themes/apiary/views/woocommerce/cart/shipping-calculator.blade.php @@ -0,0 +1,99 @@ +{{-- * + * Shipping Calculator + * + * This template can be overridden by copying it to yourtheme/woocommerce/cart/shipping-calculator.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 4.0.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +defined( 'ABSPATH' ) || exit; + +do_action( 'woocommerce_before_shipping_calculator' ); @endphp + +
+ + @php printf( '%s', esc_html( ! empty( $button_text ) ? $button_text : __( 'Calculate shipping', 'woocommerce' ) ) ); @endphp + + +
+ +@php do_action( 'woocommerce_after_shipping_calculator' ); @endphp diff --git a/themes/apiary/views/woocommerce/checkout.blade.php b/themes/apiary/views/woocommerce/checkout.blade.php new file mode 100644 index 00000000000..0e1429175e6 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout.blade.php @@ -0,0 +1,29 @@ +@extends('woocommerce.layouts.checkout') + +@section('content') + @loop +
+ {!! Loop::content() !!} + @if(get_edit_post_link()) +
+ @php(edit_post_link( + sprintf( + wp_kses( + /* translators: %s: Name of current post. Only visible to screen readers */ + __('Edit %s', 'apiary'), + [ + 'span' => [ + 'class' => [] + ] + ] + ), + get_the_title() + ), + '', + '' + )) +
+ @endif +
+ @endloop +@endsection diff --git a/themes/apiary/views/woocommerce/checkout/cart-errors.blade.php b/themes/apiary/views/woocommerce/checkout/cart-errors.blade.php new file mode 100644 index 00000000000..31d98e4cf1d --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/cart-errors.blade.php @@ -0,0 +1,27 @@ +{{-- * + * Cart errors page + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/cart-errors.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.5.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +defined( 'ABSPATH' ) || exit; +@endphp + +

@php esc_html_e( 'There are some issues with the items in your cart. Please go back to the cart page and resolve these issues before checking out.', 'woocommerce' ); @endphp

+ +@php do_action( 'woocommerce_cart_has_errors' ); @endphp + +

@php esc_html_e( 'Return to cart', 'woocommerce' ); @endphp

diff --git a/themes/apiary/views/woocommerce/checkout/form-billing.blade.php b/themes/apiary/views/woocommerce/checkout/form-billing.blade.php new file mode 100644 index 00000000000..f21de6f2a95 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-billing.blade.php @@ -0,0 +1,63 @@ +{{-- * + * Checkout billing information form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 + * @global WC_Checkout $checkout + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
+ + @if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) +

@php esc_html_e( 'Billing & Shipping', 'woocommerce' ); @endphp

+ @else +

@php esc_html_e( 'Billing details', 'woocommerce' ); @endphp

+ @endif + + @php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); @endphp + +
+ @php + $fields = $checkout->get_checkout_fields( 'billing' ); + + foreach ( $fields as $key => $field ) { + woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); + } + @endphp +
+ @php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); @endphp +
+ +@if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) +
+ @if ( ! $checkout->is_registration_required() ) + + @endif + + @php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); @endphp + @if ( $checkout->get_checkout_fields( 'account' ) ) + + @endif + + @php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); @endphp +
+ +@endif + diff --git a/themes/apiary/views/woocommerce/checkout/form-checkout.blade.php b/themes/apiary/views/woocommerce/checkout/form-checkout.blade.php new file mode 100644 index 00000000000..879c4471375 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-checkout.blade.php @@ -0,0 +1,77 @@ +{{-- * + * Checkout Form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.5.0 + --}} +{{-- If checkout registration is disabled and not logged in, the user cannot checkout. --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +do_action( 'woocommerce_before_checkout_form', $checkout ); + +if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) { + echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) ); + return; +} + +@endphp + +
+
+ @if ( $checkout->get_checkout_fields() ) +
+ @php do_action( 'woocommerce_checkout_before_customer_details' ); @endphp +
+ @php do_action( 'woocommerce_checkout_billing' ); @endphp + @php do_action( 'woocommerce_checkout_shipping' ); @endphp +
+ @php do_action( 'woocommerce_checkout_after_customer_details' ); @endphp + + @php do_action( 'woocommerce_checkout_before_shipping_methods' ); @endphp + + @if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) +
+ @php do_action( 'woocommerce_review_order_before_shipping' ); @endphp + {!! wc_cart_totals_shipping_html() !!} + @php do_action( 'woocommerce_review_order_after_shipping' ); @endphp +
+ @endif + + @php do_action( 'woocommerce_checkout_after_shipping_methods' ); @endphp + +
+ @endif + + +
+ @php do_action( 'woocommerce_checkout_before_order_review_heading' ); @endphp + +

{{ __( 'Your order', 'woocommerce' ) }}

+ + @php do_action( 'woocommerce_checkout_before_order_review' ); @endphp + +
+ @php do_action( 'woocommerce_checkout_order_review' ); @endphp +
+ @php do_action( 'woocommerce_checkout_after_order_review' ); @endphp +
+
+ +
+ +@php do_action( 'woocommerce_after_checkout_form', $checkout ); @endphp diff --git a/themes/apiary/views/woocommerce/checkout/form-coupon.blade.php b/themes/apiary/views/woocommerce/checkout/form-coupon.blade.php new file mode 100644 index 00000000000..0cb09a17548 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-coupon.blade.php @@ -0,0 +1,28 @@ +{{-- * + * Checkout coupon form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.4.4 + --}} +{{-- @codingStandardsIgnoreLine. --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
+
+
+ +
+ + +
+
+
+
diff --git a/themes/apiary/views/woocommerce/checkout/form-login.blade.php b/themes/apiary/views/woocommerce/checkout/form-login.blade.php new file mode 100644 index 00000000000..7c3bf32dcbe --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-login.blade.php @@ -0,0 +1,43 @@ +{{-- * + * Checkout login form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.8.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +defined( 'ABSPATH' ) || exit; + +if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) { + return; +} + +@endphp + +
+
+

{{ __( 'Returning customer?', 'woocommerce' ) }}

+ +
+
+@php + +woocommerce_login_form( + array( + 'message' => esc_html__( 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'woocommerce' ), + 'redirect' => wc_get_checkout_url(), + 'hidden' => true, + ) +); +@endphp diff --git a/themes/apiary/views/woocommerce/checkout/form-pay.blade.php b/themes/apiary/views/woocommerce/checkout/form-pay.blade.php new file mode 100644 index 00000000000..20fef05cef1 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-pay.blade.php @@ -0,0 +1,124 @@ +{{-- * + * Pay for order form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-pay.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 5.2.0 + --}} +{{-- phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + $totals = $order->get_order_item_totals(); +@endphp +
+ + + + + + + + + + + +@if ( count( $order->get_items() ) > 0 ) + + +@foreach ( $order->get_items() as $item_id => $item ) + + @php + if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { + @endphp +@continue +@php + } + @endphp + + + {{-- @codingStandardsIgnoreLine --}} + + {{-- @codingStandardsIgnoreLine --}} + + + +@endforeach + + +@endif + + + + +@if ( $totals ) + + +@foreach ( $totals as $total ) + + + {{-- @codingStandardsIgnoreLine --}} + + {{-- @codingStandardsIgnoreLine --}} + + + +@endforeach + + +@endif + + +
@php esc_html_e( 'Product', 'woocommerce' ); @endphp@php esc_html_e( 'Qty', 'woocommerce' ); @endphp@php esc_html_e( 'Totals', 'woocommerce' ); @endphp
+ @php + echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); + + do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); + + wc_display_item_meta( $item ); + + do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); + @endphp + {!! apply_filters( 'woocommerce_order_item_quantity_html', ' ' . sprintf( '× %s', esc_html( $item->get_quantity() ) ) . '', $item ) !!}{!! $order->get_formatted_line_subtotal( $item ) !!}
{!! $total['label'] !!}{!! $total['value'] !!}
+ +
+ +@if ( $order->needs_payment() ) + +
    + {{-- @codingStandardsIgnoreLine --}} +@php + if ( ! empty( $available_gateways ) ) { + foreach ( $available_gateways as $gateway ) { + wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) ); + } + } else { + echo '
  • ' . apply_filters( 'woocommerce_no_available_payment_methods_message', esc_html__( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) ) . '
  • '; } + @endphp +
+ +@endif + +
+ + + @php wc_get_template( 'checkout/terms.php' ); @endphp + + @php do_action( 'woocommerce_pay_order_before_submit' ); @endphp + + {{-- @codingStandardsIgnoreLine --}} +{!! apply_filters( 'woocommerce_pay_order_button_html', '' ) !!} + + @php do_action( 'woocommerce_pay_order_after_submit' ); @endphp + + @php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); @endphp +
+
+
diff --git a/themes/apiary/views/woocommerce/checkout/form-shipping.blade.php b/themes/apiary/views/woocommerce/checkout/form-shipping.blade.php new file mode 100644 index 00000000000..d1b220629f6 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/form-shipping.blade.php @@ -0,0 +1,64 @@ +{{-- * + * Checkout shipping information form + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-shipping.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 + * @global WC_Checkout $checkout + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
+ @if ( true === WC()->cart->needs_shipping_address() ) +
+
+ + +
+
+ +
+ @php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); @endphp +
+ @php + $fields = $checkout->get_checkout_fields( 'shipping' ); + @endphp + @foreach ( $fields as $key => $field ) { + {!! woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ) !!} + @endforeach +
+ @php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); @endphp +
+ @endif + +
+
+ @php do_action( 'woocommerce_before_order_notes', $checkout ); @endphp + + @if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) + @if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) +

@php esc_html_e( 'Additional information', 'woocommerce' ); @endphp

+ @endif + +
+ @foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) + {!! woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ) !!} + @endforeach +
+ @endif + + @php do_action( 'woocommerce_after_order_notes', $checkout ); @endphp +
\ No newline at end of file diff --git a/themes/apiary/views/woocommerce/checkout/order-receipt.blade.php b/themes/apiary/views/woocommerce/checkout/order-receipt.blade.php new file mode 100644 index 00000000000..bd642450345 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/order-receipt.blade.php @@ -0,0 +1,52 @@ +{{-- * + * Checkout Order Receipt Template + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/order-receipt.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.2.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} +@endphp + + + +@php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order->get_id() ); @endphp + +
diff --git a/themes/apiary/views/woocommerce/checkout/payment-method.blade.php b/themes/apiary/views/woocommerce/checkout/payment-method.blade.php new file mode 100644 index 00000000000..0d6971ed2fd --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/payment-method.blade.php @@ -0,0 +1,39 @@ +{{-- * + * Output a single payment method + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment-method.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.5.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} +@endphp +
  • +
    + chosen, true ); @endphp data-order_button_text="{!! esc_attr( $gateway->order_button_text ) !!}" /> + +
    + + @if ( $gateway->has_fields() || $gateway->get_description() ) +
    chosen )style="display:none;"@endif> + @php $gateway->payment_fields(); @endphp +
    + @endif + +
  • diff --git a/themes/apiary/views/woocommerce/checkout/payment.blade.php b/themes/apiary/views/woocommerce/checkout/payment.blade.php new file mode 100644 index 00000000000..af548e489b2 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/payment.blade.php @@ -0,0 +1,62 @@ +{{-- * + * Checkout Payment Section + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.5.3 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + if ( ! is_ajax() ) { + do_action( 'woocommerce_review_order_before_payment' ); + } +@endphp +
    +

    {{ __('Payment', 'woocommerce') }}

    + @if ( WC()->cart->needs_payment() ) + + @endif + +
    + + + {!! wc_get_template( 'checkout/terms.php' )!!} + + +
    + @php do_action( 'woocommerce_review_order_before_submit' ); @endphp + {!! apply_filters( 'woocommerce_order_button_html', '' ) !!} + @php do_action( 'woocommerce_review_order_after_submit' ); @endphp +
    + + @php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); @endphp +
    +
    + +@php + if ( ! is_ajax() ) { + do_action( 'woocommerce_review_order_after_payment' ); + } +@endphp diff --git a/themes/apiary/views/woocommerce/checkout/review-order.blade.php b/themes/apiary/views/woocommerce/checkout/review-order.blade.php new file mode 100644 index 00000000000..217023495fa --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/review-order.blade.php @@ -0,0 +1,113 @@ +{{-- * + * Review order table + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 5.2.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + + +defined( 'ABSPATH' ) || exit; +@endphp +
    + + @php + do_action( 'woocommerce_review_order_before_totals' ); + @endphp +
    + +
    +
    {{ __( 'Subtotal', 'woocommerce' ) }}
    +
    @php wc_cart_totals_subtotal_html(); @endphp
    +
    + + @foreach ( WC()->cart->get_coupons() as $code => $coupon ) +
    +
    @php wc_cart_totals_coupon_label( $coupon ); @endphp
    +
    @php wc_cart_totals_coupon_html( $coupon ); @endphp
    +
    + @endforeach + + @foreach ( WC()->cart->get_fees() as $fee ) +
    +
    {{ $fee->name }}
    +
    @php wc_cart_totals_fee_html( $fee ); @endphp
    +
    + @endforeach + + @if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) + @if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) + @foreach ( WC()->cart->get_tax_totals() as $code => $tax ) +
    +
    {{ $tax->label }}
    +
    {!! wp_kses_post( $tax->formatted_amount ) !!}
    +
    + @endforeach + @else +
    +
    {{ WC()->countries->tax_or_vat() }}}
    +
    {!! wc_cart_totals_taxes_total_html() !!}
    +
    + @endif + @endif + + @php do_action( 'woocommerce_review_order_before_order_total' ); @endphp + +
    +
    {{ __( 'Total', 'woocommerce' ) }}
    +
    {!! wc_cart_totals_order_total_html() !!}
    +
    + + @php do_action( 'woocommerce_review_order_after_order_total' ); @endphp + +
    + @php + do_action( 'woocommerce_review_order_after_totals' ); + @endphp +
    diff --git a/themes/apiary/views/woocommerce/checkout/terms.blade.php b/themes/apiary/views/woocommerce/checkout/terms.blade.php new file mode 100644 index 00000000000..ac1491ef42e --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/terms.blade.php @@ -0,0 +1,39 @@ +{{-- * + * Checkout terms and conditions area. + * + * @package WooCommerce\Templates + * @version 3.4.0 + --}} +@if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) ) +@php + do_action( 'woocommerce_checkout_before_terms_and_conditions' ); +@endphp + +
    + {{-- * + * Terms and conditions hook used to inject content. + * + * @since 3.4.0. + * @hooked wc_checkout_privacy_policy_text() Shows custom privacy policy text. Priority 20. + * @hooked wc_terms_and_conditions_page_content() Shows t&c page content. Priority 30. + --}} + @php + do_action( 'woocommerce_checkout_terms_and_conditions' ); + @endphp + + @if ( wc_terms_and_conditions_checkbox_enabled() ) +
    +
    + +
    + + +
    + @endif +
    + @php + do_action( 'woocommerce_checkout_after_terms_and_conditions' ); + @endphp +@endif \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/checkout/thankyou.blade.php b/themes/apiary/views/woocommerce/checkout/thankyou.blade.php new file mode 100644 index 00000000000..0b72e45df96 --- /dev/null +++ b/themes/apiary/views/woocommerce/checkout/thankyou.blade.php @@ -0,0 +1,97 @@ +{{-- * + * Thankyou page + * + * This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.7.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +
    +
    + @if ( $order ) + @php + do_action( 'woocommerce_before_thankyou', $order->get_id() ); + @endphp + + @if ( $order->has_status( 'failed' ) ) +
    +
    +

    + {{ __( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ) }} +

    +
    + +
    + + @else +
    +

    {!! the_title() !!}

    +
    +
    + {!! wp_link_pages([ + 'before' => '', + 'echo' => false + ]) !!} +
    +

    + {!! apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), $order ) !!} +

    + +
      +
    • + @php esc_html_e( 'Order number:', 'woocommerce' ); @endphp + {!! $order->get_order_number() !!} +
    • +
    • + @php esc_html_e( 'Date:', 'woocommerce' ); @endphp + {!! wc_format_datetime( $order->get_date_created() ) !!} +
    • + @if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) + + @endif +
    • + @php esc_html_e( 'Total:', 'woocommerce' ); @endphp + {!! $order->get_formatted_order_total() !!} +
    • + @if ( $order->get_payment_method_title() ) +
    • + @php esc_html_e( 'Payment method:', 'woocommerce' ); @endphp + {!! wp_kses_post( $order->get_payment_method_title() ) !!} +
    • + @endif +
    + @endif + +
    + @php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); @endphp +
    + @php do_action( 'woocommerce_thankyou', $order->get_id() ); @endphp + + @else +

    + {!! apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ) !!} +

    + @endif +
    +
    diff --git a/themes/apiary/views/woocommerce/content-product.blade.php b/themes/apiary/views/woocommerce/content-product.blade.php new file mode 100644 index 00000000000..4d01d23eed1 --- /dev/null +++ b/themes/apiary/views/woocommerce/content-product.blade.php @@ -0,0 +1,73 @@ +{{-- * + * The template for displaying product content within loops + * + * This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 + --}} +{{-- Ensure visibility. --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + defined( 'ABSPATH' ) || exit; + + global $product; + + if ( empty( $product ) || ! $product->is_visible() ) { + return; + } +@endphp +
  • +
    + {{-- * + * Hook: woocommerce_after_shop_loop_item. + * + * @hooked woocommerce_template_loop_product_link_close - 5 + * @hooked woocommerce_template_loop_add_to_cart - 10 + --}} + {{-- * + * Hook: woocommerce_after_shop_loop_item_title. + * + * @hooked woocommerce_template_loop_rating - 5 + * @hooked woocommerce_template_loop_price - 10 + --}} + {{-- * + * Hook: woocommerce_shop_loop_item_title. + * + * @hooked woocommerce_template_loop_product_title - 10 + --}} + {{-- * + * Hook: woocommerce_before_shop_loop_item_title. + * + * @hooked woocommerce_show_product_loop_sale_flash - 10 + * @hooked woocommerce_template_loop_product_thumbnail - 10 + --}} + {{-- * + * Hook: woocommerce_before_shop_loop_item. + * + * @hooked woocommerce_template_loop_product_link_open - 10 + --}} + @php + do_action( 'woocommerce_before_shop_loop_item' ); + do_action( 'woocommerce_before_shop_loop_item_title' ); + @endphp +
    +
    + @php + do_action( 'woocommerce_shop_loop_item_title' ); + do_action( 'woocommerce_after_shop_loop_item_title' ); + @endphp +
    +
    + @php + do_action( 'woocommerce_after_shop_loop_item' ); + @endphp +
    +
  • diff --git a/themes/apiary/views/woocommerce/content-single-product.blade.php b/themes/apiary/views/woocommerce/content-single-product.blade.php new file mode 100644 index 00000000000..e579913147a --- /dev/null +++ b/themes/apiary/views/woocommerce/content-single-product.blade.php @@ -0,0 +1,61 @@ +{{-- + * Hook: woocommerce_before_single_product. + * + * @hooked woocommerce_output_all_notices - 10 +--}} +@php + global $product; + + do_action( 'woocommerce_before_single_product' ); + + if ( post_password_required() ) { + echo get_the_password_form(); return; + } +@endphp + + +
    +
    + {{-- + * Hook: woocommerce_before_single_product_summary. + * + * @hooked woocommerce_show_product_sale_flash - 10 + * @hooked woocommerce_show_product_images - 20 + --}} + @php + do_action( 'woocommerce_before_single_product_summary' ); + @endphp + +
    + {{-- + * Hook: woocommerce_single_product_summary. + * + * @hooked woocommerce_template_single_title - 5 + * @hooked woocommerce_template_single_rating - 10 + * @hooked woocommerce_template_single_price - 10 + * @hooked woocommerce_template_single_excerpt - 20 + * @hooked woocommerce_template_single_add_to_cart - 30 + * @hooked woocommerce_template_single_meta - 40 + * @hooked woocommerce_template_single_sharing - 50 + * @hooked WC_Structured_Data::generate_product_data() - 60 + --}} + @php + do_action( 'woocommerce_single_product_summary' ); + @endphp +
    + {{-- + * Hook: woocommerce_after_single_product_summary. + * + * @hooked woocommerce_output_product_data_tabs - 10 + * @hooked woocommerce_upsell_display - 15 + * @hooked woocommerce_output_related_products - 20 + --}} + @php + do_action( 'woocommerce_after_single_product_summary' ); + @endphp +
    + + +
    + +@php do_action( 'woocommerce_after_single_product' ); @endphp \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/global/breadcrumb.blade.php b/themes/apiary/views/woocommerce/global/breadcrumb.blade.php new file mode 100644 index 00000000000..00523c5c505 --- /dev/null +++ b/themes/apiary/views/woocommerce/global/breadcrumb.blade.php @@ -0,0 +1,27 @@ +
    + +
    \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/global/form-login.blade.php b/themes/apiary/views/woocommerce/global/form-login.blade.php new file mode 100644 index 00000000000..a3e442c7f9a --- /dev/null +++ b/themes/apiary/views/woocommerce/global/form-login.blade.php @@ -0,0 +1,120 @@ +{{-- * + * Login form + * + * This template can be overridden by copying it to yourtheme/woocommerce/global/form-login.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 3.6.0 + --}} +{{-- Exit if accessed directly. --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@php + if ( is_user_logged_in() ) { + return; + } +@endphp + +
    +
    + + + + + +
    + +
    + +
    +
    \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/global/quantity-input.blade.php b/themes/apiary/views/woocommerce/global/quantity-input.blade.php new file mode 100644 index 00000000000..6298deb9d38 --- /dev/null +++ b/themes/apiary/views/woocommerce/global/quantity-input.blade.php @@ -0,0 +1,44 @@ +{{-- + * Product quantity inputs + * + * This template can be overridden by copying it to yourtheme/woocommerce/global/quantity-input.php. + * + * HOWEVER, on occasion WooCommerce will need to update template files and you + * (the theme developer) will need to copy the new files to your theme to + * maintain compatibility. We try to do this as little as possible, but it does + * happen. When this occurs the version of the template file will be bumped and + * the readme will list any important changes. + * + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 4.0.0 + --}} +{{-- docs.woocommerce.com/document/template-structure/ --}} +@if ( $max_value && $min_value === $max_value ) + + {{-- translators: %s: Quantity. --}} +@else + @php + $label = ! empty( $args['product_name'] ) ? sprintf( esc_html__( '%s quantity', 'woocommerce' ), wp_strip_all_tags( $args['product_name'] ) ) : esc_html__( 'Quantity', 'woocommerce' ); + @endphp +
    + @php do_action( 'woocommerce_before_quantity_input_field' ); @endphp + + + @php do_action( 'woocommerce_after_quantity_input_field' ); @endphp +
    +@endif diff --git a/themes/apiary/views/woocommerce/global/rating-stars.blade.php b/themes/apiary/views/woocommerce/global/rating-stars.blade.php new file mode 100644 index 00000000000..1606ee29e27 --- /dev/null +++ b/themes/apiary/views/woocommerce/global/rating-stars.blade.php @@ -0,0 +1,15 @@ +@if (0 < $rating) +
    + @for($i=1;$i<=5;$i++) + @if ($rating >= $i) + + @else + + @endif + @endfor +
    +@endif \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/layouts/checkout.blade.php b/themes/apiary/views/woocommerce/layouts/checkout.blade.php new file mode 100644 index 00000000000..60d36518962 --- /dev/null +++ b/themes/apiary/views/woocommerce/layouts/checkout.blade.php @@ -0,0 +1,23 @@ + + + + + + + @head + + +
    + @include('woocommerce.parts.header.header-checkout') +
    +
    +
    + @yield('content') +
    +
    +
    + @include('woocommerce.parts.footer.footer-checkout') +
    + @footer + + diff --git a/themes/apiary/views/woocommerce/loop/add-to-cart.blade.php b/themes/apiary/views/woocommerce/loop/add-to-cart.blade.php new file mode 100644 index 00000000000..8003ad7a3fb --- /dev/null +++ b/themes/apiary/views/woocommerce/loop/add-to-cart.blade.php @@ -0,0 +1,18 @@ +@php + global $product; + $args['class'] .= ' relative flex bg-gray-100 border border-transparent rounded-md py-2 px-8 items-center justify-center text-sm font-medium text-gray-900 hover:bg-gray-200'; +@endphp + +{!! apply_filters( + 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok. + sprintf( + '%s', + esc_url( $product->add_to_cart_url() ), + esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ), + esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ), + isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '', + esc_html( $product->add_to_cart_text() ) + ), + $product, + $args +) !!} \ No newline at end of file diff --git a/themes/apiary/views/woocommerce/loop/loop-start.blade.php b/themes/apiary/views/woocommerce/loop/loop-start.blade.php new file mode 100644 index 00000000000..443bb4ba8a7 --- /dev/null +++ b/themes/apiary/views/woocommerce/loop/loop-start.blade.php @@ -0,0 +1,23 @@ + +