Changeset 3315238
- Timestamp:
- 06/20/2025 12:24:34 PM (8 months ago)
- Location:
- doko-box-builder
- Files:
-
- 314 added
- 23 edited
-
tags/1.9 (added)
-
tags/1.9/.gitattributes (added)
-
tags/1.9/LICENSE.txt (added)
-
tags/1.9/README.txt (added)
-
tags/1.9/admin (added)
-
tags/1.9/admin/class-hs-doko-admin.php (added)
-
tags/1.9/admin/css (added)
-
tags/1.9/admin/css/core.css (added)
-
tags/1.9/admin/css/doko-select2.css (added)
-
tags/1.9/admin/css/hs-doko-admin.css (added)
-
tags/1.9/admin/css/images (added)
-
tags/1.9/admin/css/images/red-icons.png (added)
-
tags/1.9/admin/css/isolated-block-editor.css (added)
-
tags/1.9/admin/img (added)
-
tags/1.9/admin/img/card-step.png (added)
-
tags/1.9/admin/img/choose-products-with-cart.png (added)
-
tags/1.9/admin/img/choose-products.png (added)
-
tags/1.9/admin/img/products-with-cart.png (added)
-
tags/1.9/admin/img/products.png (added)
-
tags/1.9/admin/index.php (added)
-
tags/1.9/admin/js (added)
-
tags/1.9/admin/js/hs-doko-admin.js (added)
-
tags/1.9/admin/js/hs-doko-bg-admin.js (added)
-
tags/1.9/admin/js/hs-doko-blockUI.js (added)
-
tags/1.9/admin/js/hs-doko-bundle.js (added)
-
tags/1.9/admin/js/hs-doko-rules.js (added)
-
tags/1.9/admin/js/hs-doko-select2.js (added)
-
tags/1.9/admin/js/hs-doko-serializejson.js (added)
-
tags/1.9/admin/js/isolated-block-editor.js (added)
-
tags/1.9/core (added)
-
tags/1.9/core/class-hs-doko-activator.php (added)
-
tags/1.9/core/class-hs-doko-deactivator.php (added)
-
tags/1.9/core/class-hs-doko-i18n.php (added)
-
tags/1.9/core/class-hs-doko-loader.php (added)
-
tags/1.9/core/class-hs-doko-utils.php (added)
-
tags/1.9/core/class-hs-doko.php (added)
-
tags/1.9/core/homescriptone-formulus.php (added)
-
tags/1.9/core/index.php (added)
-
tags/1.9/core/premium-loading.php (added)
-
tags/1.9/core/vendor (added)
-
tags/1.9/core/vendor/freemius (added)
-
tags/1.9/core/vendor/freemius/LICENSE.txt (added)
-
tags/1.9/core/vendor/freemius/assets (added)
-
tags/1.9/core/vendor/freemius/assets/css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/account.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/add-ons.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/affiliation.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/checkout.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/clone-resolution.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/common.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/connect.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/debug.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/dialog-boxes.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/gdpr-optin-notice.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/index.php (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/optout.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/admin/plugins.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/customizer.css (added)
-
tags/1.9/core/vendor/freemius/assets/css/index.php (added)
-
tags/1.9/core/vendor/freemius/assets/img (added)
-
tags/1.9/core/vendor/freemius/assets/img/doko-builder-discounts.png (added)
-
tags/1.9/core/vendor/freemius/assets/img/index.php (added)
-
tags/1.9/core/vendor/freemius/assets/img/plugin-icon.png (added)
-
tags/1.9/core/vendor/freemius/assets/img/theme-icon.png (added)
-
tags/1.9/core/vendor/freemius/assets/index.php (added)
-
tags/1.9/core/vendor/freemius/assets/js (added)
-
tags/1.9/core/vendor/freemius/assets/js/index.php (added)
-
tags/1.9/core/vendor/freemius/assets/js/jquery.form.js (added)
-
tags/1.9/core/vendor/freemius/assets/js/nojquery.ba-postmessage.js (added)
-
tags/1.9/core/vendor/freemius/assets/js/postmessage.js (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/14fb1bd5b7c41648488b06147f50a0dc.svg (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/178afa6030e76635dbe835e111d2c507.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/27b5a722a5553d9de0170325267fccec.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/4375c4a3ddc6f637c2ab9a2d7220f91e.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/4529cac82a2d1f300d3c4702b7b5e8f3.svg (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/5480ed23b199531a8cbc05924f26952b.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/b4f3b958f4a019862d81b15f3f8eee3a.svg (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/c03f665db27af43971565560adfba594.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/cb5fc4f6ec7ada72e986f6e7dde365bf.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/dd89563360f0272635c8f0ab7d7f1402.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/e366d70661d8ad2493bd6afbd779f125.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/f18006f6535a1a6e9c6bfbffafe6f18a.svg (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/f3aac72a8e63997d6bb888f816457e9b.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/f928f1be99776af83e8e6be4baf8ffe7.svg (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/fde48e4609a6ddc11d639fc2421f2afd.png (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/freemius-pricing.js (added)
-
tags/1.9/core/vendor/freemius/assets/js/pricing/freemius-pricing.js.LICENSE.txt (added)
-
tags/1.9/core/vendor/freemius/config.php (added)
-
tags/1.9/core/vendor/freemius/includes (added)
-
tags/1.9/core/vendor/freemius/includes/class-freemius-abstract.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-freemius.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-admin-notices.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-api.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-garbage-collector.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-lock.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-logger.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-options.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-plugin-updater.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-security.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-storage.php (added)
-
tags/1.9/core/vendor/freemius/includes/class-fs-user-lock.php (added)
-
tags/1.9/core/vendor/freemius/includes/customizer (added)
-
tags/1.9/core/vendor/freemius/includes/customizer/class-fs-customizer-support-section.php (added)
-
tags/1.9/core/vendor/freemius/includes/customizer/class-fs-customizer-upsell-control.php (added)
-
tags/1.9/core/vendor/freemius/includes/customizer/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/debug (added)
-
tags/1.9/core/vendor/freemius/includes/debug/class-fs-debug-bar-panel.php (added)
-
tags/1.9/core/vendor/freemius/includes/debug/debug-bar-start.php (added)
-
tags/1.9/core/vendor/freemius/includes/debug/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-affiliate-terms.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-affiliate.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-billing.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-entity.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-payment.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-plugin-info.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-plugin-license.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-plugin-plan.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-plugin-tag.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-plugin.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-pricing.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-scope-entity.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-site.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-subscription.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/class-fs-user.php (added)
-
tags/1.9/core/vendor/freemius/includes/entities/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/fs-core-functions.php (added)
-
tags/1.9/core/vendor/freemius/includes/fs-essential-functions.php (added)
-
tags/1.9/core/vendor/freemius/includes/fs-html-escaping-functions.php (added)
-
tags/1.9/core/vendor/freemius/includes/fs-plugin-info-dialog.php (added)
-
tags/1.9/core/vendor/freemius/includes/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/l10n.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-admin-menu-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-admin-notice-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-cache-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-checkout-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-clone-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-contact-form-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-debug-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-gdpr-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-key-value-storage.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-license-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-option-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-permission-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-plan-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/class-fs-plugin-manager.php (added)
-
tags/1.9/core/vendor/freemius/includes/managers/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/ArgumentNotExistException.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/EmptyArgumentException.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/Exception.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/InvalidArgumentException.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/OAuthException.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/Exceptions/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/FreemiusBase.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/FreemiusWordPress.php (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/LICENSE.txt (added)
-
tags/1.9/core/vendor/freemius/includes/sdk/index.php (added)
-
tags/1.9/core/vendor/freemius/includes/supplements (added)
-
tags/1.9/core/vendor/freemius/includes/supplements/fs-essential-functions-1.1.7.1.php (added)
-
tags/1.9/core/vendor/freemius/includes/supplements/fs-essential-functions-2.2.1.php (added)
-
tags/1.9/core/vendor/freemius/includes/supplements/fs-migration-2.5.1.php (added)
-
tags/1.9/core/vendor/freemius/includes/supplements/index.php (added)
-
tags/1.9/core/vendor/freemius/index.php (added)
-
tags/1.9/core/vendor/freemius/languages (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-cs_CZ.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-da_DK.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-de_DE.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-es_ES.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-fr_FR.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-he_IL.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-hu_HU.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-it_IT.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-ja.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-nl_NL.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-ru_RU.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-ta.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius-zh_CN.mo (added)
-
tags/1.9/core/vendor/freemius/languages/freemius.pot (added)
-
tags/1.9/core/vendor/freemius/languages/index.php (added)
-
tags/1.9/core/vendor/freemius/require.php (added)
-
tags/1.9/core/vendor/freemius/start.php (added)
-
tags/1.9/core/vendor/freemius/templates (added)
-
tags/1.9/core/vendor/freemius/templates/account (added)
-
tags/1.9/core/vendor/freemius/templates/account.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/billing.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/activate-license-button.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/addon.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/deactivate-license-button.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/disconnect-button.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/partials/site.php (added)
-
tags/1.9/core/vendor/freemius/templates/account/payments.php (added)
-
tags/1.9/core/vendor/freemius/templates/add-ons.php (added)
-
tags/1.9/core/vendor/freemius/templates/add-trial-to-pricing.php (added)
-
tags/1.9/core/vendor/freemius/templates/admin-notice.php (added)
-
tags/1.9/core/vendor/freemius/templates/ajax-loader.php (added)
-
tags/1.9/core/vendor/freemius/templates/api-connectivity-message-js.php (added)
-
tags/1.9/core/vendor/freemius/templates/auto-installation.php (added)
-
tags/1.9/core/vendor/freemius/templates/checkout (added)
-
tags/1.9/core/vendor/freemius/templates/checkout.php (added)
-
tags/1.9/core/vendor/freemius/templates/checkout/frame.php (added)
-
tags/1.9/core/vendor/freemius/templates/checkout/process-redirect.php (added)
-
tags/1.9/core/vendor/freemius/templates/checkout/redirect.php (added)
-
tags/1.9/core/vendor/freemius/templates/clone-resolution-js.php (added)
-
tags/1.9/core/vendor/freemius/templates/connect (added)
-
tags/1.9/core/vendor/freemius/templates/connect.php (added)
-
tags/1.9/core/vendor/freemius/templates/connect/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/connect/permission.php (added)
-
tags/1.9/core/vendor/freemius/templates/connect/permissions-group.php (added)
-
tags/1.9/core/vendor/freemius/templates/contact.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug (added)
-
tags/1.9/core/vendor/freemius/templates/debug.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug/api-calls.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug/logger.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug/plugins-themes-sync.php (added)
-
tags/1.9/core/vendor/freemius/templates/debug/scheduled-crons.php (added)
-
tags/1.9/core/vendor/freemius/templates/email.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms (added)
-
tags/1.9/core/vendor/freemius/templates/forms/affiliation.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/data-debug-mode.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/deactivation (added)
-
tags/1.9/core/vendor/freemius/templates/forms/deactivation/contact.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/deactivation/form.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/deactivation/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/deactivation/retry-skip.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/email-address-update.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/license-activation.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/optout.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/premium-versions-upgrade-handler.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/premium-versions-upgrade-metadata.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/resend-key.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/subscription-cancellation.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/trial-start.php (added)
-
tags/1.9/core/vendor/freemius/templates/forms/user-change.php (added)
-
tags/1.9/core/vendor/freemius/templates/gdpr-optin-js.php (added)
-
tags/1.9/core/vendor/freemius/templates/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/js (added)
-
tags/1.9/core/vendor/freemius/templates/js/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/js/jquery.content-change.php (added)
-
tags/1.9/core/vendor/freemius/templates/js/open-license-activation.php (added)
-
tags/1.9/core/vendor/freemius/templates/js/permissions.php (added)
-
tags/1.9/core/vendor/freemius/templates/js/style-premium-theme.php (added)
-
tags/1.9/core/vendor/freemius/templates/partials (added)
-
tags/1.9/core/vendor/freemius/templates/partials/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/partials/network-activation.php (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-icon.php (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-info (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-info/description.php (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-info/features.php (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-info/index.php (added)
-
tags/1.9/core/vendor/freemius/templates/plugin-info/screenshots.php (added)
-
tags/1.9/core/vendor/freemius/templates/pricing.php (added)
-
tags/1.9/core/vendor/freemius/templates/secure-https-header.php (added)
-
tags/1.9/core/vendor/freemius/templates/sticky-admin-notice-js.php (added)
-
tags/1.9/core/vendor/freemius/templates/tabs-capture-js.php (added)
-
tags/1.9/core/vendor/freemius/templates/tabs.php (added)
-
tags/1.9/hs-doko.php (added)
-
tags/1.9/index.php (added)
-
tags/1.9/languages (added)
-
tags/1.9/languages/doko-en_US.l10n.php (added)
-
tags/1.9/languages/doko-en_US.mo (added)
-
tags/1.9/languages/doko-en_US.po (added)
-
tags/1.9/languages/doko-fr_FR.mo (added)
-
tags/1.9/languages/doko-fr_FR.po (added)
-
tags/1.9/languages/doko.pot (added)
-
tags/1.9/languages/index.php (added)
-
tags/1.9/public (added)
-
tags/1.9/public/class-hs-doko-public.php (added)
-
tags/1.9/public/css (added)
-
tags/1.9/public/css/all.min.css (added)
-
tags/1.9/public/css/fontawesome.min.css (added)
-
tags/1.9/public/css/hs-doko-card.css (added)
-
tags/1.9/public/css/hs-doko-modal.css (added)
-
tags/1.9/public/css/hs-doko-public.css (added)
-
tags/1.9/public/css/hs-doko-snackbar.css (added)
-
tags/1.9/public/index.php (added)
-
tags/1.9/public/js (added)
-
tags/1.9/public/js/fontawesome.min.js (added)
-
tags/1.9/public/js/hs-doko-modal-min.js (added)
-
tags/1.9/public/js/hs-doko-modal.js (added)
-
tags/1.9/public/js/hs-doko-public-min.js (added)
-
tags/1.9/public/js/hs-doko-public.js (added)
-
tags/1.9/public/js/hs-doko-snackbar-min.js (added)
-
tags/1.9/public/js/hs-doko-snackbar.js (added)
-
tags/1.9/public/js/hs-doko-utils-min.js (added)
-
tags/1.9/public/js/hs-doko-utils.js (added)
-
tags/1.9/public/webfonts (added)
-
tags/1.9/public/webfonts/fa-brands-400.ttf (added)
-
tags/1.9/public/webfonts/fa-brands-400.woff2 (added)
-
tags/1.9/public/webfonts/fa-regular-400.ttf (added)
-
tags/1.9/public/webfonts/fa-regular-400.woff2 (added)
-
tags/1.9/public/webfonts/fa-solid-900.ttf (added)
-
tags/1.9/public/webfonts/fa-solid-900.woff2 (added)
-
tags/1.9/public/webfonts/fa-v4compatibility.ttf (added)
-
tags/1.9/public/webfonts/fa-v4compatibility.woff2 (added)
-
tags/1.9/templates (added)
-
tags/1.9/templates/bundle (added)
-
tags/1.9/templates/loop (added)
-
tags/1.9/templates/loop/loop-end.php (added)
-
tags/1.9/templates/loop/loop-start.php (added)
-
tags/1.9/templates/single-product (added)
-
tags/1.9/templates/single-product/doko-products.php (added)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/admin/class-hs-doko-admin.php (modified) (32 diffs)
-
trunk/admin/css/doko-select2.css (modified) (1 diff)
-
trunk/admin/js/hs-doko-admin.js (modified) (3 diffs)
-
trunk/admin/js/hs-doko-bg-admin.js (modified) (1 diff)
-
trunk/admin/js/hs-doko-bundle.js (added)
-
trunk/admin/js/hs-doko-rules.js (added)
-
trunk/core/class-hs-doko-activator.php (modified) (1 diff)
-
trunk/core/class-hs-doko-deactivator.php (modified) (1 diff)
-
trunk/core/class-hs-doko-i18n.php (modified) (1 diff)
-
trunk/core/class-hs-doko-loader.php (modified) (1 diff)
-
trunk/core/class-hs-doko-utils.php (modified) (6 diffs)
-
trunk/core/class-hs-doko.php (modified) (4 diffs)
-
trunk/core/homescriptone-formulus.php (modified) (9 diffs)
-
trunk/core/premium-loading.php (modified) (1 diff)
-
trunk/core/vendor/freemius/assets/img/doko-builder-discounts.png (added)
-
trunk/hs-doko.php (modified) (5 diffs)
-
trunk/languages/doko-en_US.l10n.php (modified) (1 diff)
-
trunk/public/class-hs-doko-public.php (modified) (33 diffs)
-
trunk/public/css/hs-doko-modal.css (modified) (2 diffs)
-
trunk/public/css/hs-doko-public.css (modified) (9 diffs)
-
trunk/public/js/hs-doko-public-min.js (modified) (1 diff)
-
trunk/public/js/hs-doko-public.js (modified) (21 diffs)
-
trunk/public/js/hs-doko-utils-min.js (modified) (1 diff)
-
trunk/public/js/hs-doko-utils.js (modified) (10 diffs)
-
trunk/templates/single-product/doko-products.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doko-box-builder/trunk/README.txt
r3230317 r3315238 1 === Doko Builder : The Ultimate dynamic bundle builder for WooCommerce ===1 === Doko Bundle Builder : The Ultimate dynamic bundle builder for WooCommerce === 2 2 Contributors: homescript, freemius 3 3 Donate link: https://www.buymeacoffee.com/homescriptone 4 4 Tags: woocommerce bundles, bundle pricing, fast checkout, cart, woocommerce sales 5 5 Requires at least: 4.4 6 Requires PHP : 7.47 Tested up to: 6. 78 Stable tag: 1. 86 Requires PHP : 8.0 7 Tested up to: 6.8 8 Stable tag: 1.9 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 Requires Plugins: woocommerce 12 12 13 Boost sales with our bundle builder, allowing WooCommerce customers to create personalized bundles. Enjoy accurate pricing, increased average order value, and enticingdiscounts.13 Enable bundle building in WooCommerce. Increase sales and order value with accurate pricing and smart discounts. 14 14 15 15 == Description == 16 16 17 [Doko Builder for WooCommerce](https://ultiwp.com/plugins/doko) is an easy bundle builder plugin for your WooCommerce store. It allows you to create bundle pages using your unsold products from various categories. On these pages, customers can choose and combine the products they want to buy in their preferred way.17 [Doko Bundle Builder for WooCommerce](https://ultiwp.com/plugins/doko) is an easy bundle builder plugin for your WooCommerce store. It allows you to create bundle pages using your unsold products from various categories. On these pages, customers can choose and combine the products they want to buy in their preferred way. 18 18 19 19 https://youtu.be/0CKWYVGPcAI?si=j0N1gZQQ1egWhwVU 20 20 21 21 Would you like to see the plugin in action before installing it? 22 We have a [Doko Builder for WooCommerce demo website](https://demos.homescriptone.com/doko/our-demos/) showcasing all of the use case of the plugin!22 We have a [Doko Bundle Builder for WooCommerce demo website](https://demos.homescriptone.com/doko/our-demos/) showcasing all of the use case of the plugin! 23 23 24 24 = Features = 25 An overview of Doko Builder for WooCommerce features:25 An overview of Doko Bundle Builder for WooCommerce features: 26 26 * Compatible with both the Classic Editor and new **Gutenberg** editor, 27 27 * Easy workflow to transform any post or page into a bundle builder page, … … 52 52 53 53 <h4>Documentation</h4> 54 <p>Find how to configure Doko Builder <a href="https://docs.homescriptone.com/wordpress-plugins/doko-builder-the-ultimate-dynamic-bundle-builder-for-woocommerce?utm_source=wordpress" rel="follow">here</a></p>54 <p>Find how to configure Doko Bundle Builder <a href="https://docs.homescriptone.com/wordpress-plugins/doko-builder-the-ultimate-dynamic-bundle-builder-for-woocommerce?utm_source=wordpress" rel="follow">here</a></p> 55 55 56 56 57 57 <h4>Translation</h4> 58 You can <a href="https://translate.wordpress.org/projects/wp-plugins/doko-box-builder/" rel="nofollow ugc">translate Doko Builder</a> on <a href="https://translate.wordpress.org/projects/wp-plugins/doko-box-builder/" rel="nofollow ugc">translate.wordpress.org</a>.58 You can <a href="https://translate.wordpress.org/projects/wp-plugins/doko-box-builder/" rel="nofollow ugc">translate Doko Bundle Builder</a> on <a href="https://translate.wordpress.org/projects/wp-plugins/doko-box-builder/" rel="nofollow ugc">translate.wordpress.org</a>. 59 59 60 60 <h4>Installation </h4> 61 61 = Automatic installation = 62 62 63 Automatic installation is the easiest option -- WordPress will handles the file transfer, and you won’t need to leave your web browser. To do an automatic install of Doko Builder, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.”63 Automatic installation is the easiest option -- WordPress will handles the file transfer, and you won’t need to leave your web browser. To do an automatic install of Doko Bundle Builder, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.” 64 64 65 In the search field type “Doko Builder” then click “Search Plugins.” Once you’ve found us, you can view details about it such as the point release, rating, and description. Most importantly of course, you can install it by! Click “Install Now,” and WordPress will take it from there.65 In the search field type “Doko Bundle Builder” then click “Search Plugins.” Once you’ve found us, you can view details about it such as the point release, rating, and description. Most importantly of course, you can install it by! Click “Install Now,” and WordPress will take it from there. 66 66 67 67 = Manual installation = 68 68 69 Manual installation method requires downloading the Doko Builder plugin and uploading it to your web server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](https://wordpress.org/support/article/managing-plugins/#manual-plugin-installation).69 Manual installation method requires downloading the Doko Bundle Builder plugin and uploading it to your web server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](https://wordpress.org/support/article/managing-plugins/#manual-plugin-installation). 70 70 71 71 … … 80 80 81 81 = Where can I find a demo and some more documentation? = 82 Check out the [Doko Builder demo collections website](https://demos.homescriptone.com/doko/our-demos/) and [DokoBuilder documentation](https://docs.homescriptone.com/wordpress-plugins/doko-builder-the-ultimate-dynamic-bundle-builder-for-woocommerce) for more information on all of the features!82 Check out the [Doko Bundle Builder demo collections website](https://demos.homescriptone.com/doko/our-demos/) and [Doko Bundle Builder documentation](https://docs.homescriptone.com/wordpress-plugins/doko-builder-the-ultimate-dynamic-bundle-builder-for-woocommerce) for more information on all of the features! 83 83 84 84 = Do you offer any support? = … … 86 86 87 87 == Changelog == 88 <h4> 1.9 - 4 April 2025 </h4> 89 <ul> 90 <li> Include a modal describing the total showned in navigation bar,</li> 91 <li> Add new filters for discounts add-on.</li> 92 <li> Display variation correct name in list.</li> 93 <li> Fix issue variation product in bundle page,</li> 94 <li> Show/Hide hidden products in bundle page.</li> 95 <li> Improve the modal of product description.</li> 96 <li> Include custom product type in product bundle loop.</li> 97 <li> Fix issue with variation not display properly,</li> 98 <li> Add more details for description modal.</li> 99 <li> Fix issue with conditional rules not running.</li> 100 </ul> 88 101 <h4> 1.8 - 22 January 2025 </h4> 89 102 <ul> -
doko-box-builder/trunk/admin/class-hs-doko-admin.php
r3230317 r3315238 104 104 if ( in_array( $post_type, $allowed_slugs['post_type'], true ) || in_array( $parent_file, $allowed_slugs['page'], true ) ) { 105 105 wp_enqueue_style( 106 ' select2',106 'doko-select2', 107 107 plugin_dir_url( __FILE__ ) . 'css/doko-select2.css', 108 108 array(), … … 118 118 ); 119 119 wp_enqueue_style( 'jquery-ui' ); 120 wp_enqueue_style( ' select2' );120 wp_enqueue_style( 'doko-select2' ); 121 121 wp_enqueue_style( 122 122 'hs-corecss', … … 156 156 $allowed_slugs = hs_dk_get_allowed_slug(); 157 157 if ( in_array( $post_type, $allowed_slugs['post_type'], true ) || in_array( $parent_file, $allowed_slugs['page'], true ) ) { 158 wp_enqueue_script( 159 'hs-select2', 160 plugin_dir_url( __FILE__ ) . 'js/hs-doko-select2.js', 161 array('jquery'), 162 $this->version, 163 false 164 ); 158 165 wp_enqueue_script( 159 166 'hs-blockUI-js', … … 189 196 $asset_lists = array( 190 197 'jquery', 191 'select2', 198 'hs-select2', 199 // 'select2', 192 200 'jquery-ui-core', 193 201 'jquery-ui-accordion', … … 195 203 'jquery-ui-widget', 196 204 'wp-hooks', 197 'jquery-tiptip' 205 'jquery-tiptip', 198 206 ); 199 207 wp_enqueue_script( … … 204 212 false 205 213 ); 206 wp_enqueue_script( 207 $this->plugin_name . '-bg-admin', 208 plugin_dir_url( __FILE__ ) . 'js/hs-doko-bg-admin.js', 209 $asset_lists, 210 $this->version, 211 false 212 ); 213 // include codemirror 214 $cm_settings = array(); 215 $cm_settings['codeEditor'] = wp_enqueue_code_editor( array( 216 'type' => 'text/css', 217 ) ); 218 wp_localize_script( 'jquery', 'cm_settings', $cm_settings ); 219 wp_enqueue_script( 'wp-theme-plugin-editor' ); 220 wp_enqueue_style( 'wp-codemirror' ); 221 wp_register_style( 222 'woocommerce_admin_styles', 223 WC()->plugin_url() . '/assets/css/admin.css', 224 array(), 225 $this->version 226 ); 227 wp_enqueue_style( 'woocommerce_admin_styles' ); 228 wp_enqueue_style( 'jquery-ui-style' ); 214 if ( 'doko-bundles' == $post_type ) { 215 wp_enqueue_script( 216 $this->plugin_name . '-bundle', 217 plugin_dir_url( __FILE__ ) . 'js/hs-doko-bundle.js', 218 $asset_lists, 219 $this->version, 220 false 221 ); 222 wp_enqueue_script( 223 $this->plugin_name . '-bg-admin', 224 plugin_dir_url( __FILE__ ) . 'js/hs-doko-bg-admin.js', 225 $asset_lists, 226 $this->version, 227 false 228 ); 229 // include codemirror 230 $cm_settings = array(); 231 $cm_settings['codeEditor'] = wp_enqueue_code_editor( array( 232 'type' => 'text/css', 233 ) ); 234 wp_localize_script( 'jquery', 'cm_settings', $cm_settings ); 235 wp_enqueue_script( 'wp-theme-plugin-editor' ); 236 wp_enqueue_style( 'wp-codemirror' ); 237 wp_register_style( 238 'woocommerce_admin_styles', 239 WC()->plugin_url() . '/assets/css/admin.css', 240 array(), 241 $this->version 242 ); 243 wp_enqueue_style( 'woocommerce_admin_styles' ); 244 wp_enqueue_style( 'jquery-ui-style' ); 245 } 246 if ( 'doko-bundles-rules' == $post_type ) { 247 wp_enqueue_script( 248 $this->plugin_name . '-bundle-rules', 249 plugin_dir_url( __FILE__ ) . 'js/hs-doko-rules.js', 250 $asset_lists, 251 $this->version, 252 false 253 ); 254 } 229 255 $saved_data = $this->get_data(); 230 256 /** … … 234 260 */ 235 261 $data = apply_filters( 'hs_dk_admin_js_object_data', array( 236 'pick_product_message' => esc_html__( 'Enter your product(s) name(s)', 'doko ' ),237 'pick_category_message' => esc_html__( 'Enter your categorie(s) name(s)', 'doko ' ),262 'pick_product_message' => esc_html__( 'Enter your product(s) name(s)', 'doko-bundle-builder' ), 263 'pick_category_message' => esc_html__( 'Enter your categorie(s) name(s)', 'doko-bundle-builder' ), 238 264 ) ); 239 265 if ( $saved_data ) { … … 261 287 add_submenu_page( 262 288 'edit.php?post_type=doko-bundles', 263 esc_html__( 'Documentation', 'doko ' ),264 esc_html__( 'Documentation', 'doko ' ),289 esc_html__( 'Documentation', 'doko-bundle-builder' ), 290 esc_html__( 'Documentation', 'doko-bundle-builder' ), 265 291 'manage_woocommerce', 266 292 'doko-docs', … … 340 366 public function define_custom_post_type() { 341 367 $box_labels = array( 342 'name' => esc_html__( 'Bundles', 'doko ' ),343 'singular_name' => esc_html__( 'Bundle', 'doko ' ),344 'add_new' => esc_html__( 'New Bundle', 'doko ' ),345 'add_new_item' => esc_html__( 'New Bundle', 'doko ' ),346 'edit_item' => esc_html__( 'Edit Bundle', 'doko ' ),347 'new_item' => esc_html__( 'New Bundle', 'doko ' ),348 'view_item' => esc_html__( 'View Bundle', 'doko ' ),349 'search_items' => esc_html__( 'Search Bundle', 'doko ' ),350 'not_found' => esc_html__( 'No Bundle found', 'doko ' ),351 'not_found_in_trash' => esc_html__( 'No Bundle in the trash', 'doko ' ),352 'menu_name' => esc_html__( 'Bundles', 'doko ' ),368 'name' => esc_html__( 'Bundles', 'doko-bundle-builder' ), 369 'singular_name' => esc_html__( 'Bundle', 'doko-bundle-builder' ), 370 'add_new' => esc_html__( 'New Bundle', 'doko-bundle-builder' ), 371 'add_new_item' => esc_html__( 'New Bundle', 'doko-bundle-builder' ), 372 'edit_item' => esc_html__( 'Edit Bundle', 'doko-bundle-builder' ), 373 'new_item' => esc_html__( 'New Bundle', 'doko-bundle-builder' ), 374 'view_item' => esc_html__( 'View Bundle', 'doko-bundle-builder' ), 375 'search_items' => esc_html__( 'Search Bundle', 'doko-bundle-builder' ), 376 'not_found' => esc_html__( 'No Bundle found', 'doko-bundle-builder' ), 377 'not_found_in_trash' => esc_html__( 'No Bundle in the trash', 'doko-bundle-builder' ), 378 'menu_name' => esc_html__( 'Bundles', 'doko-bundle-builder' ), 353 379 ); 354 380 // initialize the Box CPT metabox. 355 381 $box_args = $this->get_default_cpt_args( 'dashicons-screenoptions' ); 356 382 $box_args['labels'] = $box_labels; 357 $box_args['description'] = esc_html__( 'Bundle', 'doko ' );383 $box_args['description'] = esc_html__( 'Bundle', 'doko-bundle-builder' ); 358 384 register_post_type( 'doko-bundles', $box_args ); 359 385 /** … … 386 412 add_meta_box( 387 413 'doko-box-settings', 388 esc_html__( 'First Screen setup', 'doko ' ),414 esc_html__( 'First Screen setup', 'doko-bundle-builder' ), 389 415 array($this, 'get_box_settings'), 390 416 'doko-bundles', … … 419 445 public function get_box_settings() { 420 446 $data = $this->get_data(); 421 echo wp_kses_post( esc_html__( 'This refers to the first navigation screen of the bundle builder : ', 'doko ' ) );447 echo wp_kses_post( esc_html__( 'This refers to the first navigation screen of the bundle builder : ', 'doko-bundle-builder' ) ); 422 448 formulus_format_fields( '<br/><br/>' ); 423 449 /** … … 428 454 $table_args = apply_filters( 'doko_box_table_fields', array( 429 455 'box-description' => array( 430 'label' => esc_html__( 'Title', 'doko ' ),456 'label' => esc_html__( 'Title', 'doko-bundle-builder' ), 431 457 'label_class' => 'doko-table-label', 432 458 'tr_class' => 'doko-box-description', 433 459 'description' => wp_sprintf( 434 460 /* translators: %s: strong tag */ 435 esc_html__( 'Title to show on top of the bundle selector.%1$1sEg:%2$2s CHOOSE YOUR BOX COLOR ', 'doko ' ),461 esc_html__( 'Title to show on top of the bundle selector.%1$1sEg:%2$2s CHOOSE YOUR BOX COLOR ', 'doko-bundle-builder' ), 436 462 '<br/> <strong>', 437 463 '</strong>' 438 464 ), 439 'content' => '<textarea id="doko-box-description" name="doko[box-description]" >' . wp_kses_post( ( isset( $data['box-description'] ) ? $data['box-description'] : esc_html__( 'CHOOSE YOUR BOX COLOR', 'doko ' ) ) ) . '</textarea><input type="hidden" name="doko[bundle-title]" />',465 'content' => '<textarea id="doko-box-description" name="doko[box-description]" >' . wp_kses_post( ( isset( $data['box-description'] ) ? $data['box-description'] : esc_html__( 'CHOOSE YOUR BOX COLOR', 'doko-bundle-builder' ) ) ) . '</textarea><input type="hidden" name="doko[bundle-title]" />', 440 466 ), 441 467 'box-selection-mode' => array( 442 'label' => esc_html__( 'Display according to :', 'doko ' ),468 'label' => esc_html__( 'Display according to :', 'doko-bundle-builder' ), 443 469 'label_class' => 'doko-table-label', 444 470 'content' => formulus_input_fields( 'doko[box-selection-mode]', $this->get_package_selection_options() + array( … … 451 477 ), 452 478 'box-products-mode[]' => array( 453 'label' => esc_html__( 'Products to display :', 'doko ' ),454 'label_class' => 'doko-table-label', 455 'description' => esc_html__( 'Define the products, your customers are allowed to pick to fill this step in the bundle.', 'doko ' ),479 'label' => esc_html__( 'Products to display :', 'doko-bundle-builder' ), 480 'label_class' => 'doko-table-label', 481 'description' => esc_html__( 'Define the products, your customers are allowed to pick to fill this step in the bundle.', 'doko-bundle-builder' ), 456 482 'content' => formulus_input_fields( 'doko[box-products][]', $this->get_dynamic_select_options( 'products', 'box-products', hs_dk_get_data( ( isset( $data['box-products'] ) ? $data['box-products'] : array() ), true ) ) ), 457 483 'tr_class' => 'doko-box-products-mode', 458 484 ), 459 485 'box-categories-mode' => array( 460 'label' => esc_html__( 'Categories to display :', 'doko ' ),461 'label_class' => 'doko-table-label', 462 'description' => esc_html__( 'Define the products categories, your customers are allowed to pick to fill this step in the bundle.', 'doko ' ),486 'label' => esc_html__( 'Categories to display :', 'doko-bundle-builder' ), 487 'label_class' => 'doko-table-label', 488 'description' => esc_html__( 'Define the products categories, your customers are allowed to pick to fill this step in the bundle.', 'doko-bundle-builder' ), 463 489 'content' => formulus_input_fields( 'doko[box-categories][]', $this->get_dynamic_select_options( 'categories', 'box-categories', hs_dk_get_data( ( isset( $data['box-categories'] ) ? $data['box-categories'] : array() ) ) ) ), 464 490 'tr_class' => 'doko-box-categories-mode', … … 467 493 $table_args += array( 468 494 'enable-screen-redirect' => array( 469 'label' => esc_html__( 'Enable auto redirect to next page :', 'doko ' ),470 'label_class' => 'doko-table-label', 471 'description' => esc_html__( 'Redirect automatically to next step, if customers add a product to the box.', 'doko ' ),495 'label' => esc_html__( 'Enable auto redirect to next page :', 'doko-bundle-builder' ), 496 'label_class' => 'doko-table-label', 497 'description' => esc_html__( 'Redirect automatically to next step, if customers add a product to the box.', 'doko-bundle-builder' ), 472 498 'content' => formulus_input_fields( 'doko[enable-screen-redirect]', array( 473 499 'type' => 'select', 474 500 'options' => array( 475 'yes' => esc_html__( 'Yes', 'doko ' ),476 'no' => esc_html__( 'No', 'doko ' ),501 'yes' => esc_html__( 'Yes', 'doko-bundle-builder' ), 502 'no' => esc_html__( 'No', 'doko-bundle-builder' ), 477 503 ), 478 504 ), ( isset( $data['enable-screen-redirect'] ) ? $data['enable-screen-redirect'] : 'yes' ) ), 479 505 ), 480 506 'no-products-message' => array( 481 'label' => esc_html__( 'No products message :', 'doko ' ),482 'label_class' => 'doko-table-label', 483 'description' => esc_html__( 'Message to display, if no products is added to the box.', 'doko ' ),507 'label' => esc_html__( 'No products message :', 'doko-bundle-builder' ), 508 'label_class' => 'doko-table-label', 509 'description' => esc_html__( 'Message to display, if no products is added to the box.', 'doko-bundle-builder' ), 484 510 'content' => formulus_input_fields( 'doko[no-products-message]', array( 485 511 'type' => 'textarea', … … 488 514 ), 489 515 'enable-bottom-navigation' => array( 490 'label' => esc_html__( 'Show/Hide the bundle navigation bar :', 'doko ' ),491 'label_class' => 'doko-table-label', 492 'description' => esc_html__( 'Whether the bundle navigation bar, should always be shown once the page is loaded. By default, it will be showned only if customers add something to the box.', 'doko ' ),516 'label' => esc_html__( 'Show/Hide the bundle navigation bar :', 'doko-bundle-builder' ), 517 'label_class' => 'doko-table-label', 518 'description' => esc_html__( 'Whether the bundle navigation bar, should always be shown once the page is loaded. By default, it will be showned only if customers add something to the box.', 'doko-bundle-builder' ), 493 519 'content' => formulus_input_fields( 'doko[enable-bottom-navigation]', array( 494 520 'type' => 'select', 495 521 'options' => array( 496 'yes' => __( 'Yes', 'doko ' ),497 'no' => __( 'No', 'doko ' ),522 'yes' => __( 'Yes', 'doko-bundle-builder' ), 523 'no' => __( 'No', 'doko-bundle-builder' ), 498 524 ), 499 525 'tr_class' => 'doko-enable-bottom-navigation', … … 516 542 'enable-child-product-display' => array( 517 543 'key' => 'enable-child-product-display', 518 'label' => esc_html__( 'Display the bundle contents into the cart and checkout page', 'doko ' ),544 'label' => esc_html__( 'Display the bundle contents into the cart and checkout page', 'doko-bundle-builder' ), 519 545 'name' => 'doko[enable-child-product-display]', 520 546 'type' => 'select', 521 547 'options' => array( 522 'yes' => __( 'Yes', 'doko ' ),523 'no' => __( 'No', 'doko ' ),548 'yes' => __( 'Yes', 'doko-bundle-builder' ), 549 'no' => __( 'No', 'doko-bundle-builder' ), 524 550 ), 525 551 'default' => ( isset( $data['enable-child-product-display'] ) ? $data['enable-child-product-display'] : 'no' ), … … 527 553 'last-step-title' => array( 528 554 'key' => 'last-step-title', 529 'label' => esc_html__( 'Title to use on the latest step page', 'doko ' ),555 'label' => esc_html__( 'Title to use on the latest step page', 'doko-bundle-builder' ), 530 556 'name' => 'doko[last-step-title]', 531 557 'type' => 'textarea', … … 535 561 'key' => 'last-step-description', 536 562 'type' => 'textarea', 537 'label' => esc_html__( 'Description to use on the latest step page after the last step title section', 'doko ' ),563 'label' => esc_html__( 'Description to use on the latest step page after the last step title section', 'doko-bundle-builder' ), 538 564 'name' => 'doko[last-step-description]', 539 565 'default' => ( isset( $data['last-step-description'] ) ? $data['last-step-description'] : 'Please wait a moment while we prepare your custom bundle box' ), … … 543 569 'type' => 'select', 544 570 'options' => array( 545 'yes' => __( 'Yes', 'doko ' ),546 'no' => __( 'No', 'doko ' ),571 'yes' => __( 'Yes', 'doko-bundle-builder' ), 572 'no' => __( 'No', 'doko-bundle-builder' ), 547 573 ), 548 'label' => esc_html__( 'Enable/Disable additional add to box button below the product card', 'doko ' ),549 'description' => esc_html__( "In some WooCommerce themes, the Add to Cart button is not displayed on bundle pages, to reduce the bounce rate on the bundle page, enable this option to fix it, by default it's set to no.", 'doko ' ),574 'label' => esc_html__( 'Enable/Disable additional add to box button below the product card', 'doko-bundle-builder' ), 575 'description' => esc_html__( "In some WooCommerce themes, the Add to Cart button is not displayed on bundle pages, to reduce the bounce rate on the bundle page, enable this option to fix it, by default it's set to no.", 'doko-bundle-builder' ), 550 576 'name' => 'doko[enable-add-to-box-button]', 551 577 'default' => ( isset( $data['enable-add-to-box-button'] ) ? $data['enable-add-to-box-button'] : 'yes' ), … … 598 624 'custom-css', 599 625 'enable-product-description', 600 'enable-bottom-navigation' 626 'enable-bottom-navigation', 627 'use-bundle-name-as-product-name' 601 628 ) ); 602 629 } … … 606 633 <span class="product-data-wrapper type_box "> 607 634 <button class="button button-primary hs-add-screen" id="add-btn-off"><?php 608 esc_html_e( 'Add Screen ', 'doko ' );635 esc_html_e( 'Add Screen ', 'doko-bundle-builder' ); 609 636 ?></button> 610 637 611 638 <span class="button expand-close doko-btn-expand"> 612 639 <a href class="expand_all"><?php 613 esc_html_e( 'Expand', 'doko ' );640 esc_html_e( 'Expand', 'doko-bundle-builder' ); 614 641 ?></a> / <a href class="close_all"><?php 615 esc_html_e( 'Close', 'doko ' );642 esc_html_e( 'Close', 'doko-bundle-builder' ); 616 643 ?></a> 617 644 </span> … … 637 664 ?> 638 665 </div> 639 </div> 666 640 667 <input type="hidden" name="doko_nonce" value="<?php 641 668 echo esc_html( wp_create_nonce( 'doko_nonce' ) ); … … 667 694 $use_qty_input = $qty_position_field = ''; 668 695 $tags = array(); 669 $title_gift_message = esc_html__( 'Add a gift message', 'doko ' );670 $desc_gift_message = esc_html__( 'To include different messages for different recipients, please contact our support.', 'doko ' );696 $title_gift_message = esc_html__( 'Add a gift message', 'doko-bundle-builder' ); 697 $desc_gift_message = esc_html__( 'To include different messages for different recipients, please contact our support.', 'doko-bundle-builder' ); 671 698 if ( $saved_data ) { 672 699 $screen_name = $saved_data['screen-name']; … … 683 710 $screens_fields = array( 684 711 'screen-name' => array( 685 'label' => esc_html__( 'Screen Name :', 'doko ' ),686 'label_class' => 'doko-table-label', 687 'description' => esc_html__( 'Define a slug to easily identify this screen', 'doko ' ),712 'label' => esc_html__( 'Screen Name :', 'doko-bundle-builder' ), 713 'label_class' => 'doko-table-label', 714 'description' => esc_html__( 'Define a slug to easily identify this screen', 'doko-bundle-builder' ), 688 715 'content' => formulus_input_fields( "doko[{$select_id}][screen-name]", array( 689 716 'type' => 'text', … … 693 720 ); 694 721 $option_list = array( 695 'bundle-products' => esc_html__( 'Bundle Products', 'doko' ), 696 'upgrade-cc' => esc_html__( 'Bundle Cart Content (PRO Version)', 'doko' ), 697 'upgrade-card' => esc_html__( 'Bundle Card Page (PRO Version)', 'doko' ), 698 ); 722 'bundle-products' => esc_html__( 'Bundle Products', 'doko-bundle-builder' ), 723 'upgrade-cc' => esc_html__( 'Bundle Cart Content (PRO Version)', 'doko-bundle-builder' ), 724 'upgrade-card' => esc_html__( 'Bundle Card Page (PRO Version)', 'doko-bundle-builder' ), 725 ); 726 $screenoptions = array('upgrade-cc', 'upgrade-card'); 699 727 $oscreens_fields = array( 700 728 'choose-bundle-screen-disposition' => array( 701 'label' => esc_html__( 'Choose Bundle Screen disposition :', 'doko ' ),702 'label_class' => 'doko-table-label', 703 'description' => esc_html__( 'Define the screen disposition, it supports the following disposition : ', 'doko ' ) . wp_kses_post( $html ),729 'label' => esc_html__( 'Choose Bundle Screen disposition :', 'doko-bundle-builder' ), 730 'label_class' => 'doko-table-label', 731 'description' => esc_html__( 'Define the screen disposition, it supports the following disposition : ', 'doko-bundle-builder' ) . wp_kses_post( $html ), 704 732 'content' => formulus_input_fields( "doko[{$select_id}][screen-disposition]", array( 705 'type' => 'select', 706 'options' => apply_filters( 'doko_bundle_screen_disposition', $option_list ), 707 'return' => true, 733 'type' => 'select', 734 'options' => apply_filters( 'doko_bundle_screen_disposition', $option_list ), 735 'disabled_options' => $screenoptions, 736 'return' => true, 708 737 ), ( isset( $saved_data['screen-disposition'] ) ? $saved_data['screen-disposition'] : 'bundle-products' ) ), 709 738 'tr_class' => 'choose-bundle-screen-disposition', 710 739 ), 711 740 'display-bundle-title' => array( 712 'label' => esc_html__( 'Show / Hide Bundle Screen Title :', 'doko ' ),713 'label_class' => 'doko-table-label', 714 'description' => esc_html__( 'Whether it displays a screen title or not :', 'doko ' ),741 'label' => esc_html__( 'Show / Hide Bundle Screen Title :', 'doko-bundle-builder' ), 742 'label_class' => 'doko-table-label', 743 'description' => esc_html__( 'Whether it displays a screen title or not :', 'doko-bundle-builder' ), 715 744 'content' => formulus_input_fields( 716 745 "doko[{$select_id}][display-bundle-title]", … … 719 748 'id' => $enable_box_details_description_id, 720 749 'options' => array( 721 'yes' => esc_html__( 'Show', 'doko ' ),722 'no' => esc_html__( 'Hide', 'doko ' ),750 'yes' => esc_html__( 'Show', 'doko-bundle-builder' ), 751 'no' => esc_html__( 'Hide', 'doko-bundle-builder' ), 723 752 ), 724 753 'return' => true, 725 754 ), 726 ( isset( $display_bundle_title ) ? $display_bundle_title : esc_html__( 'no', 'doko ' ) ),755 ( isset( $display_bundle_title ) ? $display_bundle_title : esc_html__( 'no', 'doko-bundle-builder' ) ), 727 756 $enable_box_details_description_id 728 757 ), … … 730 759 ), 731 760 'bundle-screen-title' => array( 732 'label' => esc_html__( 'Bundle Screen Title :', 'doko ' ),761 'label' => esc_html__( 'Bundle Screen Title :', 'doko-bundle-builder' ), 733 762 'label_class' => 'doko-table-label', 734 763 'tr_class' => 'doko-tr-section-bundle-title-' . $select_id, 735 'description' => esc_html__( 'Define the bundle screen title. It can be a descriptive text highlighting what your customers must do on this page :', 'doko ' ) . wp_kses_post( $title_html ),736 'content' => '<textarea id="' . $box_description_editor_id . '" name="doko[' . $select_id . '][bundle-title]" >' . (( isset( $bundle_title ) ? $bundle_title : esc_html__( 'CHOOSE YOUR BOX COLOR', 'doko ' ) )) . '</textarea>',764 'description' => esc_html__( 'Define the bundle screen title. It can be a descriptive text highlighting what your customers must do on this page :', 'doko-bundle-builder' ) . wp_kses_post( $title_html ), 765 'content' => '<textarea id="' . $box_description_editor_id . '" name="doko[' . $select_id . '][bundle-title]" >' . (( isset( $bundle_title ) ? $bundle_title : esc_html__( 'CHOOSE YOUR BOX COLOR', 'doko-bundle-builder' ) )) . '</textarea>', 737 766 ), 738 767 $select_name => array( 739 'label' => esc_html__( 'Show Products on this screen based on :', 'doko ' ),768 'label' => esc_html__( 'Show Products on this screen based on :', 'doko-bundle-builder' ), 740 769 'label_class' => 'doko-table-label', 741 770 'content' => formulus_input_fields( "doko[{$select_id}][options]", $this->get_package_selection_options( $select_id ), ( isset( $options ) ? $options : 'products' ) ), … … 743 772 ), 744 773 $pdts_select_name . '[]' => array( 745 'label' => esc_html__( 'Products to display :', 'doko ' ),774 'label' => esc_html__( 'Products to display :', 'doko-bundle-builder' ), 746 775 'label_class' => 'doko-table-label ', 747 776 'tr_class' => 'doko-tr-section-prod-' . $select_id, 748 'description' => esc_html__( 'Define the products, your customers are allowed to pick to fill this step in the bundle.', 'doko ' ),777 'description' => esc_html__( 'Define the products, your customers are allowed to pick to fill this step in the bundle.', 'doko-bundle-builder' ), 749 778 'content' => formulus_input_fields( "doko[{$select_id}][products][]", $this->get_dynamic_select_options( 'products', $pdts_select_id, ( isset( $products_list ) ? $products_list : array() ) ) ), 750 779 ), 751 780 $ctgs_select_name . '[]' => array( 752 'label' => esc_html__( 'Categories to display :', 'doko ' ),781 'label' => esc_html__( 'Categories to display :', 'doko-bundle-builder' ), 753 782 'label_class' => 'doko-table-label ', 754 783 'tr_class' => 'doko-tr-section-cat-' . $select_id, 755 'description' => esc_html__( 'Define the products categories, your customers are allowed to pick to fill this step in the bundle.', 'doko ' ),784 'description' => esc_html__( 'Define the products categories, your customers are allowed to pick to fill this step in the bundle.', 'doko-bundle-builder' ), 756 785 'content' => formulus_input_fields( "doko[{$select_id}][categories][]", $this->get_dynamic_select_options( 'categories', $ctgs_select_id, ( isset( $categories_list ) ? $categories_list : array() ) ) ), 757 786 ), … … 796 825 <p class="description"> 797 826 <label for="doko-bundles-shortcode"><?php 798 esc_attr_e( 'Copy this shortcode and paste it into a new page you\'ve created :', 'doko ' );827 esc_attr_e( 'Copy this shortcode and paste it into a new page you\'ve created :', 'doko-bundle-builder' ); 799 828 ?></label> 800 829 <span class="shortcode wp-ui-highlight"> … … 854 883 global $typenow; 855 884 if ( 'doko-bundles' === $typenow ) { 856 $title = esc_html__( 'Bundle name', 'doko ' );885 $title = esc_html__( 'Bundle name', 'doko-bundle-builder' ); 857 886 } 858 887 return $title; … … 912 941 echo esc_attr( $variation_id ); 913 942 ?>"><?php 914 esc_html_e( 'Remove', 'doko ' );943 esc_html_e( 'Remove', 'doko-bundle-builder' ); 915 944 ?></a> 916 945 <div class="tips sort" data-tip="<?php 917 esc_attr_e( 'Drag and drop, or click to set admin variation order', 'doko ' );946 esc_attr_e( 'Drag and drop, or click to set admin variation order', 'doko-bundle-builder' ); 918 947 ?>"></div> 919 948 <div class="handlediv" style="width: 27px; float: right;" aria-label="<?php 920 esc_attr_e( 'Click to toggle', 'doko ' );949 esc_attr_e( 'Click to toggle', 'doko-bundle-builder' ); 921 950 ?>"></div> 922 951 <strong><span class="doko-section-<?php … … 954 983 955 984 public function get_columns( $defaults ) { 956 $defaults['bundle_shortcodes'] = esc_html__( 'Bundle Shortcodes', 'doko ' );985 $defaults['bundle_shortcodes'] = esc_html__( 'Bundle Shortcodes', 'doko-bundle-builder' ); 957 986 /** 958 987 * Filters the columns of the bundles screen. -
doko-box-builder/trunk/admin/css/doko-select2.css
r2925566 r3315238 1313 1313 box-shadow: 0px 0px 5px #666666; 1314 1314 } 1315 1316 1317 .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;margin:0 0 -4px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left;padding:0}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin:0;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:var(--wc-form-color-background,#fff);color:var(--wc-form-color-text,#000);border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected],.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none;margin:5px 5px 0 0}.select2-container--default .select2-selection--multiple .select2-selection__rendered li:before{content:"";display:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__placeholder{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true],.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected],.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#0073aa;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x}.select2-container--classic .select2-selection--single:focus{border:1px solid #0073aa}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #0073aa}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #0073aa}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #0073aa}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected],.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#0073aa} -
doko-box-builder/trunk/admin/js/hs-doko-admin.js
r3230317 r3315238 1 (function ( $) {1 (function ($) { 2 2 'use strict'; 3 3 4 function dk_get_products( selector_name, url, placeholder, is_full_width ) { 5 var packageOptionMode = selector_name.data('packageMode'); 6 return selector_name.select2( 7 { 8 width : is_full_width ? '100%' : null, 9 multiple: true, 10 placeholder: placeholder, 11 ajax: { 12 url: ajaxurl, 13 dataType: 'json', 14 delay: 30, 15 data: function (params) { 16 return { 17 q: params.term, 18 action: url, 19 operation_type: packageOptionMode, 20 }; 21 }, 22 processResults: function( data ) { 23 var options = []; 24 if ( data ) { 25 data.forEach( 26 ( content ) => { 27 options.push( 28 { 29 id: content[0], 30 text: content[1] 31 } 32 ); 33 } 34 ); 35 } 36 return { 37 results: options 38 }; 39 }, 40 cache: true 41 }, 42 minimumInputLength: 1 43 } 44 ); 45 } 46 47 function dk_change_option_disposition( name, product_name_selector, cat_name_selector , tags_name_selector ) { 48 $(name).on('change', function(e){ 49 var data = $(this).val(); 50 if ( "products" == data ) { 51 $(product_name_selector ).show(); 52 $(cat_name_selector).hide(); 53 $(tags_name_selector).hide() 54 } else if ( "categories" == data ) { 55 $(cat_name_selector).show(); 56 $(product_name_selector ).hide(); 57 $(tags_name_selector).hide(); 58 } else if ( "tags" == data ) { 59 $(cat_name_selector).hide(); 60 $(product_name_selector ).hide(); 61 $(tags_name_selector).show(); 62 } 63 }); 64 $(name+':checked').trigger('change'); 65 } 66 67 68 function dk_change_title_disposition( name, title_selector ) { 69 $(name).on('change', function(e){ 70 var data = $(this).val(); 71 if ( "yes" == data ) { 72 $(title_selector).show(); 73 } else { 74 $(title_selector).hide(); 75 } 76 }); 77 78 $(name + ':checked').trigger('change'); 79 } 80 81 82 function dk_init_sortable_event() { 83 $( 'div.woocommerce_variations' ).sortable({ 84 items: '.woocommerce_variation', 85 cursor: 'move', 86 axis: 'y', 87 handle: '.sort', 88 scrollSensitivity: 40, 89 forcePlaceholderSize: true, 90 helper: 'original', 91 opacity: 0.65, 92 stop: function() { 93 var wrapper = $( '#variable_product_options' ).find( '.woocommerce_variations' ), 94 current_page = parseInt( wrapper.attr( 'data-page' ), 10 ), 95 offset = parseInt( ( current_page - 1 ) * 15, 10 ); 96 97 $( '.woocommerce_variations .woocommerce_variation' ).each( function ( index, el ) { 98 $( '.variation_menu_order', el ) 99 .val( parseInt( $( el ) 100 .index( '.woocommerce_variations .woocommerce_variation' ), 10 ) + 1 + offset ) 101 .trigger( 'change' ); 102 }); 103 } 104 }); 105 $('#accordion div.group').map(function(i) { return this.id; }).get() 106 } 107 108 window.dk_init_sortable_event = dk_init_sortable_event; 109 110 111 $(document).ready(function(){ 4 5 $(document).ready(function () { 6 function dk_get_products(selector_name, url, placeholder, is_full_width) { 7 var packageOptionMode = selector_name.data('packageMode'); 8 return selector_name.select2( 9 { 10 width: is_full_width ? '100%' : null, 11 multiple: true, 12 placeholder: placeholder, 13 ajax: { 14 url: ajaxurl, 15 dataType: 'json', 16 delay: 30, 17 data: function (params) { 18 return { 19 q: params.term, 20 action: url, 21 operation_type: packageOptionMode, 22 }; 23 }, 24 processResults: function (data) { 25 var options = []; 26 if (data) { 27 data.forEach( 28 (content) => { 29 options.push( 30 { 31 id: content[0], 32 text: content[1] 33 } 34 ); 35 } 36 ); 37 } 38 return { 39 results: options 40 }; 41 }, 42 cache: true 43 }, 44 minimumInputLength: 1 45 } 46 ); 47 } 48 49 window.dk_get_products = dk_get_products; 50 51 112 52 var hs_dk_bundle_screen = [ 113 53 '#doko-bundle-screens', … … 115 55 ]; 116 56 117 $('select[name="doko[enable-screen-redirect]"]').on('change', function(){ 118 let changEl = $(this).val(); 119 $('tr.doko_first_screen_no_products').hide(); 120 if (changEl == "no"){ 121 $('tr.doko_first_screen_no_products').show(); 57 hs_dk_bundle_screen = wp.hooks.applyFilters('doko_mb_btn_level', hs_dk_bundle_screen); 58 59 for (var screen in hs_dk_bundle_screen) { 60 $('.type_box').insertAfter(hs_dk_bundle_screen[screen] + ' .hndle'); 61 } 62 63 64 var HSGenerateRandom = function (length) { 65 "use strict"; 66 var result = ""; 67 var characters = 68 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 69 var charactersLength = characters.length; 70 for (var i = 0; i < length; i++) { 71 result += characters.charAt(Math.floor(Math.random() * charactersLength)); 122 72 } 73 return result; 74 }; 75 76 window.HSGenerateRandom = HSGenerateRandom; 77 78 var hs_dk_generate_fields = function (hash_code = window.HSGenerateRandom(5), box_id) { 79 var html = "<p data-hash='" + hash_code + "' class='hs-dk-content'>"; 80 81 html += "<select class='hs-dk-rules' name='doko[rules][" + box_id + "][dynamic][" + hash_code + "][cl-rules]' >"; 82 for (var option_name in window.doko.rules) { 83 html += "<option value='" + option_name + "'>" + window.doko.rules[option_name] + "</option>"; 84 } 85 html += "</select> <select class='hs-dk-options' name='doko[rules][" + box_id + "][dynamic][" + hash_code + "][cl-options]'>"; 86 87 for (var option_name in window.doko.product_operators) { 88 html += "<option value='" + option_name + "'>" + window.doko.product_operators[option_name] + "</option>"; 89 } 90 html += "</select> " 91 92 html += "<span class='hs-dk-values' id=" + hash_code + "><input type='text' /> <button class='button button-primary woo-usn-cl-remove-block' >Remove</button> </span></p>"; 93 return html; 94 } 95 96 window.hs_dk_generate_fields = hs_dk_generate_fields; 97 98 99 100 101 // Meta-Boxes - Open/close 102 $(document).on('click', '.wc-metabox h3', function (event) { 103 // If the user clicks on some form input inside the h3, like a select list (for variations), the box should not be toggled 104 if ($(event.target).filter(':input, option, .sort').length) { 105 return; 106 } 107 $(this).next('.wc-metabox-content').stop().slideToggle(); 108 }) 109 110 111 112 $('.wc-metabox.closed').each(function () { 113 $(this).find('.wc-metabox-content').hide(); 123 114 }); 124 115 125 $( 'a.expand_all' ).on( 'click', function(e) { 126 e.preventDefault(); 127 $('div.doko-metabox > .doko-metabox-content' ).show(); 128 return false; 129 }) 130 131 $( 'a.close_all' ).on( 'click', function(e) { 132 e.preventDefault(); 133 $( 'div.doko-metabox > .doko-metabox-content' ).hide(); 134 return false; 116 $(document).on('click', 'a.remove_variation.delete', function () { 117 $(this).closest('div.woocommerce_variation').remove(); 135 118 }); 136 119 137 $( 'a.close_all' ).trigger('click'); 138 139 140 $('select[name="doko[enable-screen-redirect]"]').trigger('change'); 141 142 hs_dk_bundle_screen = wp.hooks.applyFilters( 'doko_mb_btn_level', hs_dk_bundle_screen ); 143 144 for( var screen in hs_dk_bundle_screen ) { 145 $( '.type_box' ).insertAfter( hs_dk_bundle_screen[screen] + ' .hndle' ); 146 } 147 148 hs_dk_toggle_qty_field(); 149 150 151 152 var total_rule = 0; 153 154 $('button.hs-add-rule').on('click dbclick', function(e){ 155 e.preventDefault(); 156 var bundleId= $('select#doko-associated_rule-bundle').val(); 157 158 if ( bundleId == "no" ) { 159 alert("Choose a bundle, before choosing a rule."); 160 return false; 161 } 162 163 $.blockUI({'message' : 'Preparing your bundle rule, please wait ....'}); 164 $.post(ajaxurl, {'action': 'doko_get_bundle_rule', 'bundle_id' : bundleId , 'current_index' : total_rule }, 165 function(r){ 166 r = JSON.parse(r); 167 var idField = r.args.elem_id; 168 $('div.woocommerce_variations').append( r.html ); 169 dk_init_sortable_event(); 170 dk_build_sortable_bundle( idField, r.args ); 171 172 hs_dk_get_screen_product_list( bundleId, idField ); 173 174 hs_dk_toggle_rule_action( bundleId, idField ); 175 total_rule ++; 176 $.unblockUI(); 177 178 179 180 181 182 } ); 183 }); 120 121 $('a.expand_all').on('click', function (e) { 122 e.preventDefault(); 123 $('div.doko-metabox > .doko-metabox-content').show(); 124 return false; 125 }) 126 127 $('a.close_all').on('click', function (e) { 128 e.preventDefault(); 129 $('div.doko-metabox > .doko-metabox-content').hide(); 130 return false; 131 }); 132 133 $('a.close_all').trigger('click'); 134 135 function dk_init_sortable_event() { 136 $('div.woocommerce_variations').sortable({ 137 items: '.woocommerce_variation', 138 cursor: 'move', 139 axis: 'y', 140 handle: '.sort', 141 scrollSensitivity: 40, 142 forcePlaceholderSize: true, 143 helper: 'original', 144 opacity: 0.65, 145 stop: function () { 146 var wrapper = $('#variable_product_options').find('.woocommerce_variations'), 147 current_page = parseInt(wrapper.attr('data-page'), 10), 148 offset = parseInt((current_page - 1) * 15, 10); 149 150 $('.woocommerce_variations .woocommerce_variation').each(function (index, el) { 151 $('.variation_menu_order', el) 152 .val(parseInt($(el) 153 .index('.woocommerce_variations .woocommerce_variation'), 10) + 1 + offset) 154 .trigger('change'); 155 }); 156 } 157 }); 158 $('#accordion div.group').map(function (i) { return this.id; }).get() 159 } 160 161 window.dk_init_sortable_event = dk_init_sortable_event; 162 163 164 function dk_change_option_disposition(name, product_name_selector, cat_name_selector, tags_name_selector) { 165 $(name).on('change', function (e) { 166 var data = $(this).val(); 167 if ("products" == data) { 168 $(product_name_selector).show(); 169 $(cat_name_selector).hide(); 170 $(tags_name_selector).hide() 171 } else if ("categories" == data) { 172 $(cat_name_selector).show(); 173 $(product_name_selector).hide(); 174 $(tags_name_selector).hide(); 175 } else if ("tags" == data) { 176 $(cat_name_selector).hide(); 177 $(product_name_selector).hide(); 178 $(tags_name_selector).show(); 179 } 180 }); 181 $(name + ':checked').trigger('change'); 182 } 183 184 window.dk_change_option_disposition = dk_change_option_disposition; 185 186 187 function dk_change_title_disposition(name, title_selector) { 188 $(name).on('change', function (e) { 189 var data = $(this).val(); 190 if ("yes" == data) { 191 $(title_selector).show(); 192 } else { 193 $(title_selector).hide(); 194 } 195 }); 196 197 $(name + ':checked').trigger('change'); 198 } 199 200 201 202 203 204 205 function dk_build_sortable_bundle(idField, args) { 206 207 dk_get_products($('select#doko-box-pdts-select-id-' + idField), 'hs_dk_query_wc', doko_object.pick_product_message, true); 208 dk_get_products($('select#doko-ctgs-select-id-' + idField), 'hs_dk_query_wc', doko_object.pick_category_message, true); 209 dk_change_option_disposition('input[name="doko[' + idField + '][options]"]', 'tr.doko-tr-section-prod-' + idField, 'tr.doko-tr-section-cat-' + idField, 'tr.doko-multiple-tags.doko-tr-section-tag-' + idField) 210 dk_change_title_disposition('input[name="doko[' + idField + '][display-bundle-title]"]', 'tr.doko-tr-section-bundle-title-' + idField); 211 $('select[name="doko[' + idField + '][tags][]"]').select2() 212 213 214 if ($('#' + args.box_description_editor_id).length > 0) { 215 wp.attachEditor(document.getElementById(args.box_description_editor_id), {}); 216 $('input[name="doko[' + idField + '][screen-name]"]').on('keyup', function (e) { 217 $('span.doko-section-' + idField).html($(this).val()) 218 }); 219 } 220 221 } 222 223 224 window.dk_build_sortable_bundle = dk_build_sortable_bundle; 225 226 227 228 184 229 185 230 // wp.domReady( () => { … … 187 232 // }); 188 233 189 190 if ( $('#doko-box-description').length > 0 ) { 191 192 dk_get_products($('select[name="doko[box-products][]"]'), 'hs_dk_query_wc', doko_object.pick_product_message, true ); 193 dk_get_products($('select[name="doko[box-categories][]"]'), 'hs_dk_query_wc', doko_object.pick_category_message, true ); 194 195 wp.attachEditor( document.getElementById( 'doko-box-description' )); 196 197 dk_change_option_disposition( 'input[name="doko[box-selection-mode]"]', 'tr.doko-box-products-mode', 'tr.doko-box-categories-mode', 'tr.doko-box-tags-mode'); 198 199 200 201 $('button.hs-add-screen').on('click dbclick', function(e){ 202 e.preventDefault(); 203 $.blockUI({'message' : 'Adding your bundle screen content, please wait ....'}) 204 $.post(ajaxurl, {'action': 'doko_get_admin_screen'}, 205 function(r){ 206 r = JSON.parse(r); 207 var idField = r.args.elem_id; 208 $('div.woocommerce_variations').append( r.html ); 209 hs_dk_toggle_bundle_viewer( idField ); 210 dk_init_sortable_event(); 211 dk_build_sortable_bundle( idField, r.args ); 212 hs_dk_toggle_pagination_per_page( idField ) 213 hs_dk_toggle_gift_messages( idField ) 214 hs_dk_toggle_btn_qty( idField ) 215 216 $.unblockUI(); 217 } ); 218 }); 219 220 change_product_type_tip( 'hello' ) 221 222 for ( var id in doko_object.ids ) { 223 hs_dk_toggle_bundle_viewer( doko_object.ids[id].id ) 224 dk_build_sortable_bundle( doko_object.ids[id].id, doko_object.ids[id].args ); 225 hs_dk_toggle_pagination_per_page( doko_object.ids[id].id ) 226 hs_dk_toggle_gift_messages( doko_object.ids[id].id ) 227 hs_dk_toggle_btn_qty( doko_object.ids[id].id ) 228 229 } 230 dk_init_sortable_event(); 231 } 232 233 $('button.doko-add-rule').on('click', function(e){ 234 e.preventDefault(); 235 $(this).html('Adding ...'); 236 var queryString = window.location.search; 237 var urlParams = new URLSearchParams(queryString); 238 var bundle_id = urlParams.get('bundle-id'); 239 $.post(ajaxurl, { 240 'action': 'doko_get_dynamic_rules', 241 'bundle-id' : bundle_id 242 }, 243 function(r){ 244 r = JSON.parse(r); 245 $('div.doko-dynamic-rules-div').append(r.html); 246 $('button.doko-add-rule').html('Add Rule'); 247 var hash_code = HSGenerateRandom(12); 248 249 $('p.doko-dynamic-rules[data-screen-id='+r.box_rule_id+']').html( 250 hs_dk_generate_fields(hash_code, r.box_rule_id ) 251 ); 252 253 hs_dk_reset_rule_selector( r.box_rule_id, hash_code ); 254 255 256 $(document).on('click dbclick', 'table.doko-selector-table #'+r.box_rule_id , function (e) { 257 e.preventDefault(); 258 hash_code = HSGenerateRandom(12); 259 $('p.doko-dynamic-rules[data-screen-id='+r.box_rule_id+']').append( hs_dk_generate_fields(hash_code, r.box_rule_id) ); 260 hs_dk_reset_rule_selector( r.box_rule_id, hash_code ); 261 262 }); 263 264 $.unblockUI(); 265 } ); 266 }); 267 268 269 $(document).on('change', 'input[name="doko[enable-dynamic-rules]"]', function(e){ 270 e.preventDefault(); 271 if ( $(this).is(':checked') ) { 272 $('tr.doko-box-selection-mode').show(); 273 } else { 274 $('tr.doko-box-selection-mode').hide(); 275 } 276 }); 277 278 $('input[name="doko[enable-dynamic-rules]"]').trigger('change'); 279 280 $('button.doko-save-rule').on('click', function(e){ 281 e.preventDefault(); 282 var queryString = window.location.search; 283 var urlParams = new URLSearchParams(queryString); 284 var bundle_id = urlParams.get('bundle-id'); 285 $.blockUI({'message' : 'Saving your dynamic rules, please wait ....'}) 286 $.post(ajaxurl, { 287 'action': 'doko_save_dynamic_rules', 288 'bundle-id' : bundle_id, 289 'data' : $('form').serializeJSON() 290 }, 291 function(r){ 292 $.unblockUI(); 293 window.location.reload(); 294 } ); 295 }); 296 297 if ( window.doko_saved_rules != undefined ) { 298 var rules = window.doko_saved_rules.doko.rules; 299 for( var rule in rules ){ 300 for ( var hash_code in rules[rule].dynamic ) { 301 $('p.doko-dynamic-rules[data-screen-id='+rule+']').append( hs_dk_generate_fields(hash_code, rule ) ); 302 hs_dk_reset_rule_selector( rule, hash_code ); 303 304 $('[name="doko[rules]['+rule+'][dynamic]['+hash_code+'][cl-rules]"]').val(rules[rule].dynamic[hash_code]['cl-rules']); 305 $('[name="doko[rules]['+rule+'][dynamic]['+hash_code+'][cl-values]"]').val(rules[rule].dynamic[hash_code]['cl-values']); 306 $('[name="doko[rules]['+rule+'][dynamic]['+hash_code+'][cl-options]"]').val(rules[rule].dynamic[hash_code]['cl-options']); 307 } 308 } 309 } 310 var fields = window.doko_fields_list; 311 if ( undefined != fields) { 312 var bundleId = window.doko_bundle_id; 313 var js = JSON.parse(fields); 314 315 for( var id in js ) { 316 hs_dk_get_screen_product_list( bundleId, js[id] ); 317 hs_dk_toggle_rule_action( bundleId, js[id] ); 318 } 319 } 320 321 $("tr.doko-multiple-tags select").select2({"width": "100%"}) 322 $("tr.doko-box-tags-mode select").select2({"width": "100%"}) 323 324 $( 'a.expand_all' ).on( 'click', function(e) { 325 e.preventDefault(); 326 $( this ).find( 'div.doko-metabox > .doko-metabox-content' ).show(); 327 return false; 328 }) 329 330 $( 'a.close_all' ).on( 'click', function(e) { 331 e.preventDefault(); 332 $( this ).find( 'div.doko-metabox > .doko-metabox-content' ).hide(); 333 return false; 334 }); 234 $("tr.doko-multiple-tags select").select2({ "width": "100%" }) 235 $("tr.doko-box-tags-mode select").select2({ "width": "100%" }) 236 335 237 }); 336 337 338 function hs_dk_reset_rule_selector( box_id, hash_code ) { 339 $('p.doko-dynamic-rules[data-screen-id='+box_id+'] select[name="doko[rules]['+box_id+'][dynamic]['+hash_code+'][cl-rules]"]').on('click', function(){ 340 hs_dk_get_dynamic_rule( $(this).val(), box_id, $(this).parent().closest('p.hs-dk-content').data('hash') ); 341 }); 342 343 $('p.doko-dynamic-rules[data-screen-id='+box_id+'] select[name="doko[rules]['+box_id+'][dynamic]['+hash_code+'][cl-rules]"]').trigger('click'); 344 345 $('button.doko-rule-remove-block').on('click', function() { 346 $(this).parent().closest('p.hs-dk-content').remove(); 347 }); 348 } 349 350 351 352 353 // Meta-Boxes - Open/close 354 $( document ).on( 'click', '.wc-metabox h3', function( event ) { 355 // If the user clicks on some form input inside the h3, like a select list (for variations), the box should not be toggled 356 if ( $( event.target ).filter( ':input, option, .sort' ).length ) { 357 return; 358 } 359 $( this ).next( '.wc-metabox-content' ).stop().slideToggle(); 360 }) 361 362 363 364 $( '.wc-metabox.closed' ).each( function() { 365 $( this ).find( '.wc-metabox-content' ).hide(); 366 }); 367 368 $(document).on('click', 'a.remove_variation.delete', function(){ 369 $(this).closest('div.woocommerce_variation').remove(); 370 }); 371 372 373 374 function dk_build_sortable_bundle( idField, args ) { 375 376 dk_get_products( $('select#doko-box-pdts-select-id-' + idField), 'hs_dk_query_wc', doko_object.pick_product_message, true ); 377 dk_get_products( $('select#doko-ctgs-select-id-' + idField), 'hs_dk_query_wc', doko_object.pick_category_message, true ); 378 dk_change_option_disposition( 'input[name="doko['+idField+'][options]"]', 'tr.doko-tr-section-prod-' + idField, 'tr.doko-tr-section-cat-' + idField , 'tr.doko-multiple-tags.doko-tr-section-tag-'+idField ) 379 dk_change_title_disposition( 'input[name="doko['+idField+'][display-bundle-title]"]', 'tr.doko-tr-section-bundle-title-' + idField ); 380 $('select[name="doko['+idField+'][tags][]"]').select2() 381 382 383 if ( $('#'+ args.box_description_editor_id).length > 0 ) { 384 wp.attachEditor( document.getElementById( args.box_description_editor_id ) , {}); 385 $('input[name="doko['+idField+'][screen-name]"]').on('keyup', function(e) { 386 $('span.doko-section-'+idField ).html($(this).val()) 387 }); 388 } 389 390 } 391 392 393 function change_product_type_tip( content ) { 394 $( '#tiptip_holder' ).removeAttr( 'style' ); 395 $( '#tiptip_arrow' ).removeAttr( 'style' ); 396 $( '.woocommerce-product-type-tip' ).tipTip( { 397 attribute: 'data-tip', 398 content: content, 399 fadeIn: 50, 400 fadeOut: 50, 401 delay: 200, 402 keepAlive: true, 403 } ); 404 405 $( '.woocommerce-help-tip' ).tipTip( { 406 attribute: 'data-tip', 407 content: content, 408 fadeIn: 50, 409 fadeOut: 50, 410 delay: 200, 411 keepAlive: true, 412 } ); 413 } 414 415 416 function hs_dk_get_dynamic_rule( option_name, hash_code, field_id ) { 417 var woo_usn_field_options = $("p.doko-dynamic-rules[data-screen-id='"+hash_code+"'] select.hs-dk-options[name='doko[rules][" + hash_code + "][dynamic]["+field_id+"][cl-options]']"); 418 var woo_usn_field_values = $("p.doko-dynamic-rules[data-screen-id='"+hash_code+"'] span#"+field_id); 419 switch (option_name) { 420 case 'total_products_count_on_screen': 421 case 'products_count_on_screen': 422 woo_usn_field_options.empty().append(hs_generate_html_operators()); 423 woo_usn_field_values.empty().attr('name', 'filter-by-amount').append('<input type="number" name="doko[rules][' + hash_code + '][dynamic]['+field_id+'][cl-values]" required/>' + " <button class='button button-primary doko-rule-remove-block' >Remove</button>"); 424 break; 425 426 default: 427 break; 428 } 429 } 430 431 var hs_dk_generate_fields = function (hash_code = HSGenerateRandom(5),box_id) { 432 var html = "<p data-hash='" + hash_code + "' class='hs-dk-content'>"; 433 434 html += "<select class='hs-dk-rules' name='doko[rules]["+box_id+"][dynamic][" + hash_code + "][cl-rules]' >"; 435 for (var option_name in window.doko.rules ) { 436 html += "<option value='" + option_name + "'>" + window.doko.rules[option_name] + "</option>"; 437 } 438 html += "</select> <select class='hs-dk-options' name='doko[rules]["+box_id+"][dynamic][" + hash_code + "][cl-options]'>"; 439 440 for (var option_name in window.doko.product_operators ) { 441 html += "<option value='" + option_name + "'>" + window.doko.product_operators[option_name] + "</option>"; 442 } 443 html += "</select> " 444 445 html +="<span class='hs-dk-values' id="+hash_code+"><input type='text' /> <button class='button button-primary woo-usn-cl-remove-block' >Remove</button> </span></p>"; 446 return html; 447 } 448 449 450 var HSGenerateRandom = function (length) { 451 "use strict"; 452 var result = ""; 453 var characters = 454 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 455 var charactersLength = characters.length; 456 for (var i = 0; i < length; i++) { 457 result += characters.charAt(Math.floor(Math.random() * charactersLength)); 458 } 459 return result; 460 }; 461 462 463 var hs_generate_html_operators = function ( values = window.doko.product_operators ) { 464 var html ; 465 for (var option_name in values ) { 466 html += "<option value='" + option_name + "'>" + values[option_name] + "</option>"; 467 } 468 return html; 469 }; 470 471 var hs_dk_toggle_rule_action = function( bundleId, idField ) { 472 var elem = $('select[name="doko['+idField+'][action]"]'); 473 elem.on('change', function() { 474 var value = $(this).val(); 475 if ( value == "limit-product-in-current-step" || value == "limit-product-in-next-step" ) { 476 $('tr.doko-limit-product-number.doko-'+idField ).show(); 477 $('tr.doko-limit-product-amount.doko-'+idField ).hide(); 478 $('tr.doko-go-to-screen.doko-'+idField ).hide(); 479 } 480 481 482 if ( value == "limit-amount-in-current-step" || value == "limit-amount-in-next-step" ) { 483 $('tr.doko-limit-product-number.doko-'+idField ).hide(); 484 $('tr.doko-limit-product-amount.doko-'+idField ).show(); 485 $('tr.doko-go-to-screen.doko-'+idField ).hide(); 486 } 487 488 if ( value == "go-to-step" ) { 489 $('tr.doko-limit-product-number.doko-'+idField ).hide(); 490 $('tr.doko-limit-product-amount.doko-'+idField ).hide(); 491 492 $('tr.doko-go-to-screen.doko-'+idField ).show(); 493 } 494 495 496 497 }); 498 elem.trigger('change'); 499 } 500 501 502 var hs_dk_get_screen_product_list = function( bundleId, idField ) { 503 var elem = $('select[name="doko['+idField+'][screen-name]"]'); 504 505 elem.on('change', function() { 506 var value = $(this).val(); 507 $.post( 508 ajaxurl, 509 { 510 bundle_id : bundleId, 511 screen : value, 512 action : "doko_get_screen_products" 513 }, function(r) { 514 var json = JSON.parse(r); 515 if ( json.html ) { 516 $('select[name="doko['+idField+'][rule][]"]').html(json.html); 517 var jss = JSON.parse(window.doko_rule_list); 518 if ( undefined != jss[idField] ) { 519 var jrule = jss[idField]['rule']; 520 $('select[name="doko[' + idField + '][rule][]"]').val(jrule); 521 } 522 $('select[name="doko[' + idField + '][rule][]"]').select2({'width' : '100%' }) 523 } 524 525 } 526 ); 527 }); 528 elem.trigger('change'); 529 } 530 531 function hs_dk_toggle_pagination_per_page( idField ) { 532 $('select[name="doko['+idField+'][enable-pagination]"]').on("change", function(e){ 533 e.preventDefault(); 534 let options = $('tr.doko-tr-nb-products-per-page.doko-'+idField); 535 if ( $(this).val() == "yes" ) { 536 options.show(); 537 } else { 538 options.hide(); 539 } 540 }) 541 $('select[name="doko['+idField+'][enable-pagination]"]').trigger('change') 542 } 543 544 545 function hs_dk_toggle_gift_messages( idField ) { 546 $('select[name="doko['+idField+'][enable-gift-message]"]').on("change", function(e){ 547 e.preventDefault(); 548 let options = $('tr.doko-tr-title-gift-message.doko-'+idField); 549 if ( $(this).val() == "yes" ) { 550 options.show(); 551 } else { 552 options.hide(); 553 } 554 options = $('tr.doko-tr-desc-gift-message.doko-'+idField); 555 if ( $(this).val() == "yes" ) { 556 options.show(); 557 } else { 558 options.hide(); 559 } 560 }) 561 $('select[name="doko['+idField+'][enable-gift-message]"]').trigger('change') 562 } 563 564 565 function hs_dk_toggle_btn_qty( idField ) { 566 $('select[name="doko['+idField+'][enable-qty-input]"]').on("change", function(e){ 567 e.preventDefault(); 568 let options = $('tr.doko-idproduct-qty-field-option.doko-'+idField); 569 if ( $(this).val() == "yes" ) { 570 options.show(); 571 } else { 572 options.hide(); 573 } 574 }) 575 $('select[name="doko['+idField+'][enable-qty-input]"]').trigger('change') 576 } 577 578 function hs_dk_toggle_bundle_viewer( idField ) { 579 580 $(document).on('change', '[name="doko['+idField+'][display-bundle-viewer]"]', function(){ 581 var show_viewer = $(this).val() 582 if ( show_viewer == "no" ) { 583 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.choose-bundle-screen-disposition').hide(); 584 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.display-bundle-title').hide(); 585 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-section-bundle-title-' + idField ).hide(); 586 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-box-selection-mode').hide(); 587 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-multiple-tags.doko-tr-section-tag-'+idField).hide(); 588 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-section-prod-'+idField).hide(); 589 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-section-cat-'+idField).hide(); 590 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-enable-product-description').hide(); 591 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-enable-qty-input-label').hide(); 592 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-enable-pagination').hide(); 593 594 595 596 597 } else { 598 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.choose-bundle-screen-disposition').show(); 599 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.display-bundle-title').show(); 600 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-enable-product-description').show(); 601 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-box-selection-mode').show(); 602 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-section-prod-'+idField).show(); 603 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-enable-qty-input-label').show(); 604 $('table[name="formulus-input-doko-box-selection-'+idField+'"] tr.doko-tr-enable-pagination').show(); 605 606 } 607 }); 608 $('[name="doko['+idField+'][display-bundle-viewer]"]').trigger('change'); 609 610 611 } 612 613 614 function hs_dk_toggle_qty_field ( ){ 615 $('select[name="doko[enable-qty-input]"]').on('change', function(e){ 616 e.preventDefault(); 617 let option_selected = $(this).val(); 618 if ( option_selected == "yes" ) { 619 $('tr.doko-qty-position-field').show(); 620 }else { 621 $('tr.doko-qty-position-field').hide(); 622 } 623 624 }); 625 626 $('select[name="doko[enable-qty-input]"]').trigger('change'); 627 } 628 629 })( jQuery ); 630 631 632 633 238 })(jQuery); 239 240 241 242 -
doko-box-builder/trunk/admin/js/hs-doko-bg-admin.js
r3169060 r3315238 69 69 } 70 70 71 72 71 73 72 $( document ).on( 74 73 "click", -
doko-box-builder/trunk/core/class-hs-doko-activator.php
r3150448 r3315238 1 1 <?php 2 2 namespace HS\Doko; 3 3 /** 4 4 * Fired during plugin activation -
doko-box-builder/trunk/core/class-hs-doko-deactivator.php
r3150448 r3315238 1 1 <?php 2 2 namespace HS\Doko; 3 3 /** 4 4 * Fired during plugin deactivation -
doko-box-builder/trunk/core/class-hs-doko-i18n.php
r3150448 r3315238 1 1 <?php 2 2 namespace HS\Doko; 3 3 /** 4 4 * Define the internationalization functionality -
doko-box-builder/trunk/core/class-hs-doko-loader.php
r3150448 r3315238 1 1 <?php 2 2 namespace HS\Doko; 3 3 /** 4 4 * Register all actions and filters for the plugin -
doko-box-builder/trunk/core/class-hs-doko-utils.php
r3230317 r3315238 1 1 <?php 2 2 3 namespace Hs\Doko; 4 3 5 /** 4 6 * Get WC Products by Name. … … 8 10 */ 9 11 function hs_dk_get_wc_products( $product_name ) { 10 $query_args = array( 11 'fields' => 'ids', 12 'post_type' => array('product', 'product_variation'), 13 'post_status' => 'publish', 14 'meta_query' => array(array( 12 /** 13 * product options : 14 * --- Option 1 ==> stock validity 15 * --- Option 2 ==> product without prices 16 * --- Option 3 ==> product hidden 17 * 18 */ 19 $product_options = [ 20 'stock' => [ 15 21 'key' => '_stock_status', 16 22 'value' => 'instock', 17 ), array( 23 ], 24 'price' => [ 18 25 'key' => '_regular_price', 19 26 'value' => '0', 20 27 'compare' => '!=', 21 )), 28 ], 29 ]; 30 // Prepare the query arguments for product retrieval 31 $query_args = [ 32 'fields' => 'ids', 33 'post_type' => ['product', 'product_variation'], 34 'post_status' => 'publish', 35 'meta_query' => array_values( $product_options ), 22 36 'meta_compare_key' => 'AND', 23 'search_columns' => array('post_title'),37 'search_columns' => ['post_title'], 24 38 'limit' => -1, 25 );39 ]; 26 40 if ( $product_name ) { 27 41 $query_args['s'] = $product_name; 28 42 } 29 43 $all_query = array(); 30 $query = new WP_Query($query_args);44 $query = new \WP_Query($query_args); 31 45 foreach ( $query->posts as $query_key => $query_value ) { 32 46 $product = wc_get_product( $query_value ); … … 119 133 */ 120 134 return apply_filters( 'doko_get_products_options_type', array( 121 'low-price' => esc_html__( 'Price (Low to High)', 'doko ' ),122 'high-price' => esc_html__( 'Price (High to Low)', 'doko ' ),135 'low-price' => esc_html__( 'Price (Low to High)', 'doko-bundle-builder' ), 136 'high-price' => esc_html__( 'Price (High to Low)', 'doko-bundle-builder' ), 123 137 ) ); 124 138 } … … 145 159 $values = array( 146 160 'products' => array( 147 'title' => esc_html__( 'Bundle Products', 'doko ' ),161 'title' => esc_html__( 'Bundle Products', 'doko-bundle-builder' ), 148 162 'preview_img_link' => plugin_dir_url( __DIR__ ) . 'admin/img/products.png', 149 163 'slug' => 'products', 150 164 ), 151 165 'products-with-cart' => array( 152 'title' => esc_html__( 'Bundle Cart Content', 'doko ' ),166 'title' => esc_html__( 'Bundle Cart Content', 'doko-bundle-builder' ), 153 167 'preview_img_link' => plugin_dir_url( __DIR__ ) . 'admin/img/products-with-cart.png', 154 168 'slug' => 'products-with-cart', 155 169 ), 156 170 'card-page-type' => array( 157 'title' => esc_html__( 'Bundle Card Page', 'doko ' ),171 'title' => esc_html__( 'Bundle Card Page', 'doko-bundle-builder' ), 158 172 'preview_img_link' => plugin_dir_url( __DIR__ ) . 'admin/img/card-step.png', 159 173 'slug' => 'card-page-type', … … 186 200 )), 187 201 ); 188 $query = new WP_Query($query_args);202 $query = new \WP_Query($query_args); 189 203 $products = $query->posts; 190 echo do_shortcode( '[doko_products ids="' . implode( ',', $products ) . '" columns="3" order="ASC" is_card_screen="' . $is_card_screen . '"]' );204 echo \do_shortcode( '[doko_products ids="' . implode( ',', $products ) . '" columns="3" order="ASC" is_card_screen="' . $is_card_screen . '"]' ); 191 205 } 192 206 … … 195 209 function hs_dk_display_products_disposition( $products, $is_card_screen = false ) { 196 210 global $doko_current_package_data; 197 echo do_shortcode( '[doko_products ids="' . implode( ',', $products ) . '" columns="3" order="ASC" is_card_screen="' . $is_card_screen . '"]' );211 echo \do_shortcode( '[doko_products ids="' . implode( ',', $products ) . '" columns="3" order="ASC" is_card_screen="' . $is_card_screen . '"]' ); 198 212 } 199 213 -
doko-box-builder/trunk/core/class-hs-doko.php
r3230317 r3315238 1 1 <?php 2 3 namespace HS\Doko; 2 4 3 5 /** … … 67 69 $this->version = '1.0.0'; 68 70 } 69 $this->plugin_name = 'doko ';71 $this->plugin_name = 'doko-bundle-builder'; 70 72 $this->load_dependencies(); 71 73 $this->set_locale(); … … 139 141 */ 140 142 private function define_admin_hooks() { 141 $plugin_admin = new H S\Doko\Hs_Doko_Admin($this->get_plugin_name(), $this->get_version());143 $plugin_admin = new Hs_Doko_Admin($this->get_plugin_name(), $this->get_version()); 142 144 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); 143 145 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); … … 170 172 */ 171 173 private function define_public_hooks() { 172 $plugin_public = new HS\Doko\Hs_Doko_Public($this->get_plugin_name(), $this->get_version()); 173 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); 174 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); 174 $plugin_public = new Hs_Doko_Public($this->get_plugin_name(), $this->get_version()); 175 $this->loader->add_action( 176 'wp_enqueue_scripts', 177 $plugin_public, 178 'enqueue_styles', 179 20 180 ); 181 $this->loader->add_action( 182 'wp_enqueue_scripts', 183 $plugin_public, 184 'enqueue_scripts', 185 20 186 ); 175 187 $this->loader->add_action( 'init', $plugin_public, 'init_shortcodes' ); 176 188 $this->loader->add_action( -
doko-box-builder/trunk/core/homescriptone-formulus.php
r3230317 r3315238 1 1 <?php 2 3 namespace HS\Doko; 2 4 3 5 if ( ! defined( 'ABSPATH' ) ) { … … 42 44 'min' => '', 43 45 'max' => '', 46 'disabled_options' => [] 44 47 ); 45 48 … … 54 57 if ( $args['required'] ) { 55 58 $args['class'][] = 'validate-required'; 56 $required = ' <abbr class="required" title="' . esc_attr__( 'required', 'doko ' ) . '">*</abbr>';59 $required = ' <abbr class="required" title="' . esc_attr__( 'required', 'doko-bundle-builder' ) . '">*</abbr>'; 57 60 } 58 61 … … 163 166 foreach ( $args['options'] as $option_key => $option_text ) { 164 167 168 $disabled = ''; 169 if ( isset( $args['disabled_options'] ) && ! empty( $args['disabled_options'] ) ) { 170 if ( in_array( $option_key, $args['disabled_options'] ) ) { 171 $disabled = "disabled='disabled'"; 172 } 173 } 165 174 $selected = ''; 166 175 if ( '' === $option_key ) { 167 176 // If we have a blank option, select2 needs a placeholder. 168 177 if ( empty( $args['placeholder'] ) ) { 169 $args['placeholder'] = $option_text ? $option_text : esc_html__( 'Choose an option', 'doko ' );178 $args['placeholder'] = $option_text ? $option_text : esc_html__( 'Choose an option', 'doko-bundle-builder' ); 170 179 } 171 180 $custom_attributes[] = 'data-allow_clear="true"'; … … 176 185 } 177 186 178 $options .= '<option value="' . esc_attr( $option_key ) . '" ' . selected( $value, $option_key, false ) . ' ' . $selected . ' >' . esc_attr( $option_text ) . '</option>';187 $options .= '<option value="' . esc_attr( $option_key ) . '" ' . $disabled .' ' . selected( $value, $option_key, false ) . ' ' . $selected . ' >' . esc_attr( $option_text ) . '</option>'; 179 188 } 180 189 … … 205 214 ob_start(); 206 215 wp_editor( $value, $id, $settings ); 207 _WP_Editors::enqueue_scripts();208 _WP_Editors::editor_js();216 \_WP_Editors::enqueue_scripts(); 217 \_WP_Editors::editor_js(); 209 218 print_footer_scripts(); 210 219 $field .= ob_get_clean(); … … 350 359 'title' => array(), 351 360 'checked' => array(), 361 'disabled' => array(), 352 362 'placeholder' => array(), 353 363 'rel' => array(), … … 386 396 'data-product-cat' => array(), 387 397 'data-product-tag' => array(), 388 'data-bundle-content-id' => array() 398 'data-bundle-content-id' => array(), 399 'data-row-index' => array() 389 400 390 401 ); … … 438 449 439 450 440 function formulus_generate_repeatable_fields( $id, $options, $display_head=true ) { 451 function formulus_generate_repeatable_fields($id, $options, $key_name, $display_head = true, $include_skeleton = false) 452 { 441 453 ob_start(); 442 ?> 443 <table class="table"> 454 if ($include_skeleton) { 455 ?> 456 <table class="table"> 457 <?php 458 } 459 if ($display_head == true) { 460 ?> 444 461 <thead> 445 462 <tr> 446 463 <?php 447 if ( isset( $options['head'] ) && $display_head ) { 448 foreach( $options['head'] as $thk => $thv ) { 449 echo "<th name='doko[discounts][$id][$thk]' class='doko_discounts_thead'>".$thv."</th>"; 450 } 451 ?> 452 <th><?php _e('Options' ); ?></th> 453 <?php 464 if (isset($options['head'])) { 465 foreach ($options['head'] as $thk => $thv) { 466 echo "<th name='doko[$key_name][$id][$thk]' class='doko_discounts_thead'>" . $thv . "</th>"; 454 467 } 468 ?> 469 <th><?php esc_textarea('Options'); ?></th> 470 <?php 471 } 455 472 ?> 456 473 </tr> 457 474 </thead> 458 <tbody> 459 <tr> 460 <?php 461 if ( isset( $options['head']) ) { 462 foreach( $options['head'] as $thk => $thv ) { 463 echo "<td>"; 464 echo $options['body'][$thk]['content']; 465 echo "</td>"; 466 } 475 <?php 476 } 477 if ($include_skeleton) { 478 ?> 479 <tbody> 480 <?php 481 } 482 ?> 483 <tr class="doko_tr_element doko_tr_<?php echo esc_attr($id); ?>"> 484 <?php 485 if (isset($options['head'])) { 486 foreach ($options['head'] as $thk => $thv) { 487 488 if ( isset( $options['body'][$thk] ) ) { 489 echo "<td>"; 490 echo $options['body'][$thk]['content']; 491 echo "</td>"; 467 492 } 468 ?> 469 <td class="doko_discounts_options_head"> 470 <button class="button button-primary doko-add-discounts" >+</button> 471 <button class="button button-secondary doko-remove-discounts" style="background-color:red; color:white;">-</button> 472 </td> 473 </tr> 493 494 } 495 } 496 ?> 497 <td class="doko_<?php echo esc_attr($id); ?>_options_head"> 498 <button class="button button-secondary doko-remove-rule-row doko-remove-<?php echo esc_attr($id); ?>" style="background-color:red; color:white;">-</button> 499 </td> 500 </tr> 501 <?php 502 if ($include_skeleton) { 503 ?> 474 504 </tbody> 475 </table>505 </table> 476 506 <?php 507 } 477 508 return ob_get_clean(); 478 509 } -
doko-box-builder/trunk/core/premium-loading.php
r3202806 r3315238 20 20 'is_premium' => false, 21 21 'premium_suffix' => 'pro', 22 'has_addons' => true, 22 23 'has_paid_plans' => true, 23 24 'menu' => array( -
doko-box-builder/trunk/hs-doko.php
r3230317 r3315238 8 8 * 9 9 * @wordpress-plugin 10 * Plugin Name: Doko Builder : The Ultimate dynamic bundle builder for WooCommerce10 * Plugin Name: Doko Bundle Builder : The Ultimate dynamic bundle builder for WooCommerce 11 11 * Plugin URI: https://ultiwp.com/plugins/doko 12 12 * Description: Increase sales by letting your customers create custom bundles. 13 * Version: 1. 813 * Version: 1.9 14 14 * Author: UltiWP 15 15 * Author URI: https://ultiwp.com 16 16 * License: GPL-2.0 17 17 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 18 * Text Domain: doko 18 * Text Domain: doko-bundle-builder 19 19 * Domain Path: /languages 20 20 * Requires at least: 6.0 … … 35 35 * Rename this for your plugin and update it as you release new versions. 36 36 */ 37 define( 'DOKO_VERSION', '1. 8' );37 define( 'DOKO_VERSION', '1.9' ); 38 38 define( 'DOKO_DIR_PATH', plugin_dir_path( __FILE__ ) ); 39 39 … … 55 55 function doko_run_activation() { 56 56 require_once plugin_dir_path( __FILE__ ) . 'core/class-hs-doko-activator.php'; 57 H s_Doko_Activator::activate();57 HS\Doko\Hs_Doko_Activator::activate(); 58 58 } 59 59 … … 64 64 function doko_run_deactivation() { 65 65 require_once plugin_dir_path( __FILE__ ) . 'core/class-hs-doko-deactivator.php'; 66 H s_Doko_Deactivator::deactivate();66 HS\Doko\Hs_Doko_Deactivator::deactivate(); 67 67 } 68 68 … … 88 88 function doko_run() { 89 89 90 $plugin = new H s_Doko();90 $plugin = new HS\Doko\Hs_Doko(); 91 91 $plugin->run(); 92 92 } -
doko-box-builder/trunk/languages/doko-en_US.l10n.php
r3169060 r3315238 1 1 <?php 2 return ['project-id-version'=>'DokoBuilder : DIY Product Bundle for WooCommerce','report-msgid-bugs-to'=>'','pot-creation-date'=>'2022-08-28 11:01+0000','po-revision-date'=>'2024-10-12 03:45+0000','last-translator'=>'','language-team'=>'English (United States)','language'=>'en_US','plural-forms'=>'nplurals=2; plural=n != 1;','mime-version'=>'1.0','content-type'=>'text/plain; charset=UTF-8','content-transfer-encoding'=>'8bit','x-generator'=>'Loco https://localise.biz/','x-loco-version'=>'2.6.2; wp-6.0.1','x-domain'=>'doko ','messages'=>['Add to box'=>'Add to box','An error occurred while loading this page, please write to the site administrator.'=>'An error occurred while loading this page, please write to the site administrator.','Back'=>'Back','Bundle'=>'Bundle','Bundle name'=>'Bundle name','Bundles'=>'Bundles','Categories'=>'Categories','Categories to display :'=>'Categories','CHOOSE YOUR BOX COLOR'=>'CHOOSE YOUR BOX COLOR','Choose YOUR CARD'=>'CHOOSE YOUR CARD','Complete Box'=>'Complete Box','Define the products categories, your customers are allowed to pick to fill this step in the bundle.'=>'Define the products categories, your customers are allowed to pick to fill this step in the bundle.','Define the products, your customers are allowed to pick to fill this step in the bundle.'=>'Define the products, your customers are allowed to pick to fill this step in the bundle.','Display according to :'=>'Display according to :','Documentation'=>'Documentation','Edit Bundle'=>'Edit Bundle','Enter your categorie(s) name(s)'=>'Enter your categorie(s) name(s)','Enter your product(s) name(s)'=>'Enter your product(s) name(s)','First Screen setup'=>'First Screen setup','Increase sales by letting your customers create custom bundles.'=>'Increase sales by letting your customers create custom bundles.','Loading'=>'Loading','New Bundle'=>'New Bundle','Next'=>'Next','No Bundle found'=>'No Bundle found','No Bundle in the trash'=>'No Bundle in the trash','Price (High to Low)'=>'Price (High to Low)','Price (Low to High)'=>'Price (Low to High)','Products to display :'=>'Products to display :','Search Bundle'=>'Search Bundle','Sort by Options'=>'Sort by Options','Start selecting items to fill your box'=>'Start selecting items to fill your box','This refers to the first navigation screen of the bundle builder : '=>'This refers to the first navigation screen of the bundle builder : ','Title'=>'Title','Total :'=>'Total :','View Bundle'=>'View Bundle','Your bundle is added to the cart, you will redirect to cart in few moments'=>'Your bundle is added to the cart, you will redirect to cart in few moments']];2 return ['project-id-version'=>'DokoBuilder : DIY Product Bundle for WooCommerce','report-msgid-bugs-to'=>'','pot-creation-date'=>'2022-08-28 11:01+0000','po-revision-date'=>'2024-10-12 03:45+0000','last-translator'=>'','language-team'=>'English (United States)','language'=>'en_US','plural-forms'=>'nplurals=2; plural=n != 1;','mime-version'=>'1.0','content-type'=>'text/plain; charset=UTF-8','content-transfer-encoding'=>'8bit','x-generator'=>'Loco https://localise.biz/','x-loco-version'=>'2.6.2; wp-6.0.1','x-domain'=>'doko-bundle-builder','messages'=>['Add to box'=>'Add to box','An error occurred while loading this page, please write to the site administrator.'=>'An error occurred while loading this page, please write to the site administrator.','Back'=>'Back','Bundle'=>'Bundle','Bundle name'=>'Bundle name','Bundles'=>'Bundles','Categories'=>'Categories','Categories to display :'=>'Categories','CHOOSE YOUR BOX COLOR'=>'CHOOSE YOUR BOX COLOR','Choose YOUR CARD'=>'CHOOSE YOUR CARD','Complete Box'=>'Complete Box','Define the products categories, your customers are allowed to pick to fill this step in the bundle.'=>'Define the products categories, your customers are allowed to pick to fill this step in the bundle.','Define the products, your customers are allowed to pick to fill this step in the bundle.'=>'Define the products, your customers are allowed to pick to fill this step in the bundle.','Display according to :'=>'Display according to :','Documentation'=>'Documentation','Edit Bundle'=>'Edit Bundle','Enter your categorie(s) name(s)'=>'Enter your categorie(s) name(s)','Enter your product(s) name(s)'=>'Enter your product(s) name(s)','First Screen setup'=>'First Screen setup','Increase sales by letting your customers create custom bundles.'=>'Increase sales by letting your customers create custom bundles.','Loading'=>'Loading','New Bundle'=>'New Bundle','Next'=>'Next','No Bundle found'=>'No Bundle found','No Bundle in the trash'=>'No Bundle in the trash','Price (High to Low)'=>'Price (High to Low)','Price (Low to High)'=>'Price (Low to High)','Products to display :'=>'Products to display :','Search Bundle'=>'Search Bundle','Sort by Options'=>'Sort by Options','Start selecting items to fill your box'=>'Start selecting items to fill your box','This refers to the first navigation screen of the bundle builder : '=>'This refers to the first navigation screen of the bundle builder : ','Title'=>'Title','Total :'=>'Total :','View Bundle'=>'View Bundle','Your bundle is added to the cart, you will redirect to cart in few moments'=>'Your bundle is added to the cart, you will redirect to cart in few moments']]; -
doko-box-builder/trunk/public/class-hs-doko-public.php
r3230317 r3315238 37 37 */ 38 38 private $version; 39 40 private $package_id;41 39 42 40 /** … … 79 77 return; 80 78 } 79 // desenqueue script + style. 80 wp_dequeue_style( 'bootstrap' ); 81 wp_dequeue_style( 'bootstrap-rtl' ); 81 82 wp_enqueue_style( 82 83 $this->plugin_name, … … 139 140 return; 140 141 } 142 // desenqueue script + style. 143 wp_dequeue_script( 'bootstrap' ); 144 wp_dequeue_script( 'bootstrap-rtl' ); 141 145 $term_file = "-min.js"; 142 146 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { … … 171 175 false 172 176 ); 173 $loading_message = esc_html__( 'Loading', 'doko ' );177 $loading_message = esc_html__( 'Loading', 'doko-bundle-builder' ); 174 178 /** 175 179 * Filter the data passed to the JS. … … 178 182 */ 179 183 $data = apply_filters( 'doko_js_data_boxpage', array( 180 'ajaxurl' => admin_url( 'admin-ajax.php' ),181 'wc_price_args' => array(184 'ajaxurl' => admin_url( 'admin-ajax.php' ), 185 'wc_price_args' => array( 182 186 'html' => true, 183 187 'currency_symbol' => get_woocommerce_currency_symbol( get_woocommerce_currency() ), … … 188 192 'price_format' => get_woocommerce_price_format(), 189 193 ), 190 'next_message' => esc_html__( 'Next', 'doko' ), 191 'loading_message' => $loading_message, 192 'completed_message' => esc_html__( 'Your bundle is added to the cart, you will redirect to cart in few moments', 'doko' ), 193 'cart_page_url' => wc_get_cart_url(), 194 'limit_product_number' => esc_html__( "You can't add more than %s products into the box.", 'doko' ), 195 'limit_product_amount' => esc_html__( 'You reached the limit of %s for this box.', 'doko' ), 196 'can_use_pro' => doko_fs()->can_use_premium_code(), 194 'next_message' => esc_html__( 'Next', 'doko-bundle-builder' ), 195 'loading_message' => $loading_message, 196 'completed_message' => esc_html__( 'Your bundle is added to the cart, you will redirect to cart in few moments', 'doko-bundle-builder' ), 197 'cart_page_url' => wc_get_cart_url(), 198 'limit_product_number' => esc_html__( "The product %1s can't be added more than %2s in the bundle.", 'doko-bundle-builder' ), 199 'limit_product_amount' => esc_html__( 'You reached the limit of %s for this box.', 'doko-bundle-builder' ), 200 'can_use_pro' => doko_fs()->can_use_premium_code(), 201 'product_is_added_to_box_message' => esc_html__( 'Product %s is added to bundle', 'doko-bundle=builder' ), 202 'total_qty_exceeded' => esc_html__( 'You reached the limit of %s in the bundle.', 'doko-bundle-builder' ), 197 203 ) ); 198 204 wp_add_inline_script( $this->plugin_name, ' var doko_object=' . wp_json_encode( $data ) . ';' ); … … 225 231 } 226 232 add_shortcode( 'doko-bundles', array($this, 'display_shortcode') ); 227 add_shortcode( 'doko_products', ' doko_display_products' );233 add_shortcode( 'doko_products', 'HS\\Doko\\doko_display_products' ); 228 234 } 229 235 … … 239 245 $page_id = $this->get_page_id(); 240 246 $post_obj = get_post( $page_id ); 241 if ( has_shortcode( $post_obj->post_content, 'doko-bundles' ) ) {247 if ( \has_shortcode( $post_obj->post_content, 'doko-bundles' ) ) { 242 248 $template_directory = untrailingslashit( DOKO_DIR_PATH ) . '/templates/'; 243 249 if ( $name ) { … … 335 341 global $doko_current_page_data; 336 342 global $step_identifier; 337 $is_doko_page = false;338 343 $package_id = ( isset( $atts['id'] ) ? $atts['id'] : false ); 339 344 $doko_bundle_id = $package_id; 340 $this->package_id = $package_id;341 345 $package_data = $this->get_data( $package_id ); 342 346 $doko_package_data = $package_data; … … 345 349 } 346 350 if ( !$package_data ) { 347 return esc_html__( 'An error occurred while loading this page, please write to the site administrator.', 'doko ' );351 return esc_html__( 'An error occurred while loading this page, please write to the site administrator.', 'doko-bundle-builder' ); 348 352 } 349 353 /** … … 354 358 $allowed_post_status = apply_filters( 'doko_bundle_status', array('publish') ); 355 359 if ( !in_array( get_post_status( $package_id ), $allowed_post_status, true ) ) { 356 return esc_html__( 'This bundle is not available to the public yet.', 'doko ' );360 return esc_html__( 'This bundle is not available to the public yet.', 'doko-bundle-builder' ); 357 361 } 358 362 $product_tags = array(); … … 375 379 $doko_current_page = 'first-step'; 376 380 $doko_current_page_data = $package_data; 381 $is_doko_page = true; 377 382 $step_title = ''; 378 383 if ( isset( $package_data['box-description'] ) ) { … … 405 410 echo wp_sprintf( 406 411 /* translators: %d: Step number. */ 407 esc_html__( 'Step %d', 'doko ' ),412 esc_html__( 'Step %d', 'doko-bundle-builder' ), 408 413 1 409 414 ); … … 415 420 echo wp_kses_post( $step_title ); 416 421 } else { 417 echo esc_html__( 'Packaging', 'doko ' );422 echo esc_html__( 'Packaging', 'doko-bundle-builder' ); 418 423 } 419 424 ?> … … 442 447 echo wp_sprintf( 443 448 /* translators: %d: Step number. */ 444 esc_html__( 'Step %d', 'doko ' ),449 esc_html__( 'Step %d', 'doko-bundle-builder' ), 445 450 esc_attr( $step_nb ) 446 451 ); … … 448 453 </div> 449 454 <div class="description ng-binding" ><?php 450 ( isset( $value['screen-name'] ) ? esc_attr_e( $value['screen-name'] ) : '' );455 ( isset( $value['screen-name'] ) ? formulus_format_fields( $value['screen-name'] ) : '' ); 451 456 ?></div> 452 457 </a> … … 460 465 echo esc_attr( $step_nb ); 461 466 ?>"> 462 <a href="#" class=" completedwoocommerce-loop-product__title">467 <a href="#" class="woocommerce-loop-product__title"> 463 468 <div class="icon"> 464 469 <span><?php … … 467 472 </div> 468 473 <div class="woocommerce-loop-product__title doko-label-title"><?php 469 echo esc_html__( 'Step', 'doko ' ) . esc_attr( $step_nb );474 echo esc_html__( 'Step', 'doko-bundle-builder' ) . esc_attr( $step_nb ); 470 475 ?></div> 471 <div class="description ng-binding" ng-bind="settings.step4.general.step"><?php472 echo esc_html__( 'Done!', 'doko ' );476 <div class="description ng-binding" ><?php 477 echo esc_html__( 'Done!', 'doko-bundle-builder' ); 473 478 ?></div> 474 479 </a> … … 485 490 <div class="modal doko_modal"> 486 491 <div class="doko_modal_product_title"></div> 487 <div class="doko_modal_product_desc"></div> 492 <div class="doko_modal_product_side" style="display: flex; justify-content: space-around;"> 493 <div> 494 <div class="doko_modal_product_img"></div> 495 </div> 496 <div> 497 <div class="doko_modal_product_desc"></div> 498 <div class="doko_modal_product_price"></div> 499 </div> 500 </div> 501 502 488 503 </div> 489 504 <div class="doko-box-section doko-navigation" > … … 570 585 <div id="build-complete"> 571 586 <h4 class="doko-step-title secondary">Done!</h4> 572 <h1 class="doko-step-title primary ng-binding" ng-bind="settings.step4.general.title">587 <h1 class="doko-step-title primary ng-binding" > 573 588 <?php 574 esc_html_e( $last_step_title, 'doko');589 formulus_format_fields( $last_step_title ); 575 590 ?> 576 591 </h1> 577 <div class="doko-step-description ng-binding" ng-bind-html="settings.step4.general.description"><p>592 <div class="doko-step-description ng-binding" ><p> 578 593 <?php 579 esc_html_e( $last_step_description, 'doko');594 formulus_format_fields( $last_step_description ); 580 595 ?> 581 596 … … 599 614 </div> 600 615 601 <div ng-if="model.status == 'complete'"style="margin: 40px auto 0 auto; width: 400px; max-width: 100%;" class="ng-scope doko-is-complete">616 <div style="margin: 40px auto 0 auto; width: 400px; max-width: 100%;" class="ng-scope doko-is-complete"> 602 617 <button class="button wp-element-button doko-go-to-cart" type="button"> 603 618 <span><?php 604 esc_html_e( 'View Cart', 'doko ' );619 esc_html_e( 'View Cart', 'doko-bundle-builder' ); 605 620 ?></span> 606 621 </button> … … 608 623 <button class="button alt wp-element-button doko-restart" type="button" > 609 624 <span><?php 610 esc_html_e( ' Build Another Bundle', 'doko ' );625 esc_html_e( ' Build Another Bundle', 'doko-bundle-builder' ); 611 626 ?></span> 612 627 </button> … … 647 662 <div class="hs-dk-menu-btn-content-fix"> 648 663 <ul class="doko-btn-navigation"> 649 <li class="doko-button-rb"><button href="#total" class="doko-page-btn button button-primary doko-total-btn wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive" data-btn-type="total" style="background-color: #f5f1f1; color:black;" ><?php 650 esc_attr_e( 'Total :', 'doko' ); 664 <li class="doko-button-rb"> 665 <button href="#total" rel="modal:open" class="doko-page-btn button button-primary doko-total-btn wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive doko_total_btn_elt" data-btn-type="total" style="background-color: #f5f1f1; color:black;" ><?php 666 esc_attr_e( 'Total :', 'doko-bundle-builder' ); 651 667 ?> <?php 652 668 echo wp_kses_post( wc_price( 0 ) ); 653 ?></button></li> 669 ?></button> 670 </li> 654 671 <li><button href="#prev" class="doko-page-btn button button-primary wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive" data-btn-type="prev" ><?php 655 esc_attr_e( 'Back', 'doko ' );672 esc_attr_e( 'Back', 'doko-bundle-builder' ); 656 673 ?></button></li> 657 674 <li><button href="#next" class="doko-page-btn button button-primary wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive" data-btn-type="next"><?php 658 esc_attr_e( 'Next', 'doko ' );675 esc_attr_e( 'Next', 'doko-bundle-builder' ); 659 676 ?></button></li> 660 677 <li><button href="#complete-box" class="doko-page-btn button button-primary wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive" style="display:none;" data-btn-type="complete-box"><?php 661 esc_attr_e( 'Complete Box', 'doko ' );678 esc_attr_e( 'Complete Box', 'doko-bundle-builder' ); 662 679 ?></button></li> 663 680 </ul> … … 678 695 ; 679 696 </script> 680 <!-- <div id="doko_total_bundle_details" role="tooltip" popover> 681 Details 682 </div> --> 697 <div id="doko_total_details" class="modal"> 698 <table class="doko_total_details doko_select wc-block-cart-items wp-block-woocommerce-cart-line-items-block"> 699 <thead> 700 <tr> 701 <th></th> 702 <th><?php 703 esc_html_e( 'Product Name', 'doko-bundle-builder' ); 704 ?></th> 705 <th class="doko_style_to_hide"><?php 706 esc_html_e( 'Unit Price', 'doko-bundle-builder' ); 707 ?></th> 708 <th class="doko_style_to_hide"><?php 709 esc_html_e( 'Quantity', 'doko-bundle-builder' ); 710 ?></th> 711 <th><?php 712 esc_html_e( 'Total', 'doko-bundle-builder' ); 713 ?></th> 714 <th></th> 715 </tr> 716 </thead> 717 <tbody></tbody> 718 </table> 719 <center><a class="doko_total_details_price button button-primary doko-total-btn wp-block-button__link wp-element-button wc-block-components-product-button__button has-font-size has-small-font-size has-text-align-center wc-interactive"></a></center> 720 </div> 683 721 <?php 684 722 wc_print_notices(); … … 757 795 'container' => $container, 758 796 'bundle_id' => $bundle_id, 797 ); 798 $dcontents = apply_filters( 799 'doko_cart_contents_element', 800 $dcontents, 801 $product_id, 802 $variation_id, 803 $data 759 804 ); 760 805 $is_added = WC()->cart->add_to_cart( … … 805 850 $qty = $screen_content['product_qty']; 806 851 $product = wc_get_product( $product_id ); 807 if ( ! is_object( $product ) ) {852 if ( !is_object( $product ) ) { 808 853 continue; 809 854 } … … 822 867 } 823 868 } 824 return $cart_item;869 return apply_filters( 'doko_add_box_contents', $cart_item, $cart_item_key ); 825 870 } 826 871 … … 870 915 $price = 0; 871 916 } 872 $btn_title_text = esc_html__( 'Add to box', 'doko ' );917 $btn_title_text = esc_html__( 'Add to box', 'doko-bundle-builder' ); 873 918 $category_ids = implode( ',', $product->get_category_ids() ); 874 919 $tag_ids = implode( ',', $product->get_tag_ids() ); … … 876 921 $ptype = $product->get_type(); 877 922 $doko_display_variations_as_many = apply_filters( 'doko_display_variations_as_many', value: true ); 878 if ( !$doko_display_variations_as_many && !in_array( $ptype, array('simple', 'variations') ) ) { 923 $childrens = $product->get_children(); 924 if ( !$doko_display_variations_as_many && count( $childrens ) > 0 && !in_array( $ptype, array('simple', 'variation') ) ) { 879 925 } else { 880 926 $btn_text = sprintf( … … 891 937 $category_ids, 892 938 $tag_ids, 893 ( $doko_is_card_page ? esc_html__( 'Add card to box', 'doko ' ) : $btn_title_text )939 ( $doko_is_card_page ? esc_html__( 'Add card to box', 'doko-bundle-builder' ) : $btn_title_text ) 894 940 ); 895 941 } … … 940 986 $tproduct_name = ''; 941 987 if ( isset( $card_details['to'] ) && $card_details['to'] != '' ) { 942 $tproduct_name .= __( '<br/> To : ', 'doko' ) . $card_details['to'];988 $tproduct_name .= esc_html__( '<br/> To : ', 'doko-bundle-builder' ) . $card_details['to']; 943 989 } 944 990 if ( isset( $card_details['from'] ) && $card_details['from'] != '' ) { 945 $tproduct_name .= __( '<br/> From : ', 'doko' ) . $card_details['from'];991 $tproduct_name .= esc_html__( '<br/> From : ', 'doko-bundle-builder' ) . $card_details['from']; 946 992 } 947 993 if ( isset( $card_details['message'] ) && $card_details['message'] != '' ) { 948 $tproduct_name .= __( '<br/> Message : ', 'doko' ) . $card_details['message'];994 $tproduct_name .= esc_html__( '<br/> Message : ', 'doko-bundle-builder' ) . $card_details['message']; 949 995 } 950 996 if ( isset( $card_details['options'] ) && $card_details['options'] != '' ) { 951 $tproduct_name .= __( '<br/> Options Choosed : ', 'doko' ) . $card_details['options'];997 $tproduct_name .= esc_html__( '<br/> Options Choosed : ', 'doko-bundle-builder' ) . $card_details['options']; 952 998 } 953 999 $item->update_meta_data( "<a href='" . get_permalink( $card_details['product_id'] ) . "'>" . get_the_title( $card_details['product_id'] ) . '</a>', $tproduct_name ); … … 999 1045 ?> 1000 1046 <br> 1001 <div class="hs-dk-box-selector" id="doko -bundle-builder">1047 <div class="hs-dk-box-selector" id="doko"> 1002 1048 <?php 1003 1049 global $doko_current_package_data; … … 1086 1132 if ( $stock_avail == 'yes' ) { 1087 1133 wc_update_product_stock( $product, $qty, 'increase' ); 1088 $order->add_order_note( __( 'Stock levels of product ', 'doko' ) . $product->get_formatted_name() . ' has increased of ' . $qty );1134 $order->add_order_note( esc_html__( 'Stock levels of product ', 'doko-bundle-builder' ) . $product->get_formatted_name() . ' has increased of ' . $qty ); 1089 1135 } 1090 1136 } 1091 1137 } 1092 1138 } ); 1139 //todo : display in modal qty, wit description -
doko-box-builder/trunk/public/css/hs-doko-modal.css
r3150448 r3315238 4 4 width: 100%; height: 100%; 5 5 overflow: auto; 6 z-index: 1;6 z-index: 50000; 7 7 padding: 20px; 8 8 box-sizing: border-box; … … 26 26 position: relative; 27 27 z-index: 2; 28 max-width: 500px;28 max-width: 900px; 29 29 box-sizing: border-box; 30 30 width: 90%; -
doko-box-builder/trunk/public/css/hs-doko-public.css
r3230317 r3315238 378 378 } 379 379 @media (max-width: 767px) and (orientation: landscape){ 380 380 381 381 382 382 .hs-dk-btn-text{ … … 386 386 387 387 @media (max-width: 767px) { 388 .doko_style_to_hide{ 389 display: none; 390 } 391 392 393 ul.doko-box-contents{ 394 overflow-x: unset !important; 395 padding-bottom: 0px !important; 396 } 397 388 398 .hs-dk-menu-box{ 389 399 /*display: inherit;*/ 390 flex-direction: column-reverse; 400 background-color: white; 401 flex-direction: column; 391 402 justify-content: center; 392 403 } … … 519 530 background: white; 520 531 border-top: 1px solid #ccc; 521 z-index: 999;522 532 transition: all .25s cubic-bezier(.25,.46,.45,.94); 533 z-index: 12; 523 534 } 524 535 .hs-dk-menu-box{ … … 536 547 cursor: pointer; 537 548 } 538 .hs-dk-menu-btn-content-fix{ 539 display: flex; 540 } 549 541 550 .hs-dk-menu-btn-container{ 542 551 padding: 0 10px; … … 563 572 564 573 565 .doko-footer-navigation, .doko-btn-navigation, .doko-box-container , .doko-box-contents{574 .doko-footer-navigation, .doko-btn-navigation, .doko-box-container{ 566 575 display: inline-flex !important; 567 576 list-style: none !important; … … 577 586 } 578 587 579 .hs-dk-menu-box-img-fix{588 /* .hs-dk-menu-box-img-fix{ 580 589 display: block; 581 590 height: 0px; 582 591 } 592 */ 593 594 595 ul.doko-box-container, ul.doko-box-contents, ul.doko-card-page { 596 margin: unset; 597 } 583 598 584 599 @media only screen and (max-width: 767px) { 585 600 .hs-dk-menu-box-img-fix{ 586 display: none; 587 } 601 display: flex; 602 max-height: 300px; /* adjust as needed */ 603 overflow-y: auto; 604 -webkit-overflow-scrolling: touch; /* for smooth iOS scrolling */ 605 } 606 .hs-dk-menu-btn-content-fix{ 607 display: flex; 608 } 609 588 610 } 589 611 … … 790 812 } 791 813 792 .steps .step a.completed .icon {814 .steps .step a.completed .icon , .steps .step a.active_tab_link .icon { 793 815 border-color: #000; 794 816 } … … 820 842 } 821 843 822 .woocommerce-loop-product__title.completed {844 .woocommerce-loop-product__title.completed , .woocommerce-loop-product__title.active_tab_link{ 823 845 color:#774400 !important; 824 846 } 825 847 826 .steps .step a.completed .icon {848 .steps .step a.completed .icon, .steps .step a.active_tab_link .icon { 827 849 border-color: #774400; 828 850 } 829 851 830 @media (max-width: 480px) {831 #doko-giftbox-progress-bar .steps .step a .description {832 display: none;833 }834 }852 /* @media (max-width: 480px) { 853 #doko-giftbox-progress-bar .steps .step a .description { 854 display: none; 855 } 856 } */ 835 857 836 858 … … 991 1013 visibility: visible;} 992 1014 993 .doko_wrapper_btn_variations , .doko_variable_prices{1015 .doko_wrapper_btn_variations{ 994 1016 display: none; 995 1017 } 1018 1019 img.doko-modal-img { 1020 width: 200px; 1021 } 1022 1023 /* Tooltip Styling */ 1024 .tooltip { 1025 display: none; 1026 position: absolute; 1027 bottom: 120%; /* Places it above the button */ 1028 background-color: #333; 1029 color: white; 1030 padding: 8px 12px; 1031 border-radius: 5px; 1032 white-space: nowrap; 1033 box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3); 1034 z-index: 1000; 1035 } 1036 1037 /* Tooltip Arrow */ 1038 .tooltip-arrow { 1039 position: absolute; 1040 top: 100%; 1041 left: 50%; 1042 transform: translateX(-50%); 1043 width: 0; 1044 height: 0; 1045 border-left: 8px solid transparent; 1046 border-right: 8px solid transparent; 1047 border-top: 8px solid #333; 1048 } 1049 1050 /* ul.doko-box-contents { 1051 max-width: 70%; 1052 overflow-x: auto; 1053 scrollbar-width: thin; 1054 padding: 17px; 1055 justify-content: flex-end; 1056 align-items: center; 1057 align-content: center; 1058 flex-wrap: nowrap; 1059 } */ 1060 1061 ul.doko-box-contents { 1062 width: 600px; /* Restrict width */ 1063 overflow-x: auto; /* Enable horizontal scrolling */ 1064 scrollbar-width: auto; /* Thin scrollbar */ 1065 padding: 17px; 1066 justify-content: flex-start; /* Ensure items align from the start */ 1067 align-items: center; 1068 flex-wrap: nowrap; /* Prevent wrapping */ 1069 white-space: nowrap; /* Prevent text breaking into new lines */ 1070 scroll-behavior: smooth; 1071 } 1072 1073 /* Ensure the list items do not wrap and stay in a single row */ 1074 .doko-box-contents li { 1075 flex-shrink: 0; /* Prevents items from shrinking */ 1076 } 1077 1078 .doko-box-contents { 1079 display: inline-flex !important; 1080 list-style: none !important; 1081 } 1082 1083 /* Custom Scrollbar (for WebKit browsers) */ 1084 ul.doko-box-contents::-webkit-scrollbar { 1085 height: 6px; /* Thin scrollbar */ 1086 } 1087 1088 ul.doko-box-contents::-webkit-scrollbar-thumb { 1089 background-color: #888; /* Scrollbar color */ 1090 border-radius: 3px; 1091 } 1092 1093 ul.doko-box-contents::-webkit-scrollbar-track { 1094 background: #f1f1f1; /* Scroll track background */ 1095 } 1096 1097 button.doko-page-btn { 1098 white-space: nowrap; /* Prevents text from wrapping */ 1099 overflow: hidden; /* Prevents text from spilling out */ 1100 text-overflow: ellipsis; /* Adds "..." if the text overflows */ 1101 display: inline-block; /* Ensures button behaves like a block */ 1102 max-width: 100%; /* Ensures it doesn't overflow the parent */ 1103 } 1104 1105 a.doko-remove { 1106 cursor: pointer !important; 1107 } 1108 1109 1110 /* .hs-dk-menu-fix { 1111 height: 74px; 1112 } */ 1113 1114 img.doko-modal-img-preview { 1115 width: 50px; 1116 } 1117 1118 .doko_total_details { 1119 width: 100%; 1120 border-collapse: collapse; 1121 } 1122 1123 .doko_total_details td, 1124 .doko_total_details th { 1125 border: 1px solid #ccc; 1126 padding: 8px; 1127 text-align: left; 1128 } 1129 1130 .doko_total_details tr:nth-child(even) { 1131 background-color: #f9f9f9; 1132 } 1133 1134 1135 .doko_total_details { 1136 position: relative; /* or 'absolute' or 'fixed' depending on layout */ 1137 z-index: 120; 1138 background: white; /* Ensure it doesn’t look transparent */ 1139 } -
doko-box-builder/trunk/public/js/hs-doko-public-min.js
r3230317 r3315238 1 !function(o){"use strict";let t;window.doko={},window.doko.total_price=0,window.doko.box_container="",window.doko.box_contents={},window.doko.rules={},window.doko.screens={},window.doko.box_card={},window.doko.gift_messages={} ;let d={action:"doko-get-box-display"};o(document).ready((function(){if(window.doko_bundle_id=o('input[name="doko-bundle-page-id"]').val(),window.doko_step_decoded=JSON.parse(window.doko_step_identifier),o("select.hs-dk-categories").on("change",(function(t){t.preventDefault();let e=o(this).data("bundleContentId");d={action:"doko-get-box-display",operation_type:"categories",filter_type:o('div[data-bundle-content-id="'+e+'"] select.hs-dk-options').val(),list_ids:o('div[data-bundle-content-id="'+e+'"] select.hs-dk-categories').val(),bundleContentId:e,bundleId:o(this).data("bundleId"),current_page:window.doko.current_page},o.post(doko_object.ajaxurl,d).done((function(t){o('div[data-bundle-content-id="'+e+'"]').closest(".hs-dk-products-to-add-to-box").html(t),l(),p()}))})),o("select.hs-dk-categories").trigger("change"),o('textarea[name="hs-dk-gift-message-box"]').on("keyup",(function(t){let d=o(this).data("bundleScreenName");doko.gift_messages[d]=o(this).val()})),o(document).innerWidth()<=767){var e=o(".storefront-handheld-footer-bar").height();o("div.hs-dk-menu-fix").css("bottom",e+"px")}o(window).resize((function(){if(o(document).innerWidth()<=767){var t=o(".storefront-handheld-footer-bar").height();o("div.hs-dk-menu-fix").css("bottom",t+"px")}})),o("a.doko-add-to-box").unbind(),o(document).on("click","a.doko-add-to-box",(function(d){d.preventDefault();var e=c("doko",12),n=window.doko.current_page,i=o(this).data("imageUrl"),l=o(this).data("productId"),p=(o(this).data("productPrice"),o(this).data("quantity")),u=o(this).data("productVariationParentId"),_=o('input[name="doko-bundle-page-id"]').val(),k={},h=o(this).data("cardMode");window.doko.cardMode=h;var b=o(this).parents("div.hs-dk-bundle-page"),m=o(b).data();k=o(this).data();var v=o(this).parent().find("span.formulus-input-wrapper").find("input.doko-bundle-qty");v&&(null==o(v).val()?(k.quantity=1,p=1):(k.quantity=o(v).val(),p=o(v).val())),p=parseInt(p),k.current_page=n,k.bundle_id=_;var g=o(this).data("productName");k.unique_id=e,wp.hooks.doAction("doko_before_calculate_add_to_box",l,k,window.doko.current_page,m),k.variation_id=u,wp.hooks.doAction("doko_after_calculate_add_to_box",l,k,window.doko.current_page,m);var w=k.options_is_checked;if(w&&(l="p"+l),"no"==h){if(o("table.doko-box-contents").length>0&&1!=n){var f;let d=parseFloat(k.productPrice);if(null!=k.options&&k.options.length>0&&w)for(var x in k.options)null!=k.options[x].amount&&(d+=k.options[x].amount);f=r(p,g,d,l),0==o('table.doko-box-contents tbody tr[data-product-id="'+l+'"]').length?(o("table.doko-box-contents tbody").append(f),o("ul.box-images").append(function(o,t=!0,d){var e="";return t||(e="doko-reset-icone-remove"),"<li class='"+e+"' data-product-id='"+d.productId+"'><i ' style='cursor: pointer;' aria-hidden='true'></i></div><div class='selected-box' ><img class='box-color' src='"+o+"'></div></li>"}(i,!1,k))):(t=o('ul.doko-box-contents li[data-product-id="'+l+'"] div.doko-qty-exposant').html(),f=r(t,g,d,l),o('table.doko-box-contents tr[data-product-id="'+l+'"]').replaceWith(f))}o("div.hs-dk-menu-fix").show(),a(e)}else o("div.hs-dk-menu-fix").hide(),o("img.hs-dk-card-image").attr("src",i),o("div.hs-dk-product-card-panel").show(),o("div.hs-dk-product-panel").hide(),window.doko.box_card.product_id=l;s()})),o("a.hs-dk-change-card").on("click",(function(){o("div.hs-dk-product-card-panel").hide(),o("div.hs-dk-product-panel").show()})),o("input.hs-dk-input-container-to").on("change",(function(){window.doko.box_card.to=o(this).val()})),o("input.hs-dk-input-container-to").trigger("change"),o("input.hs-dk-input-container-from").on("change",(function(){window.doko.box_card.from=o(this).val()})),o("input.hs-dk-input-container-from").trigger("change"),o("#message-box").on("change",(function(){window.doko.box_card.message=o(this).val()})),o("#message-box").trigger("change"),o('div.hs-dk-card-details [name="doko-note-option"]').on("change",(function(){window.doko.box_card.options=o(this).val()})),o('div.hs-dk-card-details [name="doko-note-option"]').change(),o("input#hs-dk-custom").on("keyup",(function(t){var d=o(this).val().toLowerCase();o("div.hs-dk-products-to-add-to-box h2.woocommerce-loop-product__title").length>0&&o("div.hs-dk-products-to-add-to-box h2.woocommerce-loop-product__title").each((function(t,e){var n=o(this).text().toLowerCase();o(this).closest(".status-publish")[-1!==n.indexOf(d)?"show":"hide"]()}))})),o("div.hs-dk-bundle-page").hide(),o('div.hs-dk-bundle-page[data-page-id="1"]').show(),o("div.hs-dk-menu-fix").hide(),null!=doko_bundle_data&&"yes"==doko_bundle_data["enable-bottom-navigation"]&&o("div.hs-dk-menu-fix").show(),o("div.hs-dk-product-card-panel").hide();var n=1;function a(t,d=!1){var e=JSON.parse(doko_step_identifier)[window.doko.current_page];o("table.doko-box-contents").length>0&&o("table.doko-box-contents tr[data-product-id]").each((function(){o(this).children("td:nth(4)").children("a.doko-remove").unbind(),o(this).children("td:nth(4)").children("a.doko-remove").on("click",(function(){var t=o(this).parent().parent().data("productId"),d=parseInt(o('table.doko-box-contents tr[data-product-id="'+t+'"]').data("productQty")),n=parseFloat(o('table.doko-box-contents tr[data-product-id="'+t+'"]').data("productPrice"));wp.hooks.doAction("doko_before_delete_product_from_box",t,d,n),delete window.doko.box_contents[t],delete window.doko.screens[e][t],s(),o(this).parent().closest("tr").remove(),o('ul.box-images li[data-product-id="'+t+'"]').remove(),o('ul.doko-box-contents li[data-product-id="'+t+'"]').remove(),o('table.doko-box-contents tr[data-product-id="'+t+'"]').remove(),wp.hooks.doAction("doko_after_delete_product_from_box",t,d,n)}))})),o(document).on("click",'li[data-hash-code="'+t+'"] div.doko-right-sup-exposant',(function(){var t=o(this).closest("li").data("productPrice"),d=o(this).closest("li").data("productQty"),n=o(this).closest("li").data("productId");o(this).closest("li").remove(),wp.hooks.doAction("doko_before_delete_product_from_box",n,d,t),delete window.doko.box_contents[n],delete window.doko.screens[e][n],s(),o('ul.box-images li[data-product-id="'+n+'"]').remove(),o('ul.doko-box-contents li[data-product-id="'+n+'"]').remove(),o('table.doko-box-contents tr[data-product-id="'+n+'"]').remove(),wp.hooks.doAction("doko_after_delete_product_from_box",n,d,t)})),d&&o('li[data-hash-code="'+t+'"] div.doko-right-sup-exposant').trigger("click")}function i(o,t=!0){var d,e=doko_object.wc_price_args,n={decimal_sep:e.decimal_separator,currency_position:e.currency_position,currency_symbol:e.currency_symbol,trim_zeros:e.currency_format_trim_zeros,num_decimals:e.currency_format_num_decimals,html:!0};if(n.num_decimals>0){var a=Math.round(o%1*100)/100;d=parseInt(o)+a}else d=parseInt(o);if(o=o.toString().replace(".",n.decimal_sep),t){var i=n.html?'<span class="woocommerce-Price-currencySymbol">'+n.currency_symbol+"</span>":n.currency_symbol;"left"===n.currency_position?d=i+d:"right"===n.currency_position?d+=i:"left_space"===n.currency_position?d=i+" "+d:"right_space"===n.currency_position&&(d=d+" "+i),d=n.html?'<span class="woocommerce-Price-amount amount">'+d+"</span>":d}return d}function r(o,t,d,e){var n='<tr data-product-id="'+e+'" data-product-qty="'+o+'" data-product-price="'+d+'">';return n+="<td>"+t+"</td><td>"+o+"</td><td>"+d+"</td><td>"+d*o+"</td>",n+='<td> <a class="doko-remove" ><i class="fa fa-times" aria-hidden="true"></i></a></td>',n+="</tr>"}function c(o="",t=13){const d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=d.length;let n=o;for(let o=0;o<t;o++)n+=d.charAt(Math.floor(Math.random()*e));return n}function s(){var t=window.doko.screens,d=0;for(var e in t){var n=t[e];if(void 0!==n.qty&&void 0!==n.amount)d+=n.qty*n.amount;else for(var a in n){var r=n[a];void 0!==r.qty&&void 0!==r.amount&&(d+=r.qty*r.amount)}}d=wp.hooks.applyFilters("doko_total_price",d,t),window.doko.total_price=d,o("button.doko-total-btn").html("Total : "+i(d,!0))}function l(){o("a.doko-load-more-content-page-action").unbind(),o("a.doko-load-more-content-page-action").on("click",(function(t){t.preventDefault(),o(this).html("Loading ...");let d=0,e={bundleId:window.doko_bundle_id,bundleContentId:o(this).data("bundleContentId")},n=o(this).data("bundleContentId"),a=o('input[data-bundle-content-id="'+n+'"][name="doko_current_position"]').val();a&&(d=doko_bundle_data[n]["nb-products-per-page"]),e.action="doko-get-products-infinite-loading",e.current_position=parseInt(a)+1,e.filter_type=o('div[data-bundle-content-id="'+window.doko_step_decoded[doko.current_page]+'"] select.hs-dk-options').val(),e.list_ids=o('div[data-bundle-content-id="'+window.doko_step_decoded[doko.current_page]+'"] select.hs-dk-categories').val(),o.post(doko_object.ajaxurl,e).done((function(t){o("a.doko-load-more-content-page-action").html("Load more"),o('input[data-bundle-content-id="'+n+'"][name="doko_current_position"]').remove(),o('input[data-bundle-content-id="'+n+'"][name="doko_operation_type"]').remove();c("doko_part",10);o("ul.hs-doko-loop.products").append(t),a=o('input[data-bundle-content-id="'+n+'"][name="doko_current_position"]').val();let e=parseInt(a)+parseInt(d);o("div.woocommerce-no-products-found").length>0?(o("a.doko-load-more-content-page-action").remove(),o("div.woocommerce-no-products-found").remove()):o('input[name="doko_current_position"]').val(e),p()}))}))}function p(){o("div.doko_infoButton").on("click",(function(t){t.preventDefault();var d=o(this).parent().parent().find(".doko-add-to-box").data();o("div.doko_modal div.doko_modal_product_title").empty(),o("div.doko_modal div.doko_modal_product_title").append("<h2>"+d.productName+"</h2>"),o("div.doko_modal div.doko_modal_product_desc").empty(),o("div.doko_modal div.doko_modal_product_desc").append(o(this).data("productDescription")),o("div.doko_modal").modal()}))}window.doko.current_page=n,o("div#doko-giftbox-progress-bar div.step a").removeClass("completed"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+n+'"] a').addClass("completed"),o('button.doko-page-btn[data-btn-type="next"]').on("click",(function(){if(n+1>o("div.hs-dk-bundle-page").length)return!1;if(wp.hooks.doAction("doko_before_click_navigate_to_page",n),null!=doko_bundle_data&&wp.hooks.applyFilters("doko_restrict_first_page",!0,n)&&""==window.doko.box_container)return alert(doko_bundle_data["no-products-message"]),!1;o("div.hs-dk-bundle-page").length==n+1&&o("div.hs-dk-menu-box").hide(),n++,o("div.hs-dk-bundle-page").hide(),o('div.hs-dk-bundle-page[data-page-id="'+n+'"]').show(),o("div#doko-giftbox-progress-bar div.step a").removeClass("completed"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+n+'"] a').addClass("completed"),window.doko.current_page=n,wp.hooks.doAction("doko_after_click_navigate_to_page",n);let t=JSON.parse(doko_step_identifier);l((t[n],window.doko_bundle_id,window.doko.current_page,o('div[data-bundle-content-id="'+t[n]+'"] input[name="doko_current_position"]').val()))})),o('button.doko-page-btn[data-btn-type="prev"]').on("click",(function(){if(n-1<1)return!1;wp.hooks.doAction("doko_before_click_navigate_to_page",n),o("div.hs-dk-bundle-page").hide(),n--,o('div.hs-dk-bundle-page[data-page-id="'+n+'"]').show(),o("div#doko-giftbox-progress-bar div.step a").removeClass("completed"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+n+'"] a').addClass("completed"),window.doko.current_page=n,wp.hooks.doAction("doko_after_click_navigate_to_page",n)})),o("button.doko-restart").on("click",(function(){window.location.reload()})),o("button.doko-go-to-cart").on("click",(function(){window.location.href=doko_object.cart_page_url})),p(),window.hs_dk_init_delete_box_action=a,window.hs_dk_recalculate_total=s,window.hs_dk_get_wc_price=i,o(document).on("change keydown click","input.doko-bundle-qty",(function(){let t=o(this).val(),d=o(this).data("productId"),e=(o(this).data("productName"),o(this).data("productPrice")),n=doko.current_page,a=o(this).data("productUrl"),i=(doko_step_identifier[n],JSON.parse(doko_step_identifier)[n]);if(null!=doko.box_contents[d]){var r=o("ul.doko-box-contents");hs_dk_add_li_to_box({productId:d,imageUrl:a,productPrice:e,quantity:t},r,!1,!0,!0),doko.box_contents[d].product_qty=parseInt(t),doko.screens[i][d].qty=parseInt(t)}s()}))}))}(jQuery);1 !function(o){"use strict";let t;window.doko={},window.doko.total_price=0,window.doko.box_container="",window.doko.box_contents={},window.doko.rules={},window.doko.screens={},window.doko.box_card={},window.doko.gift_messages={},window.doko.opt_management={};let d={action:"doko-get-box-display"};o(document).ready((function(){if(window.doko_bundle_id=o('input[name="doko-bundle-page-id"]').val(),window.doko_step_decoded=JSON.parse(window.doko_step_identifier),o("select.hs-dk-categories").on("change",(function(t){t.preventDefault();let e=o(this).data("bundleContentId");d={action:"doko-get-box-display",operation_type:"categories",filter_type:o('div[data-bundle-content-id="'+e+'"] select.hs-dk-options').val(),list_ids:o('div[data-bundle-content-id="'+e+'"] select.hs-dk-categories').val(),bundleContentId:e,bundleId:o(this).data("bundleId"),current_page:window.doko.current_page},o.post(doko_object.ajaxurl,d).done((function(t){o('div[data-bundle-content-id="'+e+'"]').closest(".hs-dk-products-to-add-to-box").html(t),p(),u(),_()}))})),o("select.hs-dk-categories").trigger("change"),o('textarea[name="hs-dk-gift-message-box"]').on("keyup",(function(t){let d=o(this).data("bundleScreenName");doko.gift_messages[d]=o(this).val()})),o(document).innerWidth()<=767&&o(document).innerWidth()<=767&&o(".storefront-handheld-footer-bar")){var e=o(".storefront-handheld-footer-bar").height();o("div.hs-dk-menu-fix").css("bottom",2*parseFloat(e)+"px")}o(window).resize((function(){if(o(document).innerWidth()<=767){if(o(".storefront-handheld-footer-bar")){var t=o(".storefront-handheld-footer-bar").height();o("div.hs-dk-menu-fix").css("bottom",2*parseFloat(t)+"px")}}else o("div.hs-dk-menu-fix").css("bottom","0px")})),o("a.doko-add-to-box").unbind(),o(document).on("click","a.doko-add-to-box",(function(d){d.preventDefault();var e=c("doko",12),a=window.doko.current_page,n=o(this).data("imageUrl"),s=o(this).data("productId"),p=(o(this).data("productPrice"),o(this).data("quantity")),u=o(this).data("productVariationParentId"),_=o('input[name="doko-bundle-page-id"]').val(),k={},h=o(this).data("cardMode");window.doko.cardMode=h;var m=o(this).parents("div.hs-dk-bundle-page"),b=o(m).data();k=o(this).data();var v=o(this).parent().find("span.formulus-input-wrapper").find("input.doko-bundle-qty");v&&(null==o(v).val()?(k.quantity=1,p=1):(k.quantity=o(v).val(),p=o(v).val())),p=parseInt(p),k.current_page=a,k.bundle_id=_;var g=o(this).data("productName");k.unique_id=e,wp.hooks.doAction("doko_before_calculate_add_to_box",s,k,window.doko.current_page,b),k.variation_id=u,wp.hooks.doAction("doko_after_calculate_add_to_box",s,k,window.doko.current_page,b);var f=k.options_is_checked;if(f&&(s="p"+s),"no"==h){if(o("table.doko-box-contents").length>0&&1!=a){var w;let d=parseFloat(k.productPrice);if(null!=k.options&&k.options.length>0&&f)for(var x in k.options)null!=k.options[x].amount&&(d+=k.options[x].amount);w=r(p,g,d,s),0==o('table.doko-box-contents tbody tr[data-product-id="'+s+'"]').length?(o("table.doko-box-contents tbody").append(w),o("ul.box-images").append(function(o,t=!0,d){var e="";return t||(e="doko-reset-icone-remove"),"<li class='"+e+"' data-product-id='"+d.productId+"'><i ' style='cursor: pointer;' aria-hidden='true'></i></div><div class='selected-box' ><img class='box-color' src='"+o+"'></div></li>"}(n,!1,k))):(t=o('ul.doko-box-contents li[data-product-id="'+s+'"] div.doko-qty-exposant').html(),w=r(t,g,d,s),o('table.doko-box-contents tr[data-product-id="'+s+'"]').replaceWith(w))}o("div.hs-dk-menu-fix").show(),i(e)}else o("div.hs-dk-menu-fix").hide(),o("img.hs-dk-card-image").attr("src",n),o("div.hs-dk-product-card-panel").show(),o("div.hs-dk-product-panel").hide(),window.doko.box_card.product_id=s;l()})),o("a.hs-dk-change-card").on("click",(function(){o("div.hs-dk-product-card-panel").hide(),o("div.hs-dk-product-panel").show()})),o("input.hs-dk-input-container-to").on("change",(function(){window.doko.box_card.to=o(this).val()})),o("input.hs-dk-input-container-to").trigger("change"),o("input.hs-dk-input-container-from").on("change",(function(){window.doko.box_card.from=o(this).val()})),o("input.hs-dk-input-container-from").trigger("change"),o("#message-box").on("change",(function(){window.doko.box_card.message=o(this).val()})),o("#message-box").trigger("change"),o('div.hs-dk-card-details [name="doko-note-option"]').on("change",(function(){window.doko.box_card.options=o(this).val()})),o('div.hs-dk-card-details [name="doko-note-option"]').change(),o("input#hs-dk-custom").on("keyup",(function(t){var d=o(this).val().toLowerCase();o("div.hs-dk-products-to-add-to-box h2.woocommerce-loop-product__title").length>0&&o("div.hs-dk-products-to-add-to-box h2.woocommerce-loop-product__title").each((function(t,e){var a=o(this).text().toLowerCase();o(this).closest(".status-publish")[-1!==a.indexOf(d)?"show":"hide"]()}))})),_(),o("div.hs-dk-bundle-page").hide(),o('div.hs-dk-bundle-page[data-page-id="1"]').show(),o("div.hs-dk-menu-fix").hide(),null!=doko_bundle_data&&"yes"==doko_bundle_data["enable-bottom-navigation"]&&o("div.hs-dk-menu-fix").show(),o("div.hs-dk-product-card-panel").hide();var a=1;function i(t,d=!1){var e=JSON.parse(doko_step_identifier)[window.doko.current_page];o("table.doko-box-contents").length>0&&o("table.doko-box-contents tr[data-product-id]").each((function(){o(this).children("td:nth(4)").children("a.doko-remove").unbind(),o(this).children("td:nth(4)").children("a.doko-remove").on("click",(function(){var t=o(this).parent().parent().data("productId"),d=parseInt(o('table.doko-box-contents tr[data-product-id="'+t+'"]').data("productQty")),a=parseFloat(o('table.doko-box-contents tr[data-product-id="'+t+'"]').data("productPrice"));wp.hooks.doAction("doko_before_delete_product_from_box",t,d,a),delete window.doko.box_contents[t],delete window.doko.screens[e][t],l(),o(this).parent().closest("tr").remove(),o('ul.box-images li[data-product-id="'+t+'"]').remove(),o('ul.doko-box-contents li[data-product-id="'+t+'"]').remove(),o('table.doko-box-contents tr[data-product-id="'+t+'"]').remove(),wp.hooks.doAction("doko_after_delete_product_from_box",t,d,a)}))})),o(document).on("click",'li[data-hash-code="'+t+'"] div.doko-right-sup-exposant',(function(){var t=o(this).closest("li").data("productPrice"),d=o(this).closest("li").data("productQty"),a=o(this).closest("li").data("productId");o(this).closest("li").remove(),wp.hooks.doAction("doko_before_delete_product_from_box",a,d,t),delete window.doko.box_contents[a],delete window.doko.screens[e][a],l(),o('ul.box-images li[data-product-id="'+a+'"]').remove(),o('ul.doko-box-contents li[data-product-id="'+a+'"]').remove(),o('table.doko-box-contents tr[data-product-id="'+a+'"]').remove(),wp.hooks.doAction("doko_after_delete_product_from_box",a,d,t)})),d&&o('li[data-hash-code="'+t+'"] div.doko-right-sup-exposant').trigger("click")}function n(o,t=!0){var d,e=doko_object.wc_price_args,a={decimal_sep:e.decimal_separator,currency_position:e.currency_position,currency_symbol:e.currency_symbol,trim_zeros:e.currency_format_trim_zeros,num_decimals:e.currency_format_num_decimals,html:!0};if(a.num_decimals>0){var i=Math.round(o%1*100)/100;d=parseInt(o)+i}else d=parseInt(o);if(o=o.toString().replace(".",a.decimal_sep),t){var n=a.html?'<span class="woocommerce-Price-currencySymbol">'+a.currency_symbol+"</span>":a.currency_symbol;"left"===a.currency_position?d=n+d:"right"===a.currency_position?d+=n:"left_space"===a.currency_position?d=n+" "+d:"right_space"===a.currency_position&&(d=d+" "+n),d=a.html?'<span class="woocommerce-Price-amount amount">'+d+"</span>":d}return d}function r(o,t,d,e){var a='<tr data-product-id="'+e+'" data-product-qty="'+o+'" data-product-price="'+d+'">';return a+="<td>"+t+'</td><td class="doko_style_to_hide">'+o+'</td><td class="doko_style_to_hide">'+d+"</td><td>"+d*o+"</td>",a+='<td> <a class="doko-remove" ><i class="fa fa-times" aria-hidden="true"></i></a></td>',a+="</tr>"}function c(o="",t=13){const d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=d.length;let a=o;for(let o=0;o<t;o++)a+=d.charAt(Math.floor(Math.random()*e));return a}function s(){var o=window.doko.screens,t=0;for(var d in o){var e=o[d];if(void 0!==e.qty&&void 0!==e.amount)t+=e.qty*e.amount;else for(var a in e){var i=e[a];void 0!==i.qty&&void 0!==i.amount&&(t+=i.qty*i.amount)}}return t=wp.hooks.applyFilters("doko_total_price",t,o),window.doko.total_price=t,t}function l(){let t=s();o("button.doko-total-btn").html("Total : "+n(t,!0)+" ⓘ "),o(".doko_total_details_price").html("Total : "+n(doko.total_price,!0))}function p(){o("a.doko-load-more-content-page-action").unbind(),o("a.doko-load-more-content-page-action").on("click",(function(t){t.preventDefault(),o(this).html("Loading ...");let d=0,e={bundleId:window.doko_bundle_id,bundleContentId:o(this).data("bundleContentId")},a=o(this).data("bundleContentId"),i=o('input[data-bundle-content-id="'+a+'"][name="doko_current_position"]').val();i&&(d=doko_bundle_data[a]["nb-products-per-page"]),e.action="doko-get-products-infinite-loading",e.current_position=parseInt(i)+1,e.filter_type=o('div[data-bundle-content-id="'+window.doko_step_decoded[doko.current_page]+'"] select.hs-dk-options').val(),e.list_ids=o('div[data-bundle-content-id="'+window.doko_step_decoded[doko.current_page]+'"] select.hs-dk-categories').val(),o.post(doko_object.ajaxurl,e).done((function(t){o("a.doko-load-more-content-page-action").html("Load more"),o('input[data-bundle-content-id="'+a+'"][name="doko_current_position"]').remove(),o('input[data-bundle-content-id="'+a+'"][name="doko_operation_type"]').remove();c("doko_part",10);o("ul.hs-doko-loop.products").append(t),i=o('input[data-bundle-content-id="'+a+'"][name="doko_current_position"]').val();let e=parseInt(i)+parseInt(d);o("div.woocommerce-no-products-found").length>0?(o("a.doko-load-more-content-page-action").remove(),o("div.woocommerce-no-products-found").remove()):o('input[name="doko_current_position"]').val(e),u(),_()}))}))}function u(){o("div.doko_infoButton").on("click",(function(t){t.preventDefault();var d=o(this).parent().parent().find(".doko-add-to-box").data(),e=o(this).parent().parent().find(".doko-add-to-box").clone();o("div.doko_modal div.doko_modal_product_title").empty(),o("div.doko_modal div.doko_modal_product_title").append("<h2>"+d.productName+"</h2>"),o("div.doko_modal div.doko_modal_product_img").empty(),o("div.doko_modal div.doko_modal_product_img").append('<img src="'+d.imageUrl+'" alt="doko-image" class="doko-modal-img" />'),o("div.doko_modal div.doko_modal_product_desc").empty(),o("div.doko_modal div.doko_modal_product_desc").append(o(this).data("productDescription")),o("div.doko_modal div.doko_modal_product_price").empty(),o("div.doko_modal div.doko_modal_product_price").append("<p class='doko-price-section'>"+d.productPrice+" "+d.siteCurrency+"</p>"),o("div.doko_modal div.doko_modal_product_price").append(e),o("div.doko_modal").modal()}))}function _(){o("select.doko-add-to-box-variable").on("change",(function(t){var d=o(this).val();o(this).parent().find("div.doko_wrapper_btn_variations").hide(),o(this).prevAll().find("span.price span.doko_variable_prices").hide(),o(this).parent().find('div.doko_wrapper_btn_variations[data-product-id="'+d+'"]').show(),o(this).parent().find('div.doko_wrapper_btn_variations[data-product-id="'+d+'"] a').show(),o(this).prevAll().find('span.price span.doko_variable_prices[data-product-id="'+d+'"]').show(),""!=d&&d||o(this).prevAll().find("span.doko_old_price").show()})),o("select.doko-add-to-box-variable").trigger("change")}window.doko.current_page=a,o("div#doko-giftbox-progress-bar div.step a").removeClass("active_tab_link"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+a+'"] a').addClass("active_tab_link"),o('button.doko-page-btn[data-btn-type="next"]').on("click",(function(){if(a+1>o("div.hs-dk-bundle-page").length)return!1;if(wp.hooks.doAction("doko_before_click_navigate_to_page",a),null!=doko_bundle_data&&wp.hooks.applyFilters("doko_restrict_first_page",!0,a)&&""==window.doko.box_container)return alert(doko_bundle_data["no-products-message"]),!1;o("div.hs-dk-bundle-page").length==a+1&&o("div.hs-dk-menu-box").hide(),a++,o("div.hs-dk-bundle-page").hide(),o('div.hs-dk-bundle-page[data-page-id="'+a+'"]').show(),o("div#doko-giftbox-progress-bar div.step a").removeClass("active_tab_link"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+a+'"] a').addClass("active_tab_link"),window.doko.current_page=a,wp.hooks.doAction("doko_after_click_navigate_to_page",a);const t=document.querySelector(".doko-box-section");if(t){const o=t.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({top:o,behavior:"smooth"})}let d=JSON.parse(doko_step_identifier);p((d[a],window.doko_bundle_id,window.doko.current_page,o('div[data-bundle-content-id="'+d[a]+'"] input[name="doko_current_position"]').val()))})),o('button.doko-page-btn[data-btn-type="prev"]').on("click",(function(){if(a-1<1)return!1;wp.hooks.doAction("doko_before_click_navigate_to_page",a),o("div.hs-dk-bundle-page").hide(),a--,o('div.hs-dk-bundle-page[data-page-id="'+a+'"]').show(),o("div#doko-giftbox-progress-bar div.step a").removeClass("active_tab_link"),o('div#doko-giftbox-progress-bar div.step[data-step-id="'+a+'"] a').addClass("active_tab_link"),window.doko.current_page=a,wp.hooks.doAction("doko_after_click_navigate_to_page",a)})),o("button.doko-restart").on("click",(function(){window.location.reload()})),o("button.doko-go-to-cart").on("click",(function(){window.location.href=doko_object.cart_page_url})),u(),window.hs_dk_init_delete_box_action=i,window.hs_dk_recalculate_total=s,window.hs_dk_recalculate_total_html=l,window.hs_dk_get_wc_price=n,o(document).on("change keydown click","input.doko-bundle-qty",(function(){let t=o(this).val(),d=o(this).data("productId"),e=(o(this).data("productName"),o(this).data("productPrice")),a=doko.current_page,i=o(this).data("productUrl"),n=JSON.parse(doko_step_identifier)[a];if(null!=doko.box_contents[d]){var r=o("ul.doko-box-contents");hs_dk_add_li_to_box({productId:d,imageUrl:i,productPrice:e,quantity:t},r,!1,!0,!0),doko.box_contents[d].product_qty=parseInt(t),doko.screens[n][d].qty=parseInt(t)}l()})),o("button.doko_total_btn_elt").on("click",(function(){o("div#doko_total_details").modal(),function(){let t=o.modal.getCurrent();var d=JSON.parse(doko_step_identifier)[window.doko.current_page];o(t.$elm[0]).on("click","a.doko-remove",(function(){var t=o(this).parent().parent().data("productId"),e=parseInt(o('table.doko_total_details tr[data-product-id="'+t+'"]').data("productQty")),a=parseFloat(o('table.doko_total_details tr[data-product-id="'+t+'"]').data("productPrice"));wp.hooks.doAction("doko_before_delete_product_from_box",t,e,a),delete window.doko.box_contents[t],delete window.doko.screens[d][t],l(),o(this).parent().closest("tr").remove(),o('ul.box-images li[data-product-id="'+t+'"]').remove(),o('ul.doko-box-contents li[data-product-id="'+t+'"]').remove(),o('table.doko-box-contents tr[data-product-id="'+t+'"]').remove(),wp.hooks.doAction("doko_after_delete_product_from_box",t,e,a)}))}()})),window.hs_dk_rebuild_total_modal=function(){let t=window.doko.screens,d=o("table.doko_select tbody"),e="";for(var a in e=wp.hooks.applyFilters("doko_before_creating_total_details_modal",e),t){let d=t[a];if("first-step"==a){let t=o('a[data-product-id="'+d.product_id+'"]').data();null!=t&&(e+="<tr class='cart_item' data-product-id='"+d.product_id+"' data-product-qty='"+d.qty+"' data-product-price='"+t.productPrice+"' data-product-currency='"+t.siteCurrency+"'><td><img src='"+t.imageUrl+"' class='doko-modal-img-preview' /></td><td>"+t.productName+"</td><td class='doko_style_to_hide'>"+t.productPrice+" "+t.siteCurrency+"</td><td class='doko_style_to_hide'>"+d.qty+"</td><td>"+d.qty*t.productPrice+" "+t.siteCurrency+"</td><td></td></tr>")}else for(var i in d){let t=d[i],a=o('a[data-product-id="'+t.product_id+'"]').data();null!=a&&(e+="<tr class='cart_item' data-product-id='"+t.product_id+"' data-product-qty='"+t.qty+"' data-product-price='"+a.productPrice+"' data-product-currency='"+a.siteCurrency+"'><td><img src='"+a.imageUrl+"' class='doko-modal-img-preview' /></td><td>"+a.productName+"</td><td class='doko_style_to_hide'>"+a.productPrice+" "+a.siteCurrency+"</td><td class='doko_style_to_hide'>"+t.qty+"</td><td>"+t.qty*a.productPrice+" "+a.siteCurrency+'</td><td><a class="doko-remove"><i class="fa fa-times" aria-hidden="true"></i></a></td></tr>')}}e=wp.hooks.applyFilters("doko_after_creating_total_details_modal",e),d.html(e)}}))}(jQuery); -
doko-box-builder/trunk/public/js/hs-doko-public.js
r3230317 r3315238 4 4 window.doko = {}; 5 5 window.doko.total_price = 0; 6 window.doko.total_qty = 0; 6 7 window.doko.box_container = ""; 7 8 window.doko.box_contents = {}; 8 9 window.doko.rules = {}; 10 window.doko.total_rules = {} 9 11 window.doko.screens = {}; 10 12 window.doko.box_card = {}; 11 window.doko.gift_messages = {} 13 window.doko.gift_messages = {}; 14 window.doko.opt_management = {}; 15 window.doko.history = []; 12 16 let qty; 13 17 let data_to_send = { … … 56 60 57 61 if ( $( document ).innerWidth() <= 767 ) { 58 var woocommerce_storefront_footer = $( '.storefront-handheld-footer-bar' ).height(); 59 $( 'div.hs-dk-menu-fix' ).css( 'bottom', woocommerce_storefront_footer + 'px' ) 62 if ( $( document ).innerWidth() <= 767 ) { 63 if ( $( '.storefront-handheld-footer-bar' ) ){ 64 var woocommerce_storefront_footer = $( '.storefront-handheld-footer-bar' ).height(); 65 $( 'div.hs-dk-menu-fix' ).css( 'bottom', parseFloat(woocommerce_storefront_footer) * 2 + 'px' ) 66 } 67 } 60 68 } 61 69 62 70 $( window ).resize( 63 71 function () { 72 console.log('is resized'); 64 73 if ( $( document ).innerWidth() <= 767 ) { 65 var woocommerce_storefront_footer = $( '.storefront-handheld-footer-bar' ).height(); 66 $( 'div.hs-dk-menu-fix' ).css( 'bottom', woocommerce_storefront_footer + 'px' ) 67 } 68 74 if ( $( '.storefront-handheld-footer-bar' ) ){ 75 var woocommerce_storefront_footer = $( '.storefront-handheld-footer-bar' ).height(); 76 $( 'div.hs-dk-menu-fix' ).css( 'bottom', parseFloat(woocommerce_storefront_footer) * 2 + 'px' ) 77 } 78 } else { 79 $( 'div.hs-dk-menu-fix' ).css('bottom', '0px'); 80 } 69 81 } 70 82 ); … … 88 100 var current_page = 1; 89 101 window.doko.current_page = current_page; 90 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( ' completed' );91 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( ' completed' );102 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( 'active_tab_link' ); 103 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( 'active_tab_link' ); 92 104 $( 'button.doko-page-btn[data-btn-type="next"]' ).on( 93 105 'click', … … 115 127 $( 'div.hs-dk-bundle-page' ).hide(); 116 128 $( 'div.hs-dk-bundle-page[data-page-id="' + current_page + '"]' ).show() 117 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( ' completed' );118 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( ' completed' );129 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( 'active_tab_link' ); 130 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( 'active_tab_link' ); 119 131 window.doko.current_page = current_page; 120 132 wp.hooks.doAction( 'doko_after_click_navigate_to_page', current_page ); 133 134 const element = document.querySelector('.doko-box-section'); 135 136 if (element) { 137 const top = element.getBoundingClientRect().top + window.pageYOffset; 138 window.scrollTo({ 139 top: top, 140 behavior: 'smooth' // or 'auto' for instant scroll 141 }); 142 } 121 143 122 144 let doko_step_decoded = JSON.parse( doko_step_identifier ); … … 141 163 current_page--; 142 164 $( 'div.hs-dk-bundle-page[data-page-id="' + current_page + '"]' ).show() 143 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( ' completed' );144 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( ' completed' );165 $( 'div#doko-giftbox-progress-bar div.step a' ).removeClass( 'active_tab_link' ); 166 $( 'div#doko-giftbox-progress-bar div.step[data-step-id="' + current_page + '"] a' ).addClass( 'active_tab_link' ); 145 167 window.doko.current_page = current_page; 146 168 … … 185 207 delete window.doko.screens[screenId][product_id]; 186 208 187 recalculate_total ();209 recalculate_total_html(); 188 210 189 211 $( this ).parent().closest( 'tr' ).remove() … … 210 232 delete window.doko.box_contents[product_id]; 211 233 delete window.doko.screens[screenId][product_id]; 212 recalculate_total ();234 recalculate_total_html(); 213 235 $( 'ul.box-images li[data-product-id="' + product_id + '"]' ).remove(); 214 236 $( 'ul.doko-box-contents li[data-product-id="' + product_id + '"]' ).remove(); … … 226 248 window.hs_dk_init_delete_box_action = hs_dk_init_delete_box_action; 227 249 window.hs_dk_recalculate_total = recalculate_total; 250 window.hs_dk_recalculate_total_html = recalculate_total_html; 228 251 229 252 /** … … 273 296 function hs_dk_build_box_contents( product_qty, product_name, product_price, product_id ) { 274 297 var html = '<tr data-product-id="' + product_id + '" data-product-qty="' + product_qty + '" data-product-price="' + product_price + '">' 275 html += '<td>' + product_name + '</td><td >' + product_qty + '</td><td>' + product_price + '</td><td>' + product_price * product_qty + '</td>'298 html += '<td>' + product_name + '</td><td class="doko_style_to_hide">' + product_qty + '</td><td class="doko_style_to_hide">' + product_price + '</td><td>' + product_price * product_qty + '</td>' 276 299 html += '<td> <a class="doko-remove" ><i class="fa fa-times" aria-hidden="true"></i></a></td>' 277 300 html += '</tr>' … … 320 343 let purl = $( this ).data( 'productUrl' ) 321 344 322 let curpaid = doko_step_identifier[current_page]323 324 345 let dkscrt = JSON.parse( doko_step_identifier ); 325 346 … … 347 368 } 348 369 349 recalculate_total ();370 recalculate_total_html(); 350 371 351 372 } 352 373 ); 374 375 function hs_dk_rebuild_li_product_lines( productData, product_img_url, product_quantity, product_name, sprice, product_id ) { 376 377 let box_contents_html = hs_dk_build_box_contents( product_quantity, product_name, sprice, product_id ); 378 379 if ($( 'table.doko-box-contents tbody tr[data-product-id="' + product_id + '"]' ).length == 0) { 380 $( 'table.doko-box-contents tbody' ).append( box_contents_html ); 381 $( 'ul.box-images' ).append( hs_dk_build_img_block( product_img_url, false, productData ) ); 382 } else { 383 qty = $( 'ul.doko-box-contents li[data-product-id="' + product_id + '"] div.doko-qty-exposant' ).html(); 384 box_contents_html = hs_dk_build_box_contents( qty, product_name, sprice, product_id ); 385 $( 'table.doko-box-contents tr[data-product-id="' + product_id + '"]' ).replaceWith( box_contents_html ) 386 } 387 388 } 389 390 window.hs_dk_rebuild_li_product_lines = hs_dk_rebuild_li_product_lines; 353 391 354 392 function hs_dk_init_add_to_box( args = false ) { … … 359 397 function (e) { 360 398 e.preventDefault(); 399 400 if ( $(this).hasClass('disabled') ) { 401 return; 402 } 403 361 404 var unique_id = hs_generateUniqueId( 'doko', 12 ); 362 405 var dk_current_page = window.doko.current_page; … … 393 436 394 437 product_quantity = parseInt( product_quantity ); 438 console.log( 'product_quantity', product_quantity ); 395 439 396 440 productData.current_page = dk_current_page; 397 441 productData.bundle_id = bundle_id; 398 442 var product_name = $( this ).data( 'productName' ) 443 productData.productName = product_name; 399 444 400 445 productData.unique_id = unique_id; … … 424 469 } 425 470 } 426 427 428 429 box_contents_html = hs_dk_build_box_contents( product_quantity, product_name, sprice, product_id ); 430 431 if ($( 'table.doko-box-contents tbody tr[data-product-id="' + product_id + '"]' ).length == 0) { 432 $( 'table.doko-box-contents tbody' ).append( box_contents_html ); 433 $( 'ul.box-images' ).append( hs_dk_build_img_block( product_img_url, false, productData ) ); 434 } else { 435 qty = $( 'ul.doko-box-contents li[data-product-id="' + product_id + '"] div.doko-qty-exposant' ).html(); 436 box_contents_html = hs_dk_build_box_contents( qty, product_name, sprice, product_id ); 437 $( 'table.doko-box-contents tr[data-product-id="' + product_id + '"]' ).replaceWith( box_contents_html ) 438 } 471 472 hs_dk_rebuild_li_product_lines( productData, product_img_url, product_quantity, product_name, sprice, product_id ); 439 473 440 474 } … … 451 485 } 452 486 453 recalculate_total ();487 recalculate_total_html(); 454 488 } 455 489 ); … … 496 530 497 531 } 532 533 498 534 499 535 function recalculate_total() { … … 517 553 518 554 window.doko.total_price = total; 519 520 $( 'button.doko-total-btn' ).html( 'Total : ' + hs_dk_get_wc_price( total, true ) ); 555 return total; 556 557 } 558 559 function recalculate_total_html() { 560 let total = recalculate_total(); 561 $( 'button.doko-total-btn' ).html( 'Total : ' + hs_dk_get_wc_price( total, true ) + " ⓘ " ); 562 $('.doko_total_details_price').html('Total : '+ hs_dk_get_wc_price( doko.total_price, true ) ); 521 563 } 522 564 … … 547 589 } 548 590 let curbId = $(this).data('bundleContentId'); 549 console.log($( 'input[data-bundle-content-id="'+curbId+'"][name="doko_current_position"]' ).val()) 591 550 592 let cposition = $( 'input[data-bundle-content-id="'+curbId+'"][name="doko_current_position"]' ).val(); 551 console.log(curbId) 593 552 594 if ( cposition ) { 553 595 nb_of_post_per_page = doko_bundle_data[curbId]['nb-products-per-page']; … … 605 647 } 606 648 649 function hs_dk_delete_elmt_modal() { 650 let modyl = $.modal.getCurrent(); 651 var jsonId = JSON.parse(doko_step_identifier); 652 var current_screen = window.doko.current_page; 653 var screenId = jsonId[current_screen]; 654 655 // Use event delegation to ensure newly added elements are also affected 656 $(modyl.$elm[0]).on("click", "a.doko-remove", function () { 657 var product_id = $(this).parent().parent().data("productId"); 658 var productQty = parseInt($('table.doko_total_details tr[data-product-id="' + product_id + '"]').data("productQty")); 659 var price = parseFloat($('table.doko_total_details tr[data-product-id="' + product_id + '"]').data("productPrice")); 660 661 wp.hooks.doAction("doko_before_delete_product_from_box", product_id, productQty, price); 662 663 // Remove product from data 664 delete window.doko.box_contents[product_id]; 665 delete window.doko.screens[screenId][product_id]; 666 667 recalculate_total_html(); 668 669 // Remove product elements from UI 670 $(this).parent().closest("tr").remove(); 671 $('ul.box-images li[data-product-id="' + product_id + '"]').remove(); 672 $('ul.doko-box-contents li[data-product-id="' + product_id + '"]').remove(); 673 $('table.doko-box-contents tr[data-product-id="' + product_id + '"]').remove(); 674 675 wp.hooks.doAction("doko_after_delete_product_from_box", product_id, productQty, price); 676 }); 677 678 } 679 607 680 608 681 function hs_dk_init_info_click(){ … … 610 683 e.preventDefault(); 611 684 var productId = $(this).parent().parent().find(".doko-add-to-box").data(); 685 var btn = $(this).parent().parent().find(".doko-add-to-box").clone(); 612 686 $('div.doko_modal div.doko_modal_product_title').empty(); 613 687 $('div.doko_modal div.doko_modal_product_title').append( '<h2>' + productId['productName'] + '</h2>' ); 688 $('div.doko_modal div.doko_modal_product_img').empty(); 689 $('div.doko_modal div.doko_modal_product_img').append( '<img src="' + productId['imageUrl'] + '" alt="doko-image" class="doko-modal-img" />' ); 614 690 $('div.doko_modal div.doko_modal_product_desc').empty(); 615 691 $('div.doko_modal div.doko_modal_product_desc').append( $(this).data('productDescription') ) 692 $('div.doko_modal div.doko_modal_product_price').empty(); 693 $('div.doko_modal div.doko_modal_product_price').append( "<p class='doko-price-section'>" + productId['productPrice'] + " "+ productId['siteCurrency'] + "</p>" ); 694 $('div.doko_modal div.doko_modal_product_price').append( btn ); 616 695 $('div.doko_modal').modal(); 617 696 }); … … 621 700 $('select.doko-add-to-box-variable').on('change', function(e){ 622 701 var selected_value = $(this).val(); 623 $('div.doko_wrapper_btn_variations').hide(); 624 console.log($(this).prev().find('span.doko_variable_prices')); 625 $(this).prev().find('span.doko_variable_prices').hide(); 626 $('div.doko_wrapper_btn_variations[data-product-id="'+selected_value+'"]').show(); 627 $(this).prev().find('span.doko_variable_prices[data-product-id="'+selected_value+'"]').show(); 628 702 $(this).parent().find('div.doko_wrapper_btn_variations').hide(); 703 $(this).prevAll().find('span.price span.doko_variable_prices').hide(); 704 $(this).parent().find('div.doko_wrapper_btn_variations[data-product-id="'+selected_value+'"]').show(); 705 $(this).parent().find('div.doko_wrapper_btn_variations[data-product-id="'+selected_value+'"] a').show(); 706 $(this).prevAll().find('span.price span.doko_variable_prices[data-product-id="'+selected_value+'"]').show(); 629 707 if ( selected_value == "" || !selected_value ) { 630 $( 'span.doko_old_price').show();708 $(this).prevAll().find('span.doko_old_price').show(); 631 709 } 632 710 }) 633 711 634 712 $('select.doko-add-to-box-variable').trigger('change'); 635 713 } 636 714 715 $('button.doko_total_btn_elt').on('click', function(){ 716 $('div#doko_total_details').modal() 717 hs_dk_delete_elmt_modal(); 718 }); 719 720 function hs_dk_rebuild_total_modal(){ 721 let ds = window.doko.screens; 722 let uld = $('table.doko_select tbody'); 723 724 let tli = ""; 725 tli = wp.hooks.applyFilters('doko_before_creating_total_details_modal', tli ); 726 for( var d in ds ) { 727 let elop = ds[d]; 728 if ( d == "first-step" ){ 729 let product = $('a[data-product-id="'+elop.product_id+'"]').data(); 730 if ( undefined != product ) { 731 tli += "<tr class='cart_item' data-product-id='"+elop.product_id+"' data-product-qty='"+elop.qty+"' data-product-price='"+product.productPrice+"' data-product-currency='"+product.siteCurrency+"'>"+ 732 "<td><img src='"+product.imageUrl+ "' class='doko-modal-img-preview' /></td>" + 733 "<td>"+product.productName+"</td>" + 734 "<td class='doko_style_to_hide'>"+product.productPrice+" "+product.siteCurrency+"</td>" + 735 "<td class='doko_style_to_hide'>"+elop.qty+"</td>" + 736 "<td>"+(elop.qty * product.productPrice)+" "+product.siteCurrency+"</td>" + 737 '<td></td>'+ 738 "</tr>"; 739 } 740 } else { 741 for( var pp in elop ) { 742 let selop = elop[pp]; 743 let product = $('a[data-product-id="'+selop.product_id+'"]').data(); 744 if ( undefined != product ) { 745 tli += "<tr class='cart_item' data-product-id='"+selop.product_id+"' data-product-qty='"+selop.qty+"' data-product-price='"+product.productPrice+"' data-product-currency='"+product.siteCurrency+"'>"+ 746 "<td><img src='"+product.imageUrl+ "' class='doko-modal-img-preview' /></td>" + 747 "<td>"+product.productName+"</td>" + 748 "<td class='doko_style_to_hide'>"+product.productPrice+" "+product.siteCurrency+"</td>" + 749 "<td class='doko_style_to_hide'>"+selop.qty+"</td>" + 750 "<td>"+(selop.qty * product.productPrice)+ " "+product.siteCurrency+"</td>" + 751 '<td><a class="doko-remove"><i class="fa fa-times" aria-hidden="true"></i></a></td>'+ 752 "</tr>"; 753 } 754 } 755 } 756 } 757 tli = wp.hooks.applyFilters('doko_after_creating_total_details_modal', tli ); 758 uld.html(tli); 759 } 760 761 window.hs_dk_rebuild_total_modal = hs_dk_rebuild_total_modal; 762 763 764 765 637 766 } 638 767 -
doko-box-builder/trunk/public/js/hs-doko-utils-min.js
r3230317 r3315238 1 function check_in_list(o,d){return d.indexOf(o)>-1}!function(o){"use strict";o(document).ready((function(){function d(d,t,i=!0,e=!0,n=!1){var a=d.quantity,s=d.productId,r=d.productPrice,c=d.imageUrl,p=d.unique_id;d.options_is_checked&&(s="p"+s);var l="";if(e||(l="doko-reset-icone-remove"),n)o(t).find('li[data-product-id="'+s+'"]').length>0&&(o(t).find('li[data-product-id="'+s+'"] div.doko-qty-exposant').html(a),o(t).find('li[data-product-id="'+s+'"]').attr("data-product-qty",a).attr("data-hash-code",p),o("table.doko-box-contents tr[data-product-id='"+s+"'] td:nth-child(2)").html(a));else if(i){o(t).empty();var _="<li class='"+l+"' data-product-qty='"+a+"' data-product-price='"+r+"' data-product-id='"+s+"' data-hash-code='"+p+"'><i style='cursor: pointer;' aria-hidden='true'></i><div class='selected-box' ><img class='box-color' src='"+c+"'></div> ",u=!1;wp.hooks.applyFilters("doko_is_dynamic_screen",u,window.doko.current_page)&&(_+="<div class='doko-right-sup-exposant'>x</div> <div class='doko-qty-exposant'>"+a+"</div>"),_+="</li>",o(t).append(_).css("display","flex").css("list-style-type","none"),o(t).find("li img").css("height","initial").css("top","10%").css("position","absolute").css("width","initial").css("height","40px"),window.doko.rules={}}else if(o(t).find('li[data-product-id="'+s+'"]').length>0){var k=o(t).find('li[data-product-id="'+s+'"]').attr("data-product-qty");a=parseInt(k)+1,o(t).find('li[data-product-id="'+s+'"] div.doko-qty-exposant').html(a),o(t).find('li[data-product-id="'+s+'"]').attr("data-product-qty",a).attr("data-hash-code",p)}else{_="<li class='"+l+"' data-product-qty="+a+" data-product-price="+r+" data-product-id="+s+" data-hash-code="+p+"><i ' style='cursor: pointer;' aria-hidden='true'></i></div><div class='selected-box' ><img class='box-color' src='"+c+"'></div> ",u=!1;wp.hooks.applyFilters("doko_is_dynamic_screen",u,window.doko.current_page)&&(_+="<div class='doko-right-sup-exposant'>x</div> <div class='doko-qty-exposant'>"+a+"</div>"),_+="</li>",o(t).append(_).css("display","flex").css("list-style-type","none"),o(t).find("li img").css("height","initial").css("top","10%").css("position","absolute").css("width","initial").css("height","40px")}}o("div.doko-spinner-loading").show(),o("div.doko-spinner-complete").hide(),o("div.doko-is-complete").hide(),o("div.doko-spinner-error").hide(),wp.hooks.addFilter("doko_is_dynamic_screen","doko",(function(o,d){return parseInt(d)!=parseInt(1)}),10,2),wp.hooks.addAction("doko_after_calculate_add_to_box","doko",(function(t,i,e){var n=i.productId,a=i.quantity,s=i.productPrice,r=i.unique_id,c=i.variation_id,p=i.options,l=i.options_is_checked,_=JSON.parse(doko_step_identifier);if(1==e){if(wp.hooks.applyFilters("doko_execute_rule_on_page",!0,e)&&null!=doko_bundle_data){var u=wp.hooks.applyFilters("doko_enable_first_page_redirect",doko_bundle_data["enable-screen-redirect"],e);window.doko.box_container={product_id:n,product_qty:a,product_price:s,unique_id:r,variation_id:c,options:p};let l=s;for(var k in p)null!=p[k].amount&&(l+=p[k].amount);window.doko.screens["first-step"]={qty:i.quantity,amount:wp.hooks.applyFilters("doko_bundle_product_price",l,t,i,e),options:p},d(i,w=o("ul.doko-box-container"),!0,!0),"yes"==u&&o('ul.doko-btn-navigation button.doko-page-btn[data-btn-type="next"]').trigger("click")}}else if(wp.hooks.applyFilters("doko_execute_rule_on_page",!0,e)){var w=o("ul.doko-box-contents");wp.hooks.applyFilters("doko_add_product_to_navigation",!0,e)&&d(i,w,!1,!0),l&&(n="p"+n);var h=_[e];if("no"==window.doko.cardMode){let o=s;for(var k in p)null!=p[k].amount&&(o+=p[k].amount);null==window.doko.screens[h]&&(window.doko.screens[h]={}),window.doko.screens[h].hasOwnProperty(n)||(window.doko.screens[h][n]={qty:0,amount:wp.hooks.applyFilters("doko_bundle_product_price",o,t,i,e),options:p}),window.doko.screens[h][n].qty+=a,window.doko.box_contents.hasOwnProperty(n)?window.doko.box_contents[n].product_qty+=a:window.doko.box_contents[n]={product_id:i.productId,product_qty:a,product_price:s,unique_id:r,variation_id:c,options:p}}}wp.hooks.doAction("doko_execute_rule",e,n,a,s,r,c,t,i)}),30,3),wp.hooks.addAction("doko_delete_product_from_box","doko",(function(d){o("div.hs-dk-bundle-page").filter(":visible").data().pageId>1&&delete window.doko.box_contents[d]})),wp.hooks.addAction("doko_after_click_navigate_to_page","doko",(function(d){if(d==o("div.hs-dk-bundle-page").length){var t={container:window.doko.box_container,contents:window.doko.box_contents,total_price:window.doko.total_price,card_details:window.doko.box_card,gift_message:window.doko.gift_messages};o.post(doko_object.ajaxurl,{action:"doko_wc_add_to_cart",contents:t,bundle_id:o("div[data-bundle-id]").data("bundleId")},(function(d){var t=JSON.parse(d);t.doko_is_added_to_cart?(o("div.doko-spinner-loading").hide(),o("div.doko-spinner-complete").show(),o("div.doko-is-complete").show()):(o("div.doko-spinner-loading").hide(),o("div.doko-spinner-error").show(),o("div.doko-is-complete").show(),o("button.doko-go-to-cart").hide()),o("div#build-complete").append(t.doko_html_response_adc)}))}})),window.hs_dk_add_li_to_box=d}))}(jQuery),window.hs_dk_check_in_list=check_in_list;1 !function(o){"use strict";o(document).ready((function(){function d(d,t,i=!0,e=!0,a=!1){var n=d.quantity,r=d.productId,s=d.productPrice,c=d.imageUrl,p=d.unique_id;d.options_is_checked&&(r="p"+r);var _="";if(e||(_="doko-reset-icone-remove"),a)o(t).find('li[data-product-id="'+r+'"]').length>0&&(o(t).find('li[data-product-id="'+r+'"] div.doko-qty-exposant').html(n),o(t).find('li[data-product-id="'+r+'"]').attr("data-product-qty",n).attr("data-hash-code",p),o("table.doko-box-contents tr[data-product-id='"+r+"'] td:nth-child(2)").html(n));else if(i){o(t).empty();var l="<li class='"+_+"' data-product-qty='"+n+"' data-product-price='"+s+"' data-product-id='"+r+"' data-hash-code='"+p+"'><i style='cursor: pointer;' aria-hidden='true'></i><div class='selected-box' ><img class='box-color' src='"+c+"'></div> ",u=!1;wp.hooks.applyFilters("doko_is_dynamic_screen",u,window.doko.current_page)&&(l+="<div class='doko-right-sup-exposant'>x</div> <div class='doko-qty-exposant'>"+n+"</div>"),l+="</li>",o(t).append(l),o(t).find("li img").css("width","40px"),window.doko.rules=[]}else if(o(t).find('li[data-product-id="'+r+'"]').length>0){var k=o(t).find('li[data-product-id="'+r+'"]').attr("data-product-qty");n=parseInt(k)+1,o(t).find('li[data-product-id="'+r+'"] div.doko-qty-exposant').html(n),o(t).find('li[data-product-id="'+r+'"]').attr("data-product-qty",n).attr("data-hash-code",p)}else{l="<li class='"+_+"' data-product-qty="+n+" data-product-price="+s+" data-product-id="+r+" data-hash-code="+p+"><i ' style='cursor: pointer;' aria-hidden='true'></i></div><div class='selected-box' ><img class='box-color' src='"+c+"'></div> ",u=!1;wp.hooks.applyFilters("doko_is_dynamic_screen",u,window.doko.current_page)&&(l+="<div class='doko-right-sup-exposant'>x</div> <div class='doko-qty-exposant'>"+n+"</div>"),l+="</li>",o(t).append(l),o(t).find("li img").css("width","40px")}}function t(){var d={container:window.doko.box_container,contents:window.doko.box_contents,total_price:window.doko.total_price,card_details:window.doko.box_card,gift_message:window.doko.gift_messages};null!=window.doko.discounts_applied&&(d.discounts_applied=window.doko.discounts_applied),o.post(doko_object.ajaxurl,{action:"doko_wc_add_to_cart",contents:d,bundle_id:o("div[data-bundle-id]").data("bundleId")},(function(d){var t=JSON.parse(d);t.doko_is_added_to_cart?(o("div.doko-spinner-loading").hide(),o("div.doko-spinner-complete").show(),o("div.doko-is-complete").show()):(o("div.doko-spinner-loading").hide(),o("div.doko-spinner-error").show(),o("div.doko-is-complete").show(),o("button.doko-go-to-cart").hide()),o("div#build-complete").append(t.doko_html_response_adc)}))}o("div.doko-spinner-loading").show(),o("div.doko-spinner-complete").hide(),o("div.doko-is-complete").hide(),o("div.doko-spinner-error").hide(),wp.hooks.addFilter("doko_is_dynamic_screen","doko",(function(o,d){return parseInt(d)!=parseInt(1)}),10,2),wp.hooks.addAction("doko_after_calculate_add_to_box","doko",(function(o,d,t){var i=d.productName;let e=doko_object.product_is_added_to_box_message;e=e.replace("%s",i),Snackbar.show({actionText:"Close",pos:"bottom-center",duration:1e4,text:e})}),20,3),wp.hooks.addAction("doko_after_calculate_add_to_box","doko",(function(t,i,e){var a=i.productId,n=i.quantity,r=i.productPrice,s=i.unique_id,c=i.variation_id,p=i.options,_=i.options_is_checked,l=JSON.parse(doko_step_identifier);if(1==e){if(wp.hooks.applyFilters("doko_execute_rule_on_page",!0,e)&&null!=doko_bundle_data){var u=wp.hooks.applyFilters("doko_enable_first_page_redirect",doko_bundle_data["enable-screen-redirect"],e);window.doko.box_container={product_id:a,product_qty:n,product_price:r,unique_id:s,variation_id:c,options:p};let _=r;for(var k in p)null!=p[k].amount&&(_+=p[k].amount);window.doko.screens["first-step"]={product_id:a,qty:i.quantity,amount:wp.hooks.applyFilters("doko_bundle_product_price",_,t,i,e),options:p},d(i,w=o("ul.doko-box-container"),!0,!0),"yes"==u&&o('ul.doko-btn-navigation button.doko-page-btn[data-btn-type="next"]').trigger("click")}}else if(wp.hooks.applyFilters("doko_execute_rule_on_page",!0,e)){var w=o("ul.doko-box-contents");wp.hooks.applyFilters("doko_add_product_to_navigation",!0,e)&&d(i,w,!1,!0),_&&(a="p"+a);var h=l[e];if("no"==window.doko.cardMode){let o=r;for(var k in p)null!=p[k].amount&&(o+=p[k].amount);null==window.doko.screens[h]&&(window.doko.screens[h]={}),window.doko.screens[h].hasOwnProperty(a)||(window.doko.screens[h][a]={product_id:a,qty:0,amount:wp.hooks.applyFilters("doko_bundle_product_price",o,t,i,e),options:p}),window.doko.screens[h][a].qty+=n,window.doko.box_contents.hasOwnProperty(a)?window.doko.box_contents[a].product_qty+=n:window.doko.box_contents[a]={product_id:i.productId,product_qty:n,product_price:r,unique_id:s,variation_id:c,options:p}}}wp.hooks.doAction("doko_execute_rule",e,a,n,r,s,c,t,i)}),30,3),wp.hooks.addAction("doko_after_calculate_add_to_box","doko",(function(o,d,t){hs_dk_rebuild_total_modal()}),50,3),wp.hooks.addAction("doko_delete_product_from_box","doko",(function(d){o("div.hs-dk-bundle-page").filter(":visible").data().pageId>1&&delete window.doko.box_contents[d]})),wp.hooks.addAction("doko_after_delete_product_from_box","doko",(function(o){hs_dk_rebuild_total_modal()})),wp.hooks.addAction("doko_after_click_navigate_to_page","doko",(function(d){d==o("div.hs-dk-bundle-page").length&&t()})),window.hs_dk_add_li_to_box=d,window.hs_dk_add_to_cart_wc=t}))}(jQuery); -
doko-box-builder/trunk/public/js/hs-doko-utils.js
r3230317 r3315238 24 24 2 25 25 ); 26 27 // display toast for saying a new product have been added to bundle gift box. 28 wp.hooks.addAction( 29 'doko_after_calculate_add_to_box', 30 'doko', 31 function ( product, productData, current_page ) { 32 var pname = productData['productName']; 33 let text = doko_object.product_is_added_to_box_message; 34 text = text.replace('%s', pname ); 35 Snackbar.show( { actionText: 'Close', pos: 'bottom-center', duration: 10000, text: text } ); 36 }, 37 20, 38 3 39 ); 40 41 26 42 27 43 // Trigger event to go to the next page. … … 38 54 var o_options_is_checked = productData['options_is_checked']; 39 55 var step_identifier = JSON.parse( doko_step_identifier ); 40 56 57 // store into the history the product added to the box. 58 if ( productData.current_page > 1 ) { 59 const historyData = productData; 60 window.doko.history.unshift( historyData ); 61 } 62 63 64 41 65 if ( current_page == 1 ) { 42 66 if ( wp.hooks.applyFilters( 'doko_execute_rule_on_page' , true , current_page ) ) { … … 66 90 67 91 window.doko.screens['first-step'] = { 92 product_id : pid, 68 93 qty : productData['quantity'], 69 94 amount : wp.hooks.applyFilters('doko_bundle_product_price', sprice, product, productData, current_page ), … … 107 132 if ( ! window.doko.screens[sidentifier].hasOwnProperty( pid ) ) { 108 133 window.doko.screens[sidentifier][pid] = { 134 product_id : pid, 109 135 qty : 0, 110 136 amount : wp.hooks.applyFilters('doko_bundle_product_price', sprice, product, productData, current_page ), … … 134 160 wp.hooks.doAction( 'doko_execute_rule', current_page, pid, pqty, pprice, puid, pvid, product, productData ); 135 161 }, 136 30, 162 10, 163 3 164 ); 165 166 wp.hooks.addAction( 167 'doko_after_calculate_add_to_box', 168 'doko', 169 function ( product, productData, current_page ) { 170 window.hs_dk_recalculate_total_html(); 171 hs_dk_rebuild_total_modal(); 172 }, 173 50, 137 174 3 138 175 ); … … 150 187 151 188 wp.hooks.addAction( 189 'doko_after_delete_product_from_box', 190 'doko', 191 function ( product_id ) { 192 hs_dk_rebuild_total_modal(); 193 } 194 ); 195 196 wp.hooks.addAction( 152 197 'doko_after_click_navigate_to_page', 153 198 'doko', 154 199 function ( current_page ) { 155 200 if ( current_page == $( 'div.hs-dk-bundle-page' ).length ) { 156 var doko_products = { 157 'container' : window.doko.box_container, 158 'contents' : window.doko.box_contents, 159 'total_price' : window.doko.total_price, 160 'card_details' : window.doko.box_card, 161 'gift_message' : window.doko.gift_messages 162 } 163 $.post( 164 doko_object.ajaxurl, 165 { 166 action : "doko_wc_add_to_cart", 167 contents : doko_products, 168 bundle_id : $( 'div[data-bundle-id]' ).data( 'bundleId' ), 169 170 }, 171 function ( response ) { 172 var json_resp = JSON.parse( response ); 173 if ( json_resp.doko_is_added_to_cart ) { 174 $( 'div.doko-spinner-loading' ).hide(); 175 $( 'div.doko-spinner-complete' ).show(); 176 $( 'div.doko-is-complete' ).show() 177 } else { 178 $( 'div.doko-spinner-loading' ).hide(); 179 $( 'div.doko-spinner-error' ).show(); 180 $( 'div.doko-is-complete' ).show(); 181 $( 'button.doko-go-to-cart' ).hide(); 182 // Snackbar.show( { actionText: 'Thanks!', pos: 'bottom-center', duration: 30000, text: "This bundle can't be added to the cart, an error occured, please write us to our support with the link of the page."} ); 183 } 184 $('div#build-complete').append(json_resp.doko_html_response_adc) 185 } 186 ) 187 } 188 } 189 ); 201 hs_dk_add_to_cart_wc(); 202 } 203 } 204 ); 205 206 207 208 function hs_dk_update_bottom_nav( product_id, qty ) { 209 $('ul.doko-box-contents li[data-product-id="' + product_id + '"]').find('div.doko-qty-exposant').html( qty ); 210 $('ul.doko-box-contents li[data-product-id="' + product_id + '"]').attr('data-product-qty', qty ); 211 } 212 213 function hs_dk_update_card_mode_details( product_id, qty ) { 214 $('table.doko-box-contents tr[data-product-id="'+product_id+'"]:eq(2)').html(qty); 215 $('table.doko-box-contents tr[data-product-id="'+product_id+'"]:eq(2)').attr('data-product-qty', qty ); 216 } 217 218 window.hs_dk_update_bottom_nav = hs_dk_update_bottom_nav; 219 window.hs_dk_update_card_mode_details = hs_dk_update_card_mode_details; 220 221 function hs_dk_get_table_row_to_box( product_data, ) { 222 var qty = product_data['quantity']; 223 var product_id = product_data['productId']; 224 var product_price = product_data['productPrice']; 225 var product_img_url = product_data['imageUrl']; 226 var hash_code = product_data['unique_id']; 227 var o_options_is_checked = product_data['options_is_checked']; 228 if ( o_options_is_checked ) { 229 product_id = "p"+product_id 230 } 231 var html = `<tr data-product-id="${product_id}" data-product-qty="${qty}" data-product-price="${product_price}" data-hash-code="${hash_code}"> 232 <td>${product_data['productName']}</td> 233 <td class="doko_style_to_hide">${qty}</td> 234 <td class="doko_style_to_hide">${product_price}</td> 235 <td>${product_price}</td> 236 <td><a class="doko-remove"><i class="fa fa-times" aria-hidden="true"></i></a></td> 237 </tr>`; 238 return html; 239 } 240 window.hs_dk_get_table_row_to_box = hs_dk_get_table_row_to_box; 241 242 243 // responsible for the box contents. 244 190 245 191 246 function hs_dk_add_li_to_box( product_data, parent_sibling, remove=true, is_bottom=true, updateMode=false ) { … … 224 279 } 225 280 html += "</li>"; 226 $( parent_sibling ).append( html ) .css( 'display','flex' ).css( 'list-style-type', 'none' )227 $( parent_sibling ).find( 'li img' ).css( ' height','initial' ).css( 'top','10%' ).css( 'position','absolute' ).css( 'width','initial' ).css( 'height','40px' )228 window.doko.rules = {}281 $( parent_sibling ).append( html ) 282 $( parent_sibling ).find( 'li img' ).css( 'width','40px' ) 283 // window.doko.rules = [] 229 284 } else { 230 285 // responsible for the box contents. … … 243 298 } 244 299 html += "</li>"; 245 $( parent_sibling ).append( html ) .css( 'display','flex' ).css( 'list-style-type', 'none' )246 $( parent_sibling ).find( 'li img' ).css( ' height','initial' ).css( 'top','10%' ).css( 'position','absolute' ).css( 'width','initial' ).css( 'height','40px' )300 $( parent_sibling ).append( html ) 301 $( parent_sibling ).find( 'li img' ).css( 'width','40px' ) 247 302 } 248 303 } … … 251 306 252 307 window.hs_dk_add_li_to_box = hs_dk_add_li_to_box; 308 309 310 /** 311 * create a cart into woocommerce. 312 */ 313 function hs_dk_add_to_cart_wc() { 314 var doko_products = { 315 'container' : window.doko.box_container, 316 'contents' : window.doko.box_contents, 317 'total_price' : window.doko.total_price, 318 'card_details' : window.doko.box_card, 319 'gift_message' : window.doko.gift_messages 320 } 321 if ( undefined != window.doko.discounts_applied ) { 322 doko_products.discounts_applied = window.doko.discounts_applied; 323 } 324 $.post( 325 doko_object.ajaxurl, 326 { 327 action : "doko_wc_add_to_cart", 328 contents : doko_products, 329 bundle_id : $( 'div[data-bundle-id]' ).data( 'bundleId' ), 330 331 }, 332 function ( response ) { 333 var json_resp = JSON.parse( response ); 334 if ( json_resp.doko_is_added_to_cart ) { 335 $( 'div.doko-spinner-loading' ).hide(); 336 $( 'div.doko-spinner-complete' ).show(); 337 $( 'div.doko-is-complete' ).show() 338 } else { 339 $( 'div.doko-spinner-loading' ).hide(); 340 $( 'div.doko-spinner-error' ).show(); 341 $( 'div.doko-is-complete' ).show(); 342 $( 'button.doko-go-to-cart' ).hide(); 343 // Snackbar.show( { actionText: 'Thanks!', pos: 'bottom-center', duration: 30000, text: "This bundle can't be added to the cart, an error occured, please write us to our support with the link of the page."} ); 344 } 345 $('div#build-complete').append(json_resp.doko_html_response_adc) 346 } 347 ) 348 } 349 350 window.hs_dk_add_to_cart_wc = hs_dk_add_to_cart_wc; 253 351 } 254 352 ); … … 256 354 })( jQuery ); 257 355 258 function check_in_list( value, array ) {259 return array.indexOf( value ) > -1;260 }261 262 window.hs_dk_check_in_list = check_in_list; -
doko-box-builder/trunk/templates/single-product/doko-products.php
r3230317 r3315238 57 57 global $product; 58 58 $product_type = $product->get_type(); 59 if ( $doko_display_variations_as_many && !in_array( $product_type, array('simple', 'variation') ) ) {60 $childrens = $product->get_children();61 $childrens = array_unique( $childrens );59 $childrens = $product->get_children(); 60 $childrens = array_unique( $childrens ); 61 if ( $doko_display_variations_as_many && count( $childrens ) > 0 && !in_array( $product_type, array('simple', 'variations') ) ) { 62 62 if ( count( $childrens ) > 0 ) { 63 63 foreach ( $childrens as $variation ) { … … 65 65 // prevent product out of stock to be added to the bundle. 66 66 if ( !$product->is_in_stock() || apply_filters( 'doko_skip_product_in_shortcode_loop', false, $product->get_id() ) ) { 67 continue;68 }69 // prevent product without price to used.70 if ( $product->get_price() == '' ) {71 67 continue; 72 68 } … … 80 76 // prevent product out of stock to be added to the bundle. 81 77 if ( !$product->is_in_stock() || apply_filters( 'doko_skip_product_in_shortcode_loop', false, $product->get_id() ) ) { 82 continue;83 }84 // prevent product without price to used.85 if ( $product->get_price() == '' ) {86 78 continue; 87 79 }
Note: See TracChangeset
for help on using the changeset viewer.