{"id":779,"date":"2026-08-13T06:18:42","date_gmt":"2026-08-12T22:18:42","guid":{"rendered":"https:\/\/seranabeauty.com\/cart\/"},"modified":"2026-10-11T23:36:59","modified_gmt":"2026-10-11T15:36:59","slug":"cart","status":"publish","type":"page","link":"https:\/\/seranabeauty.com\/cn\/cart\/","title":{"rendered":"\u8d2d\u7269\u8f66"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"779\" class=\"elementor elementor-779 elementor-3641\" data-elementor-settings=\"{&quot;element_pack_global_tooltip_width&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_width_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_width_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;element_pack_global_tooltip_padding&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_padding_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_padding_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true},&quot;element_pack_global_tooltip_border_radius_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;top&quot;:&quot;&quot;,&quot;right&quot;:&quot;&quot;,&quot;bottom&quot;:&quot;&quot;,&quot;left&quot;:&quot;&quot;,&quot;isLinked&quot;:true}}\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6243674 serana-cart e-flex e-con-boxed e-con e-parent\" data-id=\"6243674\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2e5e45c elementor-widget elementor-widget-shortcode\" data-id=\"2e5e45c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5fb7369 elementor-widget elementor-widget-html\" data-id=\"5fb7369\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<script>\r\n(function ($) {\r\n\r\n    'use strict';\r\n\r\n    const cartSelector = '.serana-cart';\r\n\r\n    let updateTimer = null;\r\n\r\n\r\n    \/* =====================================================\r\n       CREATE REAL +\/- BUTTONS\r\n    ===================================================== *\/\r\n\r\n    function initSeranaQuantity() {\r\n\r\n        $(cartSelector + ' .quantity').each(function () {\r\n\r\n            const $quantity = $(this);\r\n            const $input = $quantity.find('input.qty').first();\r\n\r\n            if (!$input.length) {\r\n                return;\r\n            }\r\n\r\n\r\n            \/* Remove old custom buttons *\/\r\n\r\n            $quantity\r\n                .children('.serana-qty-btn')\r\n                .remove();\r\n\r\n\r\n            \/*\r\n             Remove theme\/plugin +\/- buttons.\r\n             Keep WooCommerce real qty input.\r\n            *\/\r\n\r\n            $quantity\r\n                .children('.minus, .plus, .serana-minus, .serana-plus')\r\n                .remove();\r\n\r\n\r\n            \/* MINUS *\/\r\n\r\n            $('<button>', {\r\n                type: 'button',\r\n                class: 'serana-qty-btn serana-qty-minus',\r\n                text: '\u2212',\r\n                'aria-label': 'Decrease quantity'\r\n            }).insertBefore($input);\r\n\r\n\r\n            \/* PLUS *\/\r\n\r\n            $('<button>', {\r\n                type: 'button',\r\n                class: 'serana-qty-btn serana-qty-plus',\r\n                text: '+',\r\n                'aria-label': 'Increase quantity'\r\n            }).insertAfter($input);\r\n\r\n        });\r\n\r\n    }\r\n\r\n\r\n    \/* =====================================================\r\n       TRIGGER REAL WOOCOMMERCE CART UPDATE\r\n    ===================================================== *\/\r\n\r\n    function updateWooCommerceCart() {\r\n\r\n        clearTimeout(updateTimer);\r\n\r\n\r\n        updateTimer = setTimeout(function () {\r\n\r\n            const $updateButton =\r\n                $(cartSelector + ' button[name=\"update_cart\"]');\r\n\r\n\r\n            if (!$updateButton.length) {\r\n                return;\r\n            }\r\n\r\n\r\n            \/*\r\n             WooCommerce normally disables this button\r\n             until quantity changes.\r\n            *\/\r\n\r\n            $updateButton\r\n                .prop('disabled', false)\r\n                .removeAttr('disabled');\r\n\r\n\r\n            \/*\r\n             Trigger WooCommerce's REAL update button.\r\n             WooCommerce will then recalculate:\r\n             Product subtotal\r\n             Cart subtotal\r\n             Shipping\r\n             Total\r\n            *\/\r\n\r\n            $updateButton.trigger('click');\r\n\r\n        }, 350);\r\n\r\n    }\r\n\r\n\r\n    \/* =====================================================\r\n       CLICK +\r\n    ===================================================== *\/\r\n\r\n    $(document)\r\n        .off('click.seranaQtyPlus')\r\n        .on(\r\n            'click.seranaQtyPlus',\r\n            cartSelector + ' .serana-qty-plus',\r\n            function (event) {\r\n\r\n                event.preventDefault();\r\n                event.stopPropagation();\r\n\r\n\r\n                const $input = $(this)\r\n                    .siblings('input.qty')\r\n                    .first();\r\n\r\n\r\n                if (!$input.length) {\r\n                    return;\r\n                }\r\n\r\n\r\n                let current =\r\n                    parseFloat($input.val());\r\n\r\n\r\n                let step =\r\n                    parseFloat($input.attr('step'));\r\n\r\n\r\n                let max =\r\n                    parseFloat($input.attr('max'));\r\n\r\n\r\n                if (isNaN(current)) {\r\n                    current = 0;\r\n                }\r\n\r\n\r\n                if (isNaN(step) || step <= 0) {\r\n                    step = 1;\r\n                }\r\n\r\n\r\n                let next =\r\n                    current + step;\r\n\r\n\r\n                \/* Respect product maximum *\/\r\n\r\n                if (\r\n                    !isNaN(max) &&\r\n                    max > 0 &&\r\n                    next > max\r\n                ) {\r\n                    next = max;\r\n                }\r\n\r\n\r\n                $input\r\n                    .val(next)\r\n                    .trigger('input')\r\n                    .trigger('change');\r\n\r\n\r\n                updateWooCommerceCart();\r\n\r\n            }\r\n        );\r\n\r\n\r\n    \/* =====================================================\r\n       CLICK -\r\n    ===================================================== *\/\r\n\r\n    $(document)\r\n        .off('click.seranaQtyMinus')\r\n        .on(\r\n            'click.seranaQtyMinus',\r\n            cartSelector + ' .serana-qty-minus',\r\n            function (event) {\r\n\r\n                event.preventDefault();\r\n                event.stopPropagation();\r\n\r\n\r\n                const $input = $(this)\r\n                    .siblings('input.qty')\r\n                    .first();\r\n\r\n\r\n                if (!$input.length) {\r\n                    return;\r\n                }\r\n\r\n\r\n                let current =\r\n                    parseFloat($input.val());\r\n\r\n\r\n                let step =\r\n                    parseFloat($input.attr('step'));\r\n\r\n\r\n                let min =\r\n                    parseFloat($input.attr('min'));\r\n\r\n\r\n                if (isNaN(current)) {\r\n                    current = 1;\r\n                }\r\n\r\n\r\n                if (isNaN(step) || step <= 0) {\r\n                    step = 1;\r\n                }\r\n\r\n\r\n                if (isNaN(min)) {\r\n                    min = 1;\r\n                }\r\n\r\n\r\n                let next =\r\n                    current - step;\r\n\r\n\r\n                \/* Do not go below WooCommerce min *\/\r\n\r\n                if (next < min) {\r\n                    next = min;\r\n                }\r\n\r\n\r\n                $input\r\n                    .val(next)\r\n                    .trigger('input')\r\n                    .trigger('change');\r\n\r\n\r\n                updateWooCommerceCart();\r\n\r\n            }\r\n        );\r\n\r\n\r\n    \/* =====================================================\r\n       INITIALIZE\r\n    ===================================================== *\/\r\n\r\n    $(function () {\r\n        initSeranaQuantity();\r\n    });\r\n\r\n\r\n    \/* =====================================================\r\n       WOOCOMMERCE AJAX RELOAD\r\n\r\n       WooCommerce replaces cart HTML after update,\r\n       therefore buttons need to be recreated.\r\n    ===================================================== *\/\r\n\r\n    $(document.body)\r\n        .off(\r\n            'updated_wc_div.seranaQty updated_cart_totals.seranaQty'\r\n        )\r\n        .on(\r\n            'updated_wc_div.seranaQty updated_cart_totals.seranaQty',\r\n            function () {\r\n\r\n                initSeranaQuantity();\r\n\r\n            }\r\n        );\r\n\r\n})(jQuery);\r\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_joinchat":[],"footnotes":""},"class_list":["post-779","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/pages\/779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/comments?post=779"}],"version-history":[{"count":335,"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/pages\/779\/revisions"}],"predecessor-version":[{"id":3984,"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/pages\/779\/revisions\/3984"}],"wp:attachment":[{"href":"https:\/\/seranabeauty.com\/cn\/wp-json\/wp\/v2\/media?parent=779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}