title: Woocommerce "your cart is currently empty" but only outside of preview mode? (custom checkout form)
body: <p>In WordPress I'm using an &quot;in-page&quot; checkout custom form where people fill the form directly IN the page where the product is displayed and they can pay directly from there without going throught the cart page.</p>
  <p>It works fine while I'm in preview mode and in the same Chrome window: the order get processed, I can pay with whatever and everything just works. However if I open the page in another window or browser (or my phone), after I press the button to confirm the order, I get sent to the &quot;your cart is empty&quot; page and no order is processed.
  It's really weird that it works only in preview mode.</p>
  <p>I already cleared all possible caches from my hosting domain and even cleared the cookies for that site from my browser, however it still doesn't work.</p>
  <p>This is the custom code for the checkout form if it can help:</p>
  <pre><code>&lt;?php
  // In page checkout form
  setlocale(LC_TIME, &quot;it_IT&quot;);
  
  $productId = $GLOBALS['inpage_form_product'];
  $options = $GLOBALS['inpage_form_options'];
  
  wp_enqueue_style('inpage-form', get_template_directory_uri() . ($options['inpage_form_style'] ?? '/inpage-form.css'));
  wp_enqueue_script('inpage-form', get_template_directory_uri() . '/assets/js/inpage-form.js');
  
  $product = wc_get_product($productId);
  $variations = $product-&gt;get_available_variations();
  
  $variations = array_map(function ($variation) use ($options) {
      return [
          'id' =&gt; $variation['variation_id'],
          'label' =&gt; $variation['attributes']['attribute_quantita'],
          'price' =&gt; $variation['display_price'],
          'regular_price' =&gt; $variation['display_regular_price'],
          'quantity' =&gt; strip_tags($variation['variation_description']),
          'highlight' =&gt; $options['highlight_label_' . $variation['variation_id']] ?? false,
          'highlight_color' =&gt; $options['highlight_label_color_' . $variation['variation_id']] ?? false,
      ];
  }, $variations);
  
  $initialVariation = $variations[0];
  
  function formatPrice($price)
  {
      echo number_format($price, 2, ',', '') . '€';
  }
  
  WC()-&gt;cart-&gt;empty_cart();
  WC()-&gt;cart-&gt;add_to_cart($productId, 1, $initialVariation['id']);
  
  if(class_exists('WC_Gateway_Stripe')) {
      $stripe = new WC_Gateway_Stripe();
  
      $suffix = defined('SCRIPT_DEBUG') &amp;&amp; SCRIPT_DEBUG ? '' : '.min';
      wp_register_style('stripe_styles', plugins_url('assets/css/stripe-styles.css', WC_STRIPE_MAIN_FILE), [], WC_STRIPE_VERSION);
      wp_enqueue_style('stripe_styles');
  
      wp_register_script('stripe', 'https://js.stripe.com/v3/', '', '3.0', true);
      wp_register_script('woocommerce_stripe', plugins_url('assets/js/stripe' . $suffix . '.js', WC_STRIPE_MAIN_FILE), ['jquery-payment', 'stripe'], WC_STRIPE_VERSION, true);
      wp_register_script('woocommerce_gateway_stripe', plugins_url('assets/js/stripe' . $suffix . '.js', WC_STRIPE_MAIN_FILE), ['jquery-payment', 'stripe'], WC_STRIPE_VERSION, true);
  
      wp_localize_script(
          'woocommerce_stripe',
          'wc_stripe_params',
          apply_filters('wc_stripe_params', $stripe-&gt;javascript_params())
      );
  
      $stripe-&gt;tokenization_script();
      wp_enqueue_script('woocommerce_stripe');
  }
  
  
  wp_enqueue_script('wc-country-select');
  wp_enqueue_script('selectWoo');
  wp_enqueue_style('select2');
  
  $shippingMethods = WC()-&gt;shipping()-&gt;get_packages()[0]['rates'];
  $chosenMethod = isset(WC()-&gt;session-&gt;chosen_shipping_methods[0]) ? WC()-&gt;session-&gt;chosen_shipping_methods[0] : '';
  
  function business_day($days, $abbrv = false)
  {
      if($abbrv) {
          return utf8_encode(strtolower(strftime('%a %e. %m.', strtotime(&quot;+$days weekdays&quot;))));
      }
      return utf8_encode(strtolower(strftime('%A', strtotime(&quot;+$days weekdays&quot;))));
  }
  
  function add_delivery_payment_info()
  {
      printf('&lt;div class=&quot;inpage-form__delivery_payment&quot;&gt;');
      printf('&lt;div class=&quot;inpage-form__delivery_payment__wrapper&quot;&gt;');
      printf('&lt;div&gt;');
      printf('&lt;div class=&quot;inpage-form__delivery_payment__title&quot;&gt;Oggi non paghi niente!&lt;/div&gt;');
      printf('&lt;div class=&quot;inpage-form__delivery_payment__description&quot;&gt;Paghi alla consegna &lt;/div&gt;');
      printf('&lt;/div&gt;');
      printf('
      &lt;svg enable-background=&quot;new 0 0 24 24&quot; height=&quot;512&quot; viewBox=&quot;0 0 24 24&quot; width=&quot;512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;m19 4.86-8.991 4.383-3.501-1.701-1.458-.711-4.05-1.971 8.991-4.374 3.834 1.864 1.53.738z&quot; fill=&quot;#ffa726&quot;/&gt;&lt;path d=&quot;m9.99 19.779-9.49-4.939v-9.48l9.49 4.37z&quot; fill=&quot;#ffcc80&quot;/&gt;&lt;path d=&quot;m19.5 5.36v9.48l-9.49 4.939v-10.049z&quot; fill=&quot;#ffb74d&quot;/&gt;&lt;path d=&quot;m17.5 23.4c-.142 0-.283-.044-.403-.133-.558-.415-5.447-4.141-5.447-7.302 0-1.855 1.514-3.364 3.375-3.364.957 0 1.848.401 2.475 1.074.627-.673 1.518-1.074 2.475-1.074 1.861 0 3.375 1.509 3.375 3.364 0 3.161-4.89 6.888-5.447 7.302-.12.089-.261.133-.403.133z&quot; fill=&quot;#f44336&quot;/&gt;&lt;path d=&quot;m17.5 24c-.157 0-.314-.05-.447-.148-.62-.46-6.053-4.601-6.053-8.114 0-2.061 1.682-3.738 3.75-3.738 1.063 0 2.054.446 2.75 1.194.696-.748 1.687-1.194 2.75-1.194 2.068 0 3.75 1.677 3.75 3.738 0 3.513-5.433 7.653-6.053 8.113-.133.099-.29.149-.447.149zm-2.75-10.5c-1.241 0-2.25 1.004-2.25 2.238 0 2.142 3.276 5.191 5 6.564 1.724-1.374 5-4.427 5-6.564 0-1.234-1.009-2.238-2.25-2.238-.897 0-1.707.527-2.062 1.343-.238.547-1.137.547-1.375 0-.356-.816-1.166-1.343-2.063-1.343z&quot;/&gt;&lt;path d=&quot;m10.007 10.5c-.278 0-.545-.155-.675-.422-.181-.372-.026-.821.346-1.002l9.244-4.5c.234-.114.507-.099.726.039.219.136.352.377.352.635v4c0 .414-.336.75-.75.75s-.75-.336-.75-.75v-2.801l-8.166 3.975c-.105.052-.217.076-.327.076z&quot;/&gt;&lt;path d=&quot;m9.25 20c-.125 0-.25-.03-.366-.096l-8.5-4.75c-.237-.132-.384-.383-.384-.654v-9.25c0-.258.133-.499.353-.636.218-.138.493-.153.726-.039l9.244 4.5c.373.181.527.63.346 1.002-.182.373-.632.525-1.002.346l-8.167-3.974v7.61l8.116 4.536c.362.201.491.658.289 1.021-.137.245-.393.384-.655.384z&quot;/&gt;&lt;path d=&quot;m.75 6c-.277 0-.544-.155-.674-.422-.181-.372-.026-.821.346-1.002l9.244-4.5c.207-.101.449-.101.656 0l9.256 4.5c.373.181.527.63.346 1.002s-.629.529-1.002.346l-8.928-4.34-8.916 4.34c-.105.052-.217.076-.328.076z&quot;/&gt;&lt;path d=&quot;m5.25 11.99c-.414 0-.75-.336-.75-.75v-3.8c0-.283.16-.542.413-.67l9.09-4.581c.369-.186.82-.038 1.007.333.186.37.038.821-.333 1.007l-8.677 4.373v3.338c0 .414-.336.75-.75.75z&quot;/&gt;&lt;/svg&gt;');
      printf('&lt;/div&gt;');
      printf('&lt;/div&gt;');
  }
  
  add_action('woocommerce_review_order_before_submit', 'add_delivery_payment_info');
  
  ?&gt;
  &lt;div class=&quot;inpage-form&quot; data-product-id=&quot;&lt;?php echo $productId; ?&gt;&quot;&gt;
      &lt;div class=&quot;inpage-form__form-card&quot;&gt;
          &lt;h4&gt;Modulo d’ordine&lt;/h4&gt;
          &lt;div class=&quot;inpage-form__total&quot;&gt;
              &lt;span class=&quot;inpage-form__regular-price&quot;&gt;&lt;?php formatPrice($initialVariation['regular_price']); ?&gt;&lt;/span&gt;
              &lt;span class=&quot;inpage-form__price&quot;&gt;&lt;?php formatPrice($initialVariation['price']); ?&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;!--&lt;div class=&quot;inpage-form__countdown&quot;&gt;
              &lt;svg enable-background=&quot;new 0 0 24 24&quot; height=&quot;512&quot; viewBox=&quot;0 0 24 24&quot; width=&quot;512&quot;
                   xmlns=&quot;http://www.w3.org/2000/svg&quot; fill=&quot;currentColor&quot;&gt;
                  &lt;path d=&quot;m6.5 19h-2c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h2c.276 0 .5.224.5.5s-.224.5-.5.5z&quot;/&gt;
                  &lt;path d=&quot;m22.75 19h-1.25c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h.835l.674-3.592c-.009-1.838-1.579-3.408-3.509-3.408h-3.283l-1.591 7h2.874c.276 0 .5.224.5.5s-.224.5-.5.5h-3.5c-.152 0-.296-.069-.391-.188-.095-.118-.131-.274-.097-.422l1.818-8c.052-.229.254-.39.488-.39h3.682c2.481 0 4.5 2.019 4.5 4.5l-.759 4.092c-.044.237-.25.408-.491.408z&quot;/&gt;
                  &lt;path d=&quot;m19.5 21c-1.378 0-2.5-1.121-2.5-2.5s1.122-2.5 2.5-2.5 2.5 1.121 2.5 2.5-1.122 2.5-2.5 2.5zm0-4c-.827 0-1.5.673-1.5 1.5s.673 1.5 1.5 1.5 1.5-.673 1.5-1.5-.673-1.5-1.5-1.5z&quot;/&gt;
                  &lt;path d=&quot;m8.5 21c-1.378 0-2.5-1.121-2.5-2.5s1.122-2.5 2.5-2.5 2.5 1.121 2.5 2.5-1.122 2.5-2.5 2.5zm0-4c-.827 0-1.5.673-1.5 1.5s.673 1.5 1.5 1.5 1.5-.673 1.5-1.5-.673-1.5-1.5-1.5z&quot;/&gt;
                  &lt;path d=&quot;m6.5 10h-4c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h4c.276 0 .5.224.5.5s-.224.5-.5.5z&quot;/&gt;
                  &lt;path d=&quot;m6.5 13h-5c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h5c.276 0 .5.224.5.5s-.224.5-.5.5z&quot;/&gt;
                  &lt;path d=&quot;m6.5 16h-6c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h6c.276 0 .5.224.5.5s-.224.5-.5.5z&quot;/&gt;
                  &lt;path d=&quot;m14 19h-3.5c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h3.101l2.272-10h-11.373c-.276 0-.5-.224-.5-.5s.224-.5.5-.5h12c.152 0 .296.069.391.188.095.118.131.274.097.422l-2.5 11c-.052.229-.255.39-.488.39z&quot;/&gt;
              &lt;/svg&gt;
              &lt;div&gt;
                   &lt;div class=&quot;inpage-form__countdown__title&quot;&gt;Affrettati con l'acquisto&lt;/div&gt;
                  &lt;div class=&quot;inpage-form__countdown__description&quot;&gt;Se ordini entro
                      &lt;time class=&quot;inpage-form__countdown_hook&quot;&gt;30:00&lt;/time&gt;
                      minuti riceverai &lt;strong&gt;&lt;?php //echo business_day(2); ?&gt;&lt;/strong&gt;&lt;/div&gt;
                  &lt;div class=&quot;inpage-form__countdown__description&quot;&gt;Se ordini entro
                      &lt;time class=&quot;inpage-form__countdowner_hook&quot;&gt;30:00&lt;/time&gt;
                      minuti riceverai &lt;strong&gt;&lt;? //php echo business_day(2); ?&gt;&lt;/strong&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;--&gt;
          &lt;?php if(count($variations) &gt; 1): ?&gt;
          &lt;ul class=&quot;inpage-form__options&quot;&gt;
              &lt;?php foreach ($variations as $variation) :
                  $singlePrice = $variation['price'] / (float) $variation['quantity'];
              ?&gt;
                  &lt;li class=&quot;inpage-form__option &lt;?php echo $variation['highlight'] ? 'inpage-form__option-highlight' : ''; ?&gt;&quot;&gt;
                      &lt;input
                              type=&quot;radio&quot;
                              name=&quot;quantity&quot;
                              id=&quot;option-&lt;?php echo $variation['id']; ?&gt;&quot; value=&quot;&lt;?php echo $variation['id']; ?&gt;&quot;
                              data-regular-price=&quot;&lt;?php echo $variation['regular_price']; ?&gt;&quot;
                              data-price=&quot;&lt;?php echo $variation['price']; ?&gt;&quot;
                      /&gt;
                      &lt;?php if ($variation['highlight']) { ?&gt;
                          &lt;div class=&quot;inpage-form__option-top&quot; &lt;?php echo $variation['highlight_color'] ? 'style=&quot;background-color:'. $variation['highlight_color'].'&quot;' : ''; ?&gt;&gt;
                              &lt;?php echo $variation['highlight']; ?&gt;
                          &lt;/div&gt;
                      &lt;?php } ?&gt;
                      &lt;label for=&quot;option-&lt;?php echo $variation['id']; ?&gt;&quot;&gt;
                          &lt;span class=&quot;inpage-form__quantity&quot;&gt;&lt;?php echo $variation['quantity']; ?&gt;&lt;small&gt;x&lt;/small&gt;&lt;/span&gt;
                          &lt;span class=&quot;inpage-form__option-main&quot;&gt;
                          &lt;span class=&quot;inpage-form__single-price&quot;&gt;&lt;?php formatPrice($singlePrice); ?&gt;&lt;/span&gt;
                          &lt;span class=&quot;inpage-form__quantity-info&quot;&gt;a pezzo&lt;/span&gt;
                      &lt;/span&gt;
                      &lt;/label&gt;
                  &lt;/li&gt;
              &lt;?php endforeach; ?&gt;
          &lt;/ul&gt;
          &lt;?php endif; ?&gt;
          &lt;div class=&quot;inpage-form__checkout&quot;&gt;
              &lt;form name=&quot;checkout&quot; method=&quot;post&quot; class=&quot;checkout woocommerce-checkout&quot;
                    action=&quot;&lt;?php echo esc_url(wc_get_checkout_url()); ?&gt;&quot; enctype=&quot;multipart/form-data&quot;&gt;
  
                  &lt;div class=&quot;woocommerce-billing-fields__field-wrapper&quot;&gt;
                      &lt;p class=&quot;form-row form-row-wide validate-required validate-email&quot; id=&quot;billing_email_field&quot;
                         data-priority=&quot;110&quot;&gt;
                          &lt;input type=&quot;email&quot; class=&quot;input-text&quot; name=&quot;billing_email&quot; id=&quot;billing_email&quot;
                                 placeholder=&quot;Indirizzo email &quot; value=&quot;&quot; autocomplete=&quot;email username&quot;/&gt;
                          &lt;label for=&quot;billing_email&quot; class=&quot;&quot;&gt;Indirizzo email&lt;/label&gt;
                      &lt;/p&gt;
                      &lt;p class=&quot;form-row form-row-wide validate-required validate-phone&quot; id=&quot;billing_phone_field&quot;
                         data-priority=&quot;100&quot;&gt;
                          &lt;input type=&quot;tel&quot; class=&quot;input-text &quot;
                                 name=&quot;billing_phone&quot; id=&quot;billing_phone&quot;
                                 placeholder=&quot;Telefono&quot; value=&quot;&quot;
                                 autocomplete=&quot;tel&quot;/&gt;
                          &lt;label for=&quot;billing_phone&quot; class=&quot;&quot;&gt;Telefono&lt;/label&gt;
                      &lt;/p&gt;
                      &lt;div class=&quot;inpage-form__form-row-online&quot;&gt;
                          &lt;p class=&quot;form-row form-row-first validate-required&quot; id=&quot;billing_first_name_field&quot;
                             data-priority=&quot;10&quot;&gt;
                              &lt;input type=&quot;text&quot; class=&quot;input-text &quot; name=&quot;billing_first_name&quot; id=&quot;billing_first_name&quot;
                                     placeholder=&quot;Nome&quot; value=&quot;&quot; autocomplete=&quot;given-name&quot;/&gt;
                              &lt;label for=&quot;billing_first_name&quot; class=&quot;&quot;&gt;Nome&lt;/label&gt;
                          &lt;/p&gt;
                          &lt;p class=&quot;form-row form-row-last validate-required&quot; id=&quot;billing_last_name_field&quot;
                             data-priority=&quot;20&quot;&gt;
                              &lt;input type=&quot;text&quot; class=&quot;input-text &quot; name=&quot;billing_last_name&quot; id=&quot;billing_last_name&quot;
                                     placeholder=&quot;Cognome&quot; value=&quot;&quot; autocomplete=&quot;family-name&quot;/&gt;
                              &lt;label for=&quot;billing_last_name&quot; class=&quot;&quot;&gt;Cognome&lt;/label&gt;
                          &lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt; 
                  
  
                  &lt;?php
                      if($options['insurance_product'] ?? false) :
                        $insuranceProduct = wc_get_product($options['insurance_product']);
                      ?&gt;
                      &lt;label class=&quot;inpage-form__insurance inpage-form__extras&quot; data-product-id=&quot;&lt;?php echo $options['insurance_product']; ?&gt;&quot;&gt;
                          &lt;svg id=&quot;color&quot; enable-background=&quot;new 0 0 24 24&quot; height=&quot;512&quot; viewBox=&quot;0 0 24 24&quot; width=&quot;512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;path d=&quot;m23.491 1.826-5.25-1.786c-.156-.054-.326-.054-.482 0l-5.25 1.786c-.305.103-.509.388-.509.71v4.018c0 4.904 5.474 7.288 5.707 7.387.094.039.193.059.293.059s.199-.02.293-.06c.233-.099 5.707-2.482 5.707-7.386v-4.018c0-.322-.204-.607-.509-.71z&quot; fill=&quot;#4caf50&quot;/&gt;&lt;path d=&quot;m21.286 5.618-2.75 3.5c-.168.214-.417.351-.688.377l-.098.005c-.237 0-.469-.084-.65-.241l-1.75-1.5c-.42-.359-.469-.991-.108-1.41.359-.419.991-.467 1.409-.108l.958.821 2.105-2.679c.341-.434.969-.511 1.404-.168.434.34.51.969.168 1.403z&quot; fill=&quot;#fff&quot;/&gt;&lt;path d=&quot;m18 0h-.019c-.075.002-.15.015-.222.04l-5.25 1.786c-.305.103-.509.388-.509.71v4.018c0 4.904 5.474 7.288 5.707 7.387.094.039.193.059.293.059v-4.532c-.05.013-.101.022-.152.027l-.098.005c-.237 0-.469-.084-.65-.241l-1.75-1.5c-.42-.359-.469-.991-.108-1.41.197-.23.477-.349.759-.349.23 0 .462.079.649.24l.958.821.392-.498z&quot; fill=&quot;#429846&quot;/&gt;&lt;path d=&quot;m16.001 6c-.282 0-.562.118-.76.349-.36.419-.312 1.051.108 1.41l1.75 1.5c.182.157.414.241.651.241l.098-.005c.051-.005.102-.014.152-.027v-2.905l-.392.498-.958-.82c-.188-.162-.419-.241-.649-.241z&quot; fill=&quot;#dedede&quot;/&gt;&lt;path d=&quot;m22 17.5c-2 0-6 2.531-8 2.531s-4.25-1.531-4.25-1.531 2.693.5 4.25.5 2-.531 2-1.25c0-1.75-2.973-2.022-4.476-2.25-1.477-.822-3.037-1.333-5.481-1.54-.015.142-.037.284-.077.425l-2.009 7.08c2.275 1.036 6.986 2.535 9.043 2.535 3 0 11-4 11-5s-1-1.5-2-1.5z&quot; fill=&quot;#ffcc80&quot;/&gt;&lt;path d=&quot;m3.5 22h-2.75c-.414 0-.75-.336-.75-.75v-8.5c0-.414.336-.75.75-.75 3.505 0 5.138 1.216 5.205 1.268.242.185.349.498.27.792l-2 7.386c-.089.327-.386.554-.725.554z&quot; fill=&quot;#2196f3&quot;/&gt;&lt;path d=&quot;m22 17.5c-2 0-6 2.531-8 2.531s-4.25-1.531-4.25-1.531l-4.472-.944-1.053 3.89c-.011.042-.026.081-.044.12 2.348 1.028 6.828 2.434 8.819 2.434 3 0 11-4 11-5s-1-1.5-2-1.5z&quot; fill=&quot;#deb26f&quot;/&gt;&lt;path d=&quot;m0 16.442v4.808c0 .414.336.75.75.75h2.75c.296 0 .56-.173.681-.435.018-.038.032-.078.044-.12l1.053-3.89z&quot; fill=&quot;#1d83d4&quot;/&gt;&lt;/svg&gt;
                          &lt;div class=&quot;inpage-form__insurance__wrapper&quot;&gt;
                              &lt;?php
                                  if($insuranceProduct-&gt;get_regular_price() !== $insuranceProduct-&gt;get_price()) {
                                      printf('&lt;div class=&quot;inpage-form__insurance__title&quot;&gt;Assicura il tuo pacchetto a soli &lt;del&gt;%s&lt;/del&gt; %s&lt;/div&gt;', wc_price($insuranceProduct-&gt;get_regular_price()), wc_price($insuranceProduct-&gt;get_price()));
                                  } else {
                                      printf('&lt;div class=&quot;inpage-form__insurance__title&quot;&gt;Assicura il tuo pacchetto a soli %s&lt;/div&gt;', wc_price($insuranceProduct-&gt;get_price()));
                                  }
                              ?&gt;
                              &lt;div class=&quot;inpage-form__insurance__description&quot;&gt;Se il prodotto nella confezione è danneggiato, te ne invieremo uno nuovo senza alcuna domanda.&lt;/div&gt;
                          &lt;/div&gt;
                          &lt;input type=&quot;checkbox&quot; name=&quot;insurance_enable&quot;&gt;
                      &lt;/label&gt;
                      &lt;?php
                      endif
                  ?&gt;
  
                  &lt;?php
                      if($options['gift_product'] ?? false) :
                        $giftProduct = wc_get_product($options['gift_product']);
                      ?&gt;
                      &lt;label class=&quot;inpage-form__gift inpage-form__extras&quot; data-product-id=&quot;&lt;?php echo $options['gift_product']; ?&gt;&quot;&gt;
                          &lt;svg id=&quot;Capa_1&quot; enable-background=&quot;new 0 0 512 512&quot; height=&quot;512&quot; viewBox=&quot;0 0 512 512&quot; width=&quot;512&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g fill=&quot;#fbe77b&quot;&gt;&lt;path d=&quot;m214.374 64.52s-64.52-64.52-139.447-64.52c-43.707 0-60.358 29.138-60.358 58.276s17.691 58.276 49.951 58.276h149.854z&quot;/&gt;&lt;path d=&quot;m214.374 64.52s-64.52-64.52-139.447-64.52c-43.707 0-60.358 29.138-60.358 58.276s17.691 58.276 49.951 58.276h149.854z&quot;/&gt;&lt;path d=&quot;m297.626 64.52s64.52-64.52 139.447-64.52c43.707 0 60.358 29.138 60.358 58.276s-17.691 58.276-49.951 58.276h-149.854z&quot;/&gt;&lt;/g&gt;&lt;path d=&quot;m492 199.805h-472c-11.046 0-20-8.954-20-20v-43.252c0-11.046 8.954-20 20-20h472c11.046 0 20 8.954 20 20v43.252c0 11.046-8.954 20-20 20z&quot; fill=&quot;#fb636f&quot;/&gt;&lt;path d=&quot;m484.943 116.553v83.252h6.453c11.379 0 20.604-9.225 20.604-20.604v-42.045c0-11.379-9.225-20.604-20.604-20.604h-6.453z&quot; fill=&quot;#fa4954&quot;/&gt;&lt;path d=&quot;m193.561 116.553h124.878v83.252h-124.878z&quot; fill=&quot;#fbe77b&quot;/&gt;&lt;path d=&quot;m464.943 512h-417.886c-11.046 0-20-8.954-20-20v-292.195h457.886v292.195c0 11.046-8.954 20-20 20z&quot; fill=&quot;#fb636f&quot;/&gt;&lt;path d=&quot;m27.057 199.805h457.886v24.976h-457.886z&quot; fill=&quot;#fa4954&quot;/&gt;&lt;path d=&quot;m214.374 199.805h83.252v312.195h-83.252z&quot; fill=&quot;#fbe77b&quot;/&gt;&lt;path d=&quot;m214.374 199.805h83.252v24.976h-83.252z&quot; fill=&quot;#fcdd2e&quot;/&gt;&lt;path d=&quot;m326.764 95.74c-4.333 0-8.045-2.65-9.611-6.416 2.685-.986 5.58-1.951 8.585-2.798 4.107-1.158 6.498-5.426 5.341-9.533s-5.425-6.499-9.533-5.341c-1.773.5-3.505 1.035-5.189 1.589v-24.848c-11.859 9.256-18.732 16.127-18.732 16.127v52.033h149.855c17.376 0 30.516-8.46 38.951-20.813z&quot; fill=&quot;#fcdd2e&quot;/&gt;&lt;path d=&quot;m195.642 48.393v24.848c-1.683-.554-3.416-1.089-5.189-1.589-4.104-1.157-8.375 1.233-9.533 5.341-1.157 4.107 1.233 8.375 5.341 9.533 2.998.845 5.895 1.812 8.584 2.8-1.566 3.765-5.278 6.413-9.61 6.413h-159.666c8.435 12.353 21.575 20.813 38.951 20.813h149.854v-52.032s-6.873-6.871-18.732-16.127z&quot; fill=&quot;#fcdd2e&quot;/&gt;&lt;path d=&quot;m297.626 116.553h-83.252v-52.602c0-7.732 6.268-14 14-14h55.252c7.732 0 14 6.268 14 14z&quot; fill=&quot;#fbe77b&quot;/&gt;&lt;path d=&quot;m214.374 95.74h83.252v20.813h-83.252z&quot; fill=&quot;#fcdd2e&quot;/&gt;&lt;/svg&gt;
                          &lt;div class=&quot;inpage-form__gift__wrapper&quot;&gt;
                              &lt;div class=&quot;inpage-form__gift__title&quot;&gt;Abbiamo un regalo per te!&lt;/div&gt;
                              &lt;?php
                                  if($giftProduct-&gt;get_regular_price() !== $giftProduct-&gt;get_price()) {
                                      printf('&lt;div class=&quot;inpage-form__gift__description&quot;&gt;Prodotto esclusivo per te a solo &lt;del&gt;%s&lt;/del&gt; &lt;strong&gt;%s&lt;/strong&gt;&lt;/div&gt;', wc_price($giftProduct-&gt;get_regular_price()), wc_price($giftProduct-&gt;get_price()));
                                  } else {
                                      printf('&lt;div class=&quot;inpage-form__gift__description&quot;&gt;Prodotto esclusivo per te a solo &lt;strong&gt;%s&lt;/strong&gt;&lt;/div&gt;', wc_price($giftProduct-&gt;get_price()));
                                  }
                              ?&gt;
                          &lt;/div&gt;
                          &lt;input type=&quot;checkbox&quot; name=&quot;gift_enable&quot;&gt;
                          &lt;div type=&quot;button&quot; class=&quot;inpage-form__gift__btn&quot;&gt;
                              Aggiungi
                          &lt;/div&gt;
                      &lt;/label&gt;
                      &lt;?php
                      endif
                  ?&gt;
  
                  &lt;h3&gt;Metodo di pagamento&lt;/h3&gt;
                  &lt;div id=&quot;order_review&quot; class=&quot;woocommerce-checkout-review-order&quot;&gt;
                      &lt;?php woocommerce_checkout_payment(); ?&gt;
                  &lt;/div&gt;
  
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!--    --&gt;&lt;?php //WC()-&gt;checkout()-&gt;checkout_form_billing(); ?&gt;
  &lt;/div&gt;
  </code></pre>