Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:26:21+00:00 2026-06-15T14:26:21+00:00

//create anew schedule pane at checkout function uc_pizza_uc_checkout_pane() { $panes[] = array( ‘id’ =>

  • 0
//create anew schedule pane at checkout
function uc_pizza_uc_checkout_pane() {
  $panes[] = array(
    'id' => 'schedule',
    'callback' => 'uc_checkout_pane_schedule',
    'title' => t('Pickup/Delivery Date & Time'),
    'desc' => t("Show Pickup/Delivery Date & Time Pane"),
    'weight' => 1,
    'process' => TRUE,
    'collapsible' => FALSE,
  );
  return $panes;
}




function uc_checkout_pane_schedule($op, $order, $form = NULL, &$form_state = NULL) {
  require_once(drupal_get_path('module', 'uc_cart') . '/uc_cart_checkout_pane.inc');

  switch($op) {
    case 'view':  //create a date-popup field and a separate field for time.
        $format = 'Y-m-d';

        if(isset($_REQUEST['panes']['schedule']['date']['date'])) {
            $date = $_REQUEST['panes']['schedule']['date']['date'];
        } else {
            $date = date($format);
        }

        $descriptions = t("NOTE: You may schedule your pizza pickup or delivery below. The shop is only open from 5pm until 11pm, you may still place your order beyond store hours but it will be delivered the next working hour or your required schedule.");
        $contents ['sched_date'] = array(
           '#type' => 'date_popup', 
           '#title' => t('select a date'),
           '#default_value' => $date, 
           '#date_format' => $format,
           '#datepicker_options' => array('minDate' => 'today', 'maxDate' => variable_get("uc_pizza_max_days", '+6 days')),
           '#date_label_position' => 'within', 
           '#date_increment' => 15, 
           '#date_year_range' => '-0:+0', 
        );

        $base_hour= 5;  
        for($i=0; $i<25; $i++) {     
           $mins = str_pad((int) (($i % 4) * 15),2,"0",STR_PAD_LEFT);
           $hour = str_pad((int) $base_hour,2,"0",STR_PAD_LEFT);
           $options_time[$hour.$mins] =  t($hour . ":" . $mins . " PM"); 
           if($mins == 45) {
              $base_hour++;
           }
        }

       if(isset($_REQUEST['panes']['schedule']['time'])) {
          $default_option = $_REQUEST['panes']['schedule']['time'];
       } else {
          $default_option = 0000;
       }

       $contents['sched_time'] = array(
            '#type' => 'select',
            '#title' => 'Time',
            '#options' => $options_time,
            '#default_value' => $default_option,
        );
        return array('description' => $descriptions, 'contents' => $contents);
    break;

    case 'prepare':
    break;

    case 'review': //**/THIS IS WHERE THE PROBLEM IS** please check process
            dprint_r("order: ", $order); // only var with data
            dprint_r("form: ", $form);  //no data
            dprint_r("form_state: ", $form_state); //no data 
      //$sched_date = $arg1->schedule_date;
      //$sched_time = $arg1->schedule_time;
      //$review[] = '<div class="giftwrap">' . t('You want @type as gift wrap medium', array('@type' => $gift_wrap_type)) . '</div>';    
      //$review[] = array('title' => t('Schedule'), 'data' => check_plain("$sched_date @ $sched_time"));
      //return $review;
    break;

    case 'process': 
//here in process i put the var to $order->schedule_date but unable to see it in $order at view
      $order->schedule_date = $form_state['panes']['schedule']['sched_date']['#value']['date'];
      $order->schedule_time = $form_state['panes']['schedule']['sched_time']['#value'];
      return TRUE;
    break;

    case 'settings':
          $max_days = variable_get("uc_pizza_max_days", '+6 days');
          variable_set("uc_pizza_max_days", $max_days);
          $contents['max_days'] = array(
            '#type' => 'textfield',
            '#title' => t('Calendar Max Days Limit'),
            '#default_value' => $max_days,
            '#maxlength' => 60,
            '#size' => 32,
          );
        return $contents;
    break;

  }
}

I’m trying to add a pane to checkout process of ubercart,
$op = view and settings works perfect.

I have problem with review i tried setting the variable at $op=process but i cannot find it in $op=review

tried this in process

  $order->schedule_date = $form_state['panes']['schedule']['sched_date']['#value']['date'];
  $order->schedule_time = $form_state['panes']['schedule']['sched_time']['#value'];

but

in review it seems $order->schedule_date and $order->schedule_time is not in $order;

Can anyone help out what im missing please… this is in D7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:26:23+00:00Added an answer on June 15, 2026 at 2:26 pm

    Use $order->data instead of trying to apply your custom settings directly to $order.
    Try this under ‘process’

    case 'process':
      // display arrays for devel testing
      dpm($form);
      dpm($order);
    
      // use $order->data to store your submission data
      $order->data['schedule_time'] = $form['panes']['schedule']['sched_time']['#value'];
      break;
    

    Then use $order under ‘review’ to get the data you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just created anew schema & want to create a new table. When ever
I'm trying to create a work schedule creator with multiple stores and each store
Create a new appdomain, setup the assemblyResolve handler and you always get an exception
I create a new c++ project. Then right click on the project -> properties
I create a new record like so: truck = Truck.create(:name=>name, :user_id=>2) My database currently
I create a new Django app (not project) called Bussinesses, then add following class
I create a new grails app and do grails install-plugin rest . App builds.
I create a new entity, store it the first time and then want to
I create a new ASP.NET Web API project. I then use nuget to pull
I create a new page using HTMl and I whant when user clicks on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.