示例#1
0
文件: cart.m.php 项目: lotcz/zshop
 static function loadCartTotals($db, $customer_id)
 {
     $totals = [];
     $sql = 'SELECT SUM(product_price * cart_count) AS p FROM viewProductsInCart WHERE cart_customer_id = ?';
     $statement = SqlQuery::executeSQL($db, $sql, [$customer_id]);
     $result = $statement->get_result();
     if ($row = $result->fetch_assoc()) {
         $totals = $row;
         $selected_currency = Currency::getSelectedCurrency($db);
         $totals['pf'] = formatPrice($row['p'], $selected_currency);
         $totals['pc'] = $row['p'] / $selected_currency->fval('currency_value');
     }
     $statement->close();
     return $totals;
 }
示例#2
0
function loadProducts()
{
    global $mysqli;
    $p = array();
    $res = $mysqli->query("select id, title, description, category, price, image from jube_items order by id");
    while ($row = $res->fetch_assoc()) {
        if (!$p[$row["category"]]) {
            $p[$row["category"]] = array();
        }
        $item = array("id" => $row["id"], "title" => $row["title"], "description" => $row["description"], "price" => formatPrice($row["price"]), "category" => $row["category"]);
        if (!empty($row["image"])) {
            $item["thumb"] = PUBLIC_MEDIA_DIR . $row["image"] . "/size_thumb.jpg";
            $item["large"] = PUBLIC_MEDIA_DIR . $row["image"] . "/size_large.jpg";
        }
        $p[$row["category"]][] = $item;
    }
    $res = array();
    $catIndex = 0;
    while (list($key, $val) = each($p)) {
        $res[] = array("category" => $key, "items" => $val, "catIndex" => $catIndex++);
    }
    return $res;
}
示例#3
0
文件: index.php 项目: bqq1986/efront
    $smarty->assign('T_CONTACT_FORM', $renderer->toArray());
}
/* -------------------------------------------------------End of Contact part--------------------------------------------------------- */
/* -------------------------------------------------------Lesson information part--------------------------------------------------------- */
if (isset($_GET['ctg']) && $_GET['ctg'] == 'lesson_info') {
    //The user asked to display information on a lesson
    //session_start();			//Isn't needed here if the head session_start() is in place
    if (!$smarty->is_cached('index.tpl', $cacheId) || !$GLOBALS['configuration']['smarty_caching']) {
        include "directions_tree.php";
        try {
            if (isset($_GET['lessons_ID'])) {
                if (isset($lessons[$_GET['lessons_ID']]) && $lessons[$_GET['lessons_ID']] instanceof EfrontLesson) {
                    $smarty->assign("T_HAS_LESSON", $lessons[$_GET['lessons_ID']]->lesson['has_lesson']);
                }
                $lesson = new EfrontLesson($_GET['lessons_ID']);
                $lesson->lesson['price_string'] = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true);
                $lesson->lesson['num_students'] = sizeof($lesson->getStudentUsers());
                $lesson->lesson['seats_remaining'] = $lesson->lesson['max_users'] - $lesson->lesson['num_students'];
                $lesson->lesson['seats_remaining'] >= 0 or $lesson->lesson['seats_remaining'] = 0;
                $smarty->assign("T_LESSON", $lesson);
                $lessonInformation = $lesson->getInformation();
                $content = new EfrontContentTree($lesson);
                if (sizeof($content->tree) > 0) {
                    $smarty->assign("T_CONTENT_TREE", $content->toHTML(false, 'dhtml_content_tree', array('noclick' => 1)));
                }
                $lessonInfo = new LearningObjectInformation(unserialize($lesson->lesson['info']));
                $smarty->assign("T_LESSON_INFO", $lessonInfo);
                $additionalInfo = $lesson->getInformation();
                $smarty->assign("T_ADDITIONAL_LESSON_INFO", $additionalInfo);
                if ($lesson->lesson['course_only']) {
                    $smarty->assign("T_LESSON_COURSES", $lesson->getCourses());
 /**
  * Build the price string. This function takes the lesson price and
  * creates a human-readable version, based on whether it is a one-time
  * or a recurring price
  *
  * @since 3.6.1
  * @access protected
  */
 private function buildPriceString()
 {
     if (!empty($this->lesson['price']) && $this->validateFloat($this->lesson['price'])) {
         //Create the string representing the lesson price
         $this->options['recurring'] ? $recurring = array($this->options['recurring'], $this->options['recurring_duration']) : ($recurring = false);
         $this->lesson['price_string'] = formatPrice($this->lesson['price'], $recurring);
     } else {
         $this->lesson['price_string'] = formatPrice(0);
     }
     if (mb_strlen($this->lesson['name']) > 100) {
         $this->lesson['formatted_name'] = mb_substr($this->lesson['name'], 0, 100) . '...';
     } else {
         $this->lesson['formatted_name'] = $this->lesson['name'];
     }
 }
 public function getListView($lang)
 {
     require ROOT . "resources/" . $lang . ".php";
     $itemHtml = "<div class=\"list-article\">";
     $itemHtml .= "<img src=\"" . $this->getImage() . "\" width=\"100px\" height=\"100px\"/>";
     $itemHtml .= "<h2>" . $this->getName() . "</h2>";
     $itemHtml .= "<p class=\"list-article-price\">{$priceLabel}: " . formatPrice($this->getPrice()) . " CHF</p>";
     if (count($this->getVariants()) > 0) {
         $itemHtml .= "<p class=\"list-article-variation\">{$variationsLabel}:";
         $firstElement = TRUE;
         foreach ($this->getVariants() as $variant) {
             if ($firstElement) {
                 $firstElement = FALSE;
             } else {
                 $itemHtml .= ",";
             }
             if ($variant->getPrice() >= 0) {
                 $sign = " +";
             } else {
                 $sign = " ";
             }
             $itemHtml .= " " . $variant->getName() . $sign . formatPrice($variant->getPrice()) . " CHF";
         }
         $itemHtml .= "</p>";
     }
     $itemHtml .= "<p>" . $this->getDescription() . "</p>";
     $itemHtml .= "<form action=\"index.php\" method=\"get\">";
     $itemHtml .= "<input type=\"hidden\" name=\"site\" value=\"article\" /input>";
     $itemHtml .= "<input type=\"hidden\" name=\"lang\" value=\"" . $lang . "\" /input>";
     $itemHtml .= "<input type=\"hidden\" name=\"artId\" value=\"" . $this->getId() . "\" /input>";
     $itemHtml .= "<input class=\"list-article-button\" type=\"submit\" value=\"{$basketButtonLabel}\"/>";
     $itemHtml .= "</form>";
     $itemHtml .= "</div>";
     return $itemHtml;
 }
 private function showCoursePrice($course)
 {
     if ($course->course['price']) {
         $course->course['price'] ? $priceString = formatPrice($course->course['price'], array($course->options['recurring'], $course->options['recurring_duration']), true) : ($priceString = false);
     } elseif (!EfrontUser::isOptionVisible('payments')) {
         $priceString = '';
     } else {
         $priceString = _FREECOURSE;
     }
     return $priceString;
 }
示例#7
0
		private function editOrderItemSearchAction()
		{
			if(empty($_REQUEST['q']) || empty($_REQUEST['quoteSession'])) {
				exit;
			}

			$quote = getClass('ISC_ADMIN_ORDERS')->getQuoteSession($_REQUEST['quoteSession']);
			if(!$quote) {
				exit;
			}

			$customerGroupId = $quote->getCustomerGroupId();

			$_REQUEST['searchQuery'] = $_REQUEST['q'];

			// autocomplete plugin can send a limit which will be at most 11 but internally we limit this to 2-11 and
			// reduce it by 1 to get 1-10 and append the 'virtual' item result as #11
			$limit = 11;
			if (isset($_REQUEST['limit'])) {
				$limit = max(2, min(10, (int)$_REQUEST['limit']));
			}
			$limit--;

			$numProducts = 0;
			$result = getClass('ISC_ADMIN_PRODUCT')->_getProductList(
				0, 'p.prodname', 'asc', $numProducts,
				'DISTINCT p.*, '.GetProdCustomerGroupPriceSQL($customerGroupId), 10);

			$results = array();
			while($product = $this->db->fetch($result)) {
				$isConfigurable = false;
				if($product['prodvariationid'] != 0 || $product['prodconfigfields'] != 0) {
					$isConfigurable = true;
				}

				$options = array(
					'customerGroup' => $customerGroupId
				);
				$price = calculateFinalProductPrice($product, $product['prodcalculatedprice'], $options);
				$price = formatPrice($price);
				$results[] = array(
					'id'				=> $product['productid'],
					'name'				=> $product['prodname'],
					'link'				=> prodLink($product['prodname']),
					'sku'				=> $product['prodcode'],
					'isConfigurable'	=> $isConfigurable,
					'price'				=> $price
				);
			}

			$results[] = array(
				'id'			=> 'virtual',
				'virtualName'	=> $_REQUEST['q'],
				'name'			=> GetLang('AddManualProduct'),
				'className'		=> 'recordContentManual',
				'price'			=> GetLang('AddManualProductHelp'),
			);

			echo isc_json_encode($results);
		}
示例#8
0
    // Set properties on variants
    foreach ($variants as $variant) {
        // hasOptions
        $options = str::split($variant->options());
        if (count($options)) {
            $variant->hasOptions = true;
        } else {
            $variant->hasOptions = false;
        }
        // priceText
        if (inStock($variant)) {
            $variant->priceText = l::get('buy') . ' ';
            if ($saleprice = salePrice($variant)) {
                $variant->priceText .= formatPrice($saleprice);
                $variant->priceText .= '<del>' . formatPrice($variant->price()->value) . '</del>';
            } else {
                $variant->priceText .= formatPrice($variant->price()->value);
            }
        } else {
            $variant->priceText = l::get('out-of-stock') . ' ';
            if ($saleprice = salePrice($variant)) {
                $variant->priceText .= formatPrice($saleprice);
                $variant->priceText .= '<del>' . formatPrice($variant->price()->value) . '</del>';
            } else {
                $variant->priceText .= formatPrice($variant->price()->value);
            }
        }
    }
    // Pass variables to the template
    return ['tags' => $tags, 'variants' => $variants];
};
示例#9
0
                     $siblingsQty += $qty;
                 }
             }
             // Determine if we are at the maximum quantity
             if (inStock($variant) !== true and inStock($variant) <= $item->quantity + $siblingsQty) {
                 $item->maxQty = true;
             } else {
                 $item->maxQty = false;
             }
         }
     }
     // Price text
     if ($item->sale_amount) {
         $item->priceText = formatPrice($item->sale_amount * $item->quantity) . '<del>' . formatPrice($item->amount * $item->quantity) . '</del>';
     } else {
         $item->priceText = formatPrice($item->amount * $item->quantity);
     }
 }
 // Get countries
 $countries = page('/shop/countries')->children()->invisible();
 // Get shipping rates
 $shipping_rates = $cart->getShippingRates();
 // Set shipping method as a session variable
 // Shipping method is an array containing 'title' and 'rate'
 $shippingMethods = $cart->getShippingRates();
 if (get('shipping')) {
     // First option: see if a shipping method was set through a form submission
     if (get('shipping') == 'free-shipping') {
         $shippingMethod = ['title' => l::get('free-shipping'), 'rate' => 0];
     }
     foreach ($shippingMethods as $key => $method) {
 if (isset($_GET['courses_ID']) && eF_checkParameter($_GET['courses_ID'], 'id') && $_GET['type'] == 'branches') {
     $result = eF_getTableDataFlat("module_hcd_course_to_branch mb, module_hcd_branch b", "mb.branches_ID, b.name", "b.branch_ID=mb.branches_ID and mb.courses_ID=" . $_GET['courses_ID']);
     $tooltipInfo = '<div class = "infoEntry"><span>' . implode(", ", $result['name']) . "</span><span></span></div>";
     echo $tooltipInfo;
     exit;
 }
 if (isset($_GET['courses_ID']) && eF_checkParameter($_GET['courses_ID'], 'id')) {
     $course = new EfrontCourse($_GET['courses_ID']);
     $courseInformation = $course->getInformation();
     if ($courseInformation['professors']) {
         foreach ($courseInformation['professors'] as $value) {
             $professorsString[] = formatLogin($value['login']);
         }
         $courseInformation['professors'] = implode(", ", $professorsString);
     }
     $course->course['price'] ? $priceString = formatPrice($course->course['price'], array($course->options['recurring'], $course->options['recurring_duration']), true) : ($priceString = false);
     $courseInformation['price_string'] = $priceString;
     if ($course->course['max_users']) {
         $courseInformation['max_users'] = $course->course['max_users'];
         $courseInformation['seats_remaining'] = $courseInformation['max_users'] - sizeof($course->getStudentUsers());
         $courseInformation['seats_remaining'] >= 0 or $courseInformation['seats_remaining'] = 0;
     }
     foreach ($courseInformation as $key => $value) {
         if ($value) {
             $value = str_replace("\n", "<br />", $value);
             switch ($key) {
                 case 'language':
                     $GLOBALS['configuration']['onelanguage'] or $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LANGUAGE . "</span><span>: {$languages[$value]}</span></div>";
                     break;
                 case 'professors':
                     $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROFESSORS . "</span><span>: {$value}</span></div>";
"></a>
    </td>
    <td><div class="inner">
            <a href="?page=item-detail&item=<?php 
echo $item[$i]['item_id'];
?>
"><h2><?php 
echo $item[$i]['title'];
?>
</h2></a>
            <figure><?php 
echo Db::querySingle('SELECT city_title FROM search_cities_table WHERE city_id=?', $item[$i]['city']);
?>
</figure>
            <div class="tag price"><?php 
formatPrice($config['currency'], $item[$i]['price'], $config['locale']);
?>
</div>
            <?php 
if (isset($user['is_admin']) && $user['is_admin'] == 1 && $_GET['page'] == 'tools-items') {
    ?>
                <div class="assigned-person">Created by:
                    <a href="?page=edit-person&person=<?php 
    echo $person[$i]['person_id'];
    ?>
"><?php 
    echo $person[$i]['person_name'];
    ?>
</a>
                    <?php 
    if ($person[$i]['person_id'] == $_SESSION['user_id']) {
示例#12
0
文件: ask.php 项目: bqq1986/efront
function askInformation()
{
    try {
        if (isset($_GET['lessons_ID']) && eF_checkParameter($_GET['lessons_ID'], 'id')) {
            $lesson = new EfrontLesson($_GET['lessons_ID']);
            $lessonInformation = $lesson->getInformation();
            $languages = EfrontSystem::getLanguages(true);
            //$lessonInformation['language'] = $languages[$lesson -> lesson['languages_NAME']];
            if ($lessonInformation['professors']) {
                foreach ($lessonInformation['professors'] as $value) {
                    $professorsString[] = $value['name'] . ' ' . $value['surname'];
                }
                $lessonInformation['professors'] = implode(", ", $professorsString);
            }
            $lesson->lesson['price'] ? $priceString = formatPrice($lesson->lesson['price'], array($lesson->options['recurring'], $lesson->options['recurring_duration']), true) : ($priceString = false);
            $lessonInformation['price_string'] = $priceString;
            //    if (!$lessonInformation['price']) {
            //        unset($lessonInformation['price_string']);
            //    }
            try {
                if ($_GET['from_course']) {
                    $course = new EfrontCourse($_GET['from_course']);
                    $schedule = $course->getLessonScheduleInCourse($lesson);
                    if ($schedule['start_date'] || $schedule['end_date']) {
                        $lessonInformation['from_timestamp'] = $schedule['start_date'];
                        $lessonInformation['to_timestamp'] = $schedule['end_date'];
                    } else {
                        $lessonInformation['from_timestamp'] = $schedule['active_in_lesson'] + 24 * 60 * 60 * $schedule['start_period'];
                        $lessonInformation['to_timestamp'] = $lessonInformation['from_timestamp'] + 24 * 60 * 60 * $schedule['end_period'];
                    }
                }
            } catch (Exception $e) {
            }
            foreach ($lessonInformation as $key => $value) {
                if ($value) {
                    switch ($key) {
                        case 'language':
                            $GLOBALS['configuration']['onelanguage'] or $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LANGUAGE . "</span><span>: {$languages[$value]}</span></div>";
                            break;
                        case 'professors':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROFESSORS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'content':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _CONTENTUNITS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'tests':
                            EfrontUser::isOptionVisible('tests') ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _TESTS . "</span><span>: {$value}</span></div>" : null;
                            break;
                        case 'projects':
                            EfrontUser::isOptionVisible('projects') ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROJECTS . "</span><span>: {$value}</span></div>" : null;
                            break;
                        case 'course_dependency':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _DEPENDSON . "</span><span>: {$value}</span></div>";
                            break;
                        case 'from_timestamp':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _AVAILABLEFROM . "</span><span>: " . formatTimestamp($value, 'time_nosec') . "</span></div>";
                            break;
                        case 'to_timestamp':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _AVAILABLEUNTIL . "</span><span>: " . formatTimestamp($value, 'time_nosec') . "</span></div>";
                            break;
                        case 'general_description':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _DESCRIPTION . "</span><span>: {$value}</span></div>";
                            break;
                        case 'assessment':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _ASSESSMENT . "</span><span>: {$value}</span></div>";
                            break;
                        case 'objectives':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OBJECTIVES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'lesson_topics':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LESSONTOPICS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'resources':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _RESOURCES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'other_info':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OTHERINFO . "</span><span>: {$value}</span></div>";
                            break;
                        case 'price_string':
                            !$lesson->lesson['course_only'] ? $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PRICE . "</span><span>: {$value}</span></div>" : null;
                            break;
                        default:
                            break;
                    }
                }
            }
            if ($string = implode("", $tooltipInfo)) {
                echo $string;
            } else {
                echo _NODATAFOUND;
            }
        }
        if (isset($_GET['courses_ID']) && eF_checkParameter($_GET['courses_ID'], 'id')) {
            $course = new EfrontCourse($_GET['courses_ID']);
            $courseInformation = $course->getInformation();
            $languages = EfrontSystem::getLanguages(true);
            if ($courseInformation['professors']) {
                foreach ($courseInformation['professors'] as $value) {
                    $professorsString[] = $value['name'] . ' ' . $value['surname'];
                }
                $courseInformation['professors'] = implode(", ", $professorsString);
            }
            $course->course['price'] ? $priceString = formatPrice($course->course['price'], array($course->options['recurring'], $course->options['recurring_duration']), true) : ($priceString = false);
            $courseInformation['price_string'] = $priceString;
            foreach ($courseInformation as $key => $value) {
                if ($value) {
                    switch ($key) {
                        case 'language':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LANGUAGE . "</span><span>: {$languages[$value]}</span></div>";
                            break;
                        case 'professors':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PROFESSORS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'lessons_number':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _LESSONS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'instances':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _COURSEINSTANCES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'general_description':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _DESCRIPTION . "</span><span>: {$value}</span></div>";
                            break;
                        case 'assessment':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _ASSESSMENT . "</span><span>: {$value}</span></div>";
                            break;
                        case 'objectives':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OBJECTIVES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'lesson_topics':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _COURSETOPICS . "</span><span>: {$value}</span></div>";
                            break;
                        case 'resources':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _RESOURCES . "</span><span>: {$value}</span></div>";
                            break;
                        case 'other_info':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _OTHERINFO . "</span><span>: {$value}</span></div>";
                            break;
                        case 'price_string':
                            $tooltipInfo[] = '<div class = "infoEntry"><span>' . _PRICE . "</span><span>: {$value}</span></div>";
                            break;
                        default:
                            break;
                    }
                }
            }
            if ($string = implode("", $tooltipInfo)) {
                echo $string;
            } else {
                echo _NODATAFOUND;
            }
        }
        // For eFront social
        if (isset($_GET['common_lessons']) && isset($_GET['user1']) && isset($_GET['user2'])) {
            $user1 = EfrontUserFactory::factory($_GET['user1']);
            if ($user1->getType() != "administrator") {
                $common_lessons = $user1->getCommonLessons($_GET['user2']);
                // pr($common_lessons);
                foreach ($common_lessons as $id => $lesson) {
                    if (strlen($lesson['name']) > 25) {
                        $lesson['name'] = substr($lesson['name'], 0, 22) . "...";
                    }
                    $tooltipInfo[] = '<div class = "infoEntry"><span>' . $lesson['name'] . "</span><span></span></div>";
                }
                if ($string = implode("", $tooltipInfo)) {
                    echo $string;
                } else {
                    echo _NODATAFOUND;
                }
            } else {
                echo _NODATAFOUND;
            }
        }
    } catch (Exception $e) {
        handleAjaxExceptions($e);
    }
}
示例#13
0
文件: product.v.php 项目: lotcz/zshop
		<div class="spaced product">		
			
			<div class="row">
				<div class="col col-md-6 text-center">
					<?php					
						$product->renderImage('view', 'img-thumbnail');					
					?>
				</div>
				
				<div class="col col-md-6">
					<div class="row">
						<div class="col col-md-6 text-left">
							<h3><?=t('Price') ?></h3>
						</div>
						<div class="col col-md-6 text-right">
							<h3><?=formatPrice($product->val('product_price'), $currency) ?></h3>
						</div>					
					</div>
					
					<div class="row spaced">
						<div class="col col-md-6 col-md-offset-6 text-right">
							<form class="form-inline">
								<input name="product_count" id="prod_count_<?=$product->val('product_id')?>" value="1" type="text" maxlength="2" class="form-control prod-item-count" />
								<button class="btn btn-success" onclick="javascript:addProductToCart(<?=$product->val('product_id')?>);return false;"><span class="glyphicon glyphicon-shopping-cart"></span><?=t('Buy')?></button>
							</form>
						</div>					
					</div>
				</div>
			</div>
			
			<div class="row spaced">
示例#14
0
文件: cart.c.php 项目: lotcz/zshop
$product_id = intval(_g('product_id'));
$count = intval(_g('count'));
$action = $path[2];
if (isset($custAuth) && $custAuth->isAuth()) {
    $cart = new Cart($db);
    $cart->load($product_id, $custAuth->customer_id);
    if ($cart->is_loaded) {
        if ($action == 'add') {
            $cart->data['cart_count'] = $cart->val('cart_count') + $count;
        } elseif ($action == 'update') {
            $cart->data['cart_count'] = $count;
        }
    } else {
        $cart->data['cart_product_id'] = $product_id;
        $cart->data['cart_customer_id'] = $custAuth->customer_id;
        $cart->data['cart_count'] = $count;
    }
    if ($cart->val('cart_count') > 0) {
        $cart->save();
    } else {
        $cart->deleteById();
    }
    $data = Cart::loadCartTotals($db, $custAuth->customer_id);
    if ($action == 'update') {
        $data['ii'] = $product_id;
        $product = new Product($db, $product_id);
        $data['ip'] = formatPrice($cart->ival('cart_count') * $product->ival('product_price'));
    }
} else {
    echo 'Cannot authenticate customer';
}
示例#15
0
			</a>
				
			<div class="panel-title">				
				<a href="<?php 
echo _url($product->val('alias_url'));
?>
"><?php 
echo $product->val('product_name');
?>
</a>
			</div>
			
			<div class="product-price">
				<div class="price">
					<?php 
echo formatPrice($product->val('product_price'));
?>
				</div>					
			</div>	

		</div>
		
		<div class="panel-heading basic-bg text-right">
			<form class="form-inline">
				<input id="prod_count_<?php 
echo $product->val('product_id');
?>
" value="1" type="text" maxlength="2" class="form-control prod-item-count" />
				<button class="btn btn-success" onclick="javascript:addProductToCart(<?php 
echo $product->val('product_id');
?>
    public function display(array $context)
    {
        // line 1
        $context['util'] = $this->env->loadTemplate("macros/util.tpl", true);
        // line 2
        $context['formBuilder'] = $this->env->loadTemplate("macros/forms.tpl", true);
        echo "<link rel=\"stylesheet\" href=\"Styles/order.form.css\" type=\"text/css\" charset=\"utf-8\">
<div id=\"content\">
\t<form action=\"#\" method=\"post\" accept-charset=\"utf-8\" id=\"orderForm\">
\t\t<input type=\"hidden\" name=\"quoteSession\" value=\"";
        // line 6
        echo twig_escape_filter($this->env, (isset($context['quoteSession']) ? $context['quoteSession'] : null), "1");
        echo "\" id=\"quoteSession\">
\t\t<h1>
\t\t\t";
        // line 8
        if ((isset($context['addingOrder']) ? $context['addingOrder'] : null)) {
            echo "\t\t\t\t";
            // line 9
            echo getLang("AddAnOrder");
            echo "\t\t\t";
        } else {
            // line 10
            echo "\t\t\t\t";
            // line 11
            echo getLang("EditAnOrder");
            echo "\t\t\t";
        }
        // line 12
        echo "\t\t\t<span class=\"orderMachineStateCustomerDetails\" style=\"display: none;\">
\t\t\t\t(";
        // line 14
        echo getLang("StepXofY", array("x" => 1, "y" => 4));
        // line 17
        echo ")
\t\t\t</span>
\t\t\t<span class=\"orderMachineStateItems\" style=\"display: none;\">
\t\t\t\t(";
        // line 20
        echo getLang("StepXofY", array("x" => 2, "y" => 4));
        // line 23
        echo ")
\t\t\t</span>
\t\t\t<span class=\"orderMachineStateShipping\" style=\"display: none;\">
\t\t\t\t(";
        // line 26
        echo getLang("StepXofY", array("x" => 3, "y" => 4));
        // line 29
        echo ")
\t\t\t</span>
\t\t\t<span class=\"orderMachineStateSummary\" style=\"display: none;\">
\t\t\t\t(";
        // line 32
        echo getLang("StepXofY", array("x" => 4, "y" => 4));
        // line 35
        echo ")
\t\t\t</span>
\t\t</h1>
\t\t<p class=\"intro\">
\t\t\t";
        // line 39
        echo getLang("AddOrderIntro");
        echo "\t\t</p>
\t\t";
        // line 41
        echo getFlashMessageBoxes();        echo "
\t\t";
        // line 43
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startButtonRow", array(), "any"), "1");
        echo "
\t\t\t<button class=\"orderMachineBackButton\" disabled=\"disabled\" accesskey=\"b\">&lt; ";
        // line 44
        echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Back", array(), "any"), "b"));
        echo "</button>
\t\t\t<button class=\"orderMachineNextButton\" accesskey=\"n\">";
        // line 45
        echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Next", array(), "any"), "n"));
        echo " &gt;</button>
\t\t\t";
        // line 46
        echo getLang("Or");
        echo "\t\t\t<a href=\"#\" class=\"orderMachineCancelButton\">";
        // line 47
        echo getLang("Cancel");
        echo "</a>
\t\t";
        // line 48
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endButtonRow", array(), "any"), "1");
        echo "

\t\t<div class=\"orderMachineStateCustomerDetails\">
\t\t\t<input type=\"hidden\" name=\"customerId\" value=\"";
        // line 51
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerId", array(), "any"), "1");
        echo "\" id=\"customerId\" />
\t\t\t";
        // line 52
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t";
        // line 53
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "CustomerDetails", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t";
        // line 55
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "OrderFor", array(), "any")) . (":"), "required" => true), ), "method"), "1");
        // line 58
        echo "
\t\t\t\t\t";
        // line 59
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerId", array(), "any")) {
            echo "\t\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t\t<input type=\"radio\" name=\"orderFor\" value=\"dontchange\" checked=\"checked\" /> ";
            // line 61
            echo getLang("KeepExistingCustomerDetails");
            echo "\t\t\t\t\t\t\t<input type=\"hidden\" id=\"existingCustomerId\" value=\"";
            // line 62
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerId", array(), "any"), "1");
            echo "\" />
\t\t\t\t\t\t</label>
\t\t\t\t\t";
        }
        // line 64
        echo "\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t<input type=\"radio\" name=\"orderFor\" value=\"customer\" ";
        // line 66
        if (((isset($context['addingOrder']) ? $context['addingOrder'] : null)) || ((!$this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerId", array(), "any")))) {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("SearchMyExistingCustomerList");
        echo "\t\t\t\t\t</label>
\t\t\t\t\t<div class=\"orderForToggle orderForToggleCustomer\">
\t\t\t\t\t\t<input type=\"text\" name=\"orderForSearch\" id=\"orderForSearch\" class=\"Field300\" />
\t\t\t\t\t</div>
\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t<input type=\"radio\" name=\"orderFor\" value=\"new\" ";
        // line 72
        if (((!(isset($context['addingOrder']) ? $context['addingOrder'] : null))) && ((!$this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerId", array(), "any")))) {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("ANewCustomerOrInStorePurchase");
        echo "\t\t\t\t\t</label>
\t\t\t\t";
        // line 74
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t";
        // line 75
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t";
        // line 77
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("class" => "orderForToggle orderForToggleNew"), ), "method"), "1");
        // line 79
        echo "
\t\t\t\t";
        // line 80
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array(((($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "AccountDetails", array(), "any")) . (" (")) . ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Optional", array(), "any"))) . (")"), ), "method"), "1");
        echo "

\t\t\t\t";
        // line 82
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(), "any"), "1");
        echo "
\t\t\t\t\t<p class=\"MessageBox MessageBoxInfo\">
\t\t\t\t\t\t";
        // line 84
        echo getLang("IfDetailsAreNotSpecified");
        echo "\t\t\t\t\t</p>
\t\t\t\t";
        // line 86
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "

\t\t\t\t";
        // line 88
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_iterator_to_array((isset($context['accountFormFields']) ? $context['accountFormFields'] : null));
        $countable = is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable);
        $length = $countable ? count($context['_seq']) : null;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if ($countable) {
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context['_key'] => $context['formField']) {
            echo "\t\t\t\t\t";
            // line 89
            if ($this->getAttribute($this->getAttribute((isset($context['formField']) ? $context['formField'] : null), "record", array(), "any"), "formfieldprivateid", array(), "any") != "EmailAddress") {
                echo "\t\t\t\t\t\t";
                // line 90
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRowGroup", array(), "any"), "1");
                echo "
\t\t\t\t\t";
            }
            // line 91
            echo "
\t\t\t\t\t";
            // line 93
            echo twig_safe_filter($this->getAttribute((isset($context['formField']) ? $context['formField'] : null), "loadForFrontend", array(), "any"));
            echo "

\t\t\t\t\t";
            // line 95
            if ($this->getAttribute($this->getAttribute((isset($context['formField']) ? $context['formField'] : null), "record", array(), "any"), "formfieldprivateid", array(), "any") != "EmailAddress") {
                echo "\t\t\t\t\t\t";
                // line 96
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRowGroup", array(), "any"), "1");
                echo "
\t\t\t\t\t";
            }
            // line 97
            echo "\t\t\t\t";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if ($countable) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['formField'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 98
        echo "
\t\t\t\t";
        // line 100
        if ((isset($context['accountCustomerGroups']) ? $context['accountCustomerGroups'] : null)) {
            echo "\t\t\t\t\t";
            // line 101
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "CustomerGroup", array(), "any")) . (":")), ), "method"), "1");
            // line 103
            echo "
\t\t\t\t\t\t";
            // line 104
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "select", array("accountCustomerGroup", (isset($context['accountCustomerGroups']) ? $context['accountCustomerGroups'] : null), (isset($context['null']) ? $context['null'] : null), array("class" => "Field200"), ), "method"), "1");
            // line 106
            echo "
\t\t\t\t\t";
            // line 107
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
            echo "
\t\t\t\t";
        }
        // line 108
        echo "\t\t\t";
        // line 109
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t";
        // line 111
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t";
        // line 112
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "BillingAddress", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t<fieldset class=\"existingAddressList\">
\t\t\t\t\t<legend>";
        // line 115
        echo getLang("UseExistingAddress");
        echo "</legend>
\t\t\t\t\t<ul>
\t\t\t\t\t</ul>
\t\t\t\t</fieldset>
\t\t\t\t";
        // line 119
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_iterator_to_array((isset($context['billingFormFields']) ? $context['billingFormFields'] : null));
        $countable = is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable);
        $length = $countable ? count($context['_seq']) : null;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if ($countable) {
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context['_key'] => $context['formField']) {
            echo "\t\t\t\t\t";
            // line 120
            echo twig_safe_filter($this->getAttribute((isset($context['formField']) ? $context['formField'] : null), "loadForFrontend", array(), "any"));
            echo "
\t\t\t\t";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if ($countable) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['formField'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 121
        echo "
\t\t\t\t";
        // line 123
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => " "), ), "method"), "1");
        // line 125
        echo "
\t\t\t\t\t<label>
\t\t\t\t\t\t<input type=\"checkbox\" name=\"saveBillingAddress\" value=\"1\" checked=\"checked\" />
\t\t\t\t\t\t";
        // line 128
        echo getLang("SaveToCustomersAddressBook");
        echo "\t\t\t\t\t</label>
\t\t\t\t";
        // line 130
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t";
        // line 131
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t</div>

\t\t<div class=\"orderMachineStateItems\">
\t\t\t";
        // line 135
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical"), ), "method"), "1");
        echo "
\t\t\t\t";
        // line 136
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array("Search Items", ), "method"), "1");
        echo "

\t\t\t\t";
        // line 138
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("last" => true), ), "method"), "1");
        // line 140
        echo "
\t\t\t\t\t<div>
\t\t\t\t\t\t<a href=\"#\" class=\"quoteItemSearchIcon\" />&nbsp;</a>
\t\t\t\t\t\t<div class=\"quoteItemSearch\">
\t\t\t\t\t\t\t<input type=\"text\" />
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t\t<div>
\t\t\t\t\t\t<a class=\"addVirtualItemLink\" href=\"#\">";
        // line 148
        echo getLang("AddVirtualItemLink");
        echo "</a>
\t\t\t\t\t\t<div class=\"addVirtualItemLinkAfter\"></div>
\t\t\t\t\t</div>
\t\t\t\t";
        // line 151
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t";
        // line 152
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t";
        // line 154
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical"), ), "method"), "1");
        echo "
\t\t\t\t";
        // line 155
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ItemsInOrder", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t";
        // line 157
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(), "any"), "1");
        echo "
\t\t\t\t\t<div ";
        // line 158
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "items", array(), "any")) {
            echo "style=\"display: none\"";
        }
        echo " class=\"orderNoItemsMessage\">
\t\t\t\t\t\t<p class=\"MessageBox MessageBoxInfo\">
\t\t\t\t\t\t\t";
        // line 160
        echo getLang("ThisOrderIsCurrentlyEmpty");
        echo "\t\t\t\t\t\t</p>
\t\t\t\t\t</div>
\t\t\t\t\t<div ";
        // line 163
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "items", array(), "any") == false) {
            echo "style=\"display: none\"";
        }
        echo " class=\"orderItemsGrid\">
\t\t\t\t\t\t";
        // line 164
        echo twig_safe_filter((isset($context['itemsTable']) ? $context['itemsTable'] : null));
        echo "
\t\t\t\t\t</div>
\t\t\t\t\t<div ";
        // line 166
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "items", array(), "any") == false) {
            echo "style=\"display: none\"";
        }
        echo " id=\"itemSubtotal\">
\t\t\t\t\t\t";
        // line 167
        echo getLang("SubTotal");
        echo ": <span>";
        echo twig_escape_filter($this->env, (isset($context['subtotal']) ? $context['subtotal'] : null), "1");
        echo "</span>
\t\t\t\t\t</div>
\t\t\t\t";
        // line 169
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t";
        // line 170
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t</div>

\t\t<div class=\"orderMachineStateShipping\">
\t\t\t";
        // line 174
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t";
        // line 175
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShippingDestination", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t";
        // line 177
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShipItemsTo", array(), "any")) . (":"), "required" => true), ), "method"), "1");
        // line 180
        echo "
\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t<input type=\"radio\" name=\"shipItemsTo\" class=\"showByValue orderFormDisableIfDigital orderFormCheckIfDigital\" value=\"billing\" ";
        // line 182
        if ((isset($context['shipItemsTo']) ? $context['shipItemsTo'] : null) == "billing") {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("TheBillingAddressAlreadySpecified");
        echo "\t\t\t\t\t</label>
\t\t\t\t\t<div class=\"showByValue_shipItemsTo showByValue_shipItemsTo_billing nodeJoin\" id=\"shipItemsToBillingAddress\">
\t\t\t\t\t</div>
\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t<input type=\"radio\" name=\"shipItemsTo\" class=\"showByValue orderFormDisableIfDigital\" value=\"single\" ";
        // line 187
        if ((isset($context['shipItemsTo']) ? $context['shipItemsTo'] : null) == "single") {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("ASingleAddress");
        echo "\t\t\t\t\t</label>
\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t<input type=\"radio\" name=\"shipItemsTo\" class=\"showByValue orderFormDisableIfDigital\" value=\"multiple\" ";
        // line 190
        if ((isset($context['shipItemsTo']) ? $context['shipItemsTo'] : null) == "multiple") {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("MultipleAddressesSpecifyBelow");
        echo "\t\t\t\t\t</label>
\t\t\t\t";
        // line 192
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t";
        // line 193
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t<div class=\"orderFormShowIfDigital\" style=\"display:none;\">
\t\t\t\t<div class=\"MessageBox  MessageBoxInfo\">
\t\t\t\t\t";
        // line 197
        echo getLang("DigitalOrderNotice");
        echo "\t\t\t\t</div>
\t\t\t</div>

\t\t\t<div class=\"orderFormHideIfDigital\" style=\"display:none;\">
\t\t\t\t<div class=\"showByValue_shipItemsTo showByValue_shipItemsTo_single\">
\t\t\t\t\t";
        // line 203
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t\t\t";
        // line 204
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShippingAddress", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t\t\t<fieldset class=\"existingAddressList\">
\t\t\t\t\t\t\t<legend>";
        // line 207
        echo getLang("UseExistingAddress");
        echo "</legend>
\t\t\t\t\t\t\t<ul>
\t\t\t\t\t\t\t</ul>
\t\t\t\t\t\t</fieldset>

\t\t\t\t\t\t";
        // line 212
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_iterator_to_array((isset($context['shippingFormFields']) ? $context['shippingFormFields'] : null));
        $countable = is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable);
        $length = $countable ? count($context['_seq']) : null;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if ($countable) {
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context['_key'] => $context['formField']) {
            echo "\t\t\t\t\t\t\t";
            // line 213
            echo twig_safe_filter($this->getAttribute((isset($context['formField']) ? $context['formField'] : null), "loadForFrontend", array(), "any"));
            echo "
\t\t\t\t\t\t";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if ($countable) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['formField'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 214
        echo "
\t\t\t\t\t\t";
        // line 216
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => " "), ), "method"), "1");
        // line 218
        echo "
\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"saveShippingAddress\" value=\"1\" checked=\"checked\" />
\t\t\t\t\t\t\t\t";
        // line 221
        echo getLang("SaveToCustomersAddressBook");
        echo "\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t";
        // line 223
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "

\t\t\t\t\t";
        // line 225
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t\t\t</div>

\t\t\t\t";
        // line 228
        $context['address'] = $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "getShippingAddress", array(), "any");
        echo "
\t\t\t\t<div class=\"showByValue_shipItemsTo showByValue_shipItemsTo_billing showByValue_shipItemsTo_single\">
\t\t\t\t\t";
        // line 231
        $context['shippingMethod'] = $this->getAttribute((isset($context['address']) ? $context['address'] : null), "shippingMethod", array(), "any");
        echo "\t\t\t\t\t";
        // line 232
        if ((isset($context['shippingMethod']) ? $context['shippingMethod'] : null)) {
            echo "\t\t\t\t\t\t<input type=\"hidden\" name=\"currentShipping[isCustom]\" value=\"";
            // line 233
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "isCustom", array(), "any"), "1");
            echo "\" />
\t\t\t\t\t\t<input type=\"hidden\" name=\"currentShipping[module]\" value=\"";
            // line 234
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "module", array(), "any"), "1");
            echo "\" />
\t\t\t\t\t\t<input type=\"hidden\" name=\"currentShipping[description]\" value=\"";
            // line 235
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "description", array(), "any"), "1");
            echo "\" />
\t\t\t\t\t\t<input type=\"hidden\" name=\"currentShipping[price]\" value=\"";
            // line 236
            echo formatPrice(twig_escape_filter($this->env, $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "price", array(), "any"), "1"), false, false);
            echo "\" />
\t\t\t\t\t";
        }
        // line 237
        echo "
\t\t\t\t\t";
        // line 239
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t\t\t";
        // line 240
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShippingMethod", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t\t\t";
        // line 242
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ChooseAProvider", array(), "any")) . (":")), ), "method"), "1");
        // line 244
        echo "
\t\t\t\t\t\t\t<select name=\"shippingQuoteList\" ";
        // line 245
        if ((!(isset($context['shippingMethod']) ? $context['shippingMethod'] : null))) {
            echo "style=\"display: none\"";
        }
        echo " class=\"Field300 showByValue shippingQuoteList\" size=\"5\">
\t\t\t\t\t\t\t\t";
        // line 246
        if (((isset($context['shippingMethod']) ? $context['shippingMethod'] : null)) && ($this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "module", array(), "any") != "custom")) {
            echo "\t\t\t\t\t\t\t\t\t<option value=\"builtin:current\" selected=\"selected\">";
            // line 247
            echo getLang("UseCurrentShippingMethod", array("method" => $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "description", array(), "any"), "price" => formatPrice($this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "price", array(), "any"))));
            // line 250
            echo "</option>
\t\t\t\t\t\t\t\t";
        }
        // line 251
        echo "\t\t\t\t\t\t\t\t<option value=\"builtin:none\">";
        // line 252
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "xNone", array(), "any"), "1");
        echo "</option>
\t\t\t\t\t\t\t\t<option value=\"builtin:custom\" ";
        // line 253
        if (((isset($context['shippingMethod']) ? $context['shippingMethod'] : null)) && ($this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "module", array(), "any") == "custom")) {
            echo "selected=\"selected\"";
        }
        echo ">";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Custom", array(), "any"), "1");
        echo "</option>
\t\t\t\t\t\t\t</select> <a href=\"#\" class=\"fetchShippingQuotesLink\">";
        // line 254
        echo getLang("FetchShippingQuotes");
        echo "</a>
\t\t\t\t\t\t\t<div class=\"nodeJoin customShippingContainer showByValue_shippingQuoteList showByValue_shippingQuoteList_builtincustom\" style=\"display:none;\">
\t\t\t\t\t\t\t\t";
        // line 256
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t\t\t";
        // line 257
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShippingMethod", array(), "any")) . (":"), "required" => true), ), "method"), "1");
        // line 260
        echo "
\t\t\t\t\t\t\t\t\t\t";
        // line 261
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "input", array("text", "customShippingDescription", $this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "description", array(), "any"), array("class" => "Field300"), ), "method"), "1");
        // line 263
        echo "
\t\t\t\t\t\t\t\t\t";
        // line 264
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "

\t\t\t\t\t\t\t\t\t";
        // line 266
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("label" => ($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ShippingCost", array(), "any")) . (":"), "last" => true), ), "method"), "1");
        // line 269
        echo "
\t\t\t\t\t\t\t\t\t\t";
        // line 270
        echo twig_escape_filter($this->env, (isset($context['CurrencyTokenLeft']) ? $context['CurrencyTokenLeft'] : null), "1");
        echo " ";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "input", array("text", "customShippingPrice", formatPrice($this->getAttribute((isset($context['shippingMethod']) ? $context['shippingMethod'] : null), "price", array(), "any"), false, false), array("class" => "Field70"), ), "method"), "1");
        // line 272
        echo " ";
        echo twig_escape_filter($this->env, (isset($context['CurrencyTokenRight']) ? $context['CurrencyTokenRight'] : null), "1");
        echo "
\t\t\t\t\t\t\t\t\t";
        // line 273
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t\t";
        // line 274
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
        // line 276
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 277
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t\t\t</div>

\t\t\t\t<div class=\"showByValue_shipItemsTo showByValue_shipItemsTo_multiple\" id=\"multiShippingTable\">
\t\t\t\t\t<!-- Placeholder for content loaded in via ajax -->
\t\t\t\t\t";
        // line 282
        if ((isset($context['multiShippingTable']) ? $context['multiShippingTable'] : null)) {
            echo "\t\t\t\t\t\t";
            // line 283
            echo twig_safe_filter((isset($context['multiShippingTable']) ? $context['multiShippingTable'] : null));
            echo "
\t\t\t\t\t";
        }
        // line 284
        echo "\t\t\t\t</div>
\t\t\t</div>
\t\t</div>

\t\t<div class=\"orderMachineStateSummary orderMachineStateSummaryLoadingIndicator\" style=\"display:none;\">
\t\t\t<div class=\"orderFormColumns\">
\t\t\t\t<div class=\"orderFormRightColumn\">
\t\t\t\t\t";
        // line 292
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical", "class" => "greenFormContainer"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 293
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "FinalizeOrder", array(), "any"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 294
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t<label class=\"row\">
\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"emailInvoiceToCustomer\" value=\"1\" ";
        // line 296
        if ((isset($context['addingOrder']) ? $context['addingOrder'] : null)) {
            echo "checked=\"checked\"";
        }
        echo " /> ";
        echo getLang("EmailCustomerInvoice");
        echo "?
\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t<div class=\"billingEmailAddressContainer\">(<span class=\"billingEmailAddress\"></span>)</div>
\t\t\t\t\t\t\t<button class=\"orderMachineSaveButton\" disabled=\"disabled\" accesskey=\"s\">";
        // line 299
        if ((isset($context['payment']) ? $context['payment'] : null)) {
            echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "SaveOnly", array(), "any"), "s"));
        } else {
            echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "SaveAndProcessPayment", array(), "any"), "s"));
        }
        echo "</button>
\t\t\t\t\t\t";
        // line 300
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 301
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t\t\t";
        // line 303
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical", "class" => "orderSummaryContainer"), ), "method"), "1");
        // line 306
        echo "
\t\t\t\t\t\t";
        // line 307
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "OrderSummary", array(), "any"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 308
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t<div class=\"orderFormSummaryOrderSummaryContainer\"><!-- placeholder --></div>
\t\t\t\t\t\t";
        // line 310
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 311
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t\t\t";
        // line 313
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical", "class" => "couponGiftCertificateContainer"), ), "method"), "1");
        // line 316
        echo "

\t\t\t\t\t\t";
        // line 318
        if ((isset($context['allowGiftCertificates']) ? $context['allowGiftCertificates'] : null)) {
            echo "\t\t\t\t\t\t\t";
            // line 319
            $context['couponPanelHeading'] = $this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "CouponOrGiftCertificateQ", array(), "any");
            echo "\t\t\t\t\t\t";
        } else {
            // line 320
            echo "\t\t\t\t\t\t\t";
            // line 321
            $context['couponPanelHeading'] = $this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "ApplyCouponOnly", array(), "any");
            echo "\t\t\t\t\t\t";
        }
        // line 322
        echo "
\t\t\t\t\t\t";
        // line 324
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array((isset($context['couponPanelHeading']) ? $context['couponPanelHeading'] : null), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 325
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(), "any"), "1");
        echo "
\t\t\t\t\t\t\t";
        // line 326
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "input", array("text", "couponGiftCertificate", "", array("class" => "Field120"), ), "method"), "1");
        // line 328
        echo "<input type=\"button\" class=\"orderMachineCouponButton\" value=\"";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Apply", array(), "any"), "1");
        echo "\" />
\t\t\t\t\t\t";
        // line 329
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 330
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t\t\t";
        // line 332
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 333
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "PaymentDetails", array(), "any"), ), "method"), "1");
        echo "

\t\t\t\t\t\t";
        // line 335
        echo twig_safe_filter((isset($context['paymentForm']) ? $context['paymentForm'] : null));
        echo "
\t\t\t\t\t";
        // line 336
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t\t\t</div>
\t\t\t\t<div class=\"orderFormLeftColumn\">
\t\t\t\t\t<div class=\"orderFormSummaryBillingDetailsContainer\"><!-- placeholder --></div>

\t\t\t\t\t<div class=\"orderFormSummaryShippingDetailsContainer\"><!-- placeholder --></div>

\t\t\t\t\t";
        // line 343
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 344
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "OrderCommentsVisible", array(), "any"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 345
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("last" => true), ), "method"), "1");
        echo "
\t\t\t\t\t\t\t";
        // line 346
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "textarea", array("customerMessage", $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "customerMessage", array(), "any"), array("class" => "Field100pct", "rows" => 6), ), "method"), "1");
        // line 349
        echo "
\t\t\t\t\t\t";
        // line 350
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 351
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "

\t\t\t\t\t";
        // line 353
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startForm", array(array("type" => "vertical"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 354
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "heading", array($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "StaffNotesNotVisible", array(), "any"), ), "method"), "1");
        echo "
\t\t\t\t\t\t";
        // line 355
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startRow", array(array("last" => true), ), "method"), "1");
        echo "
\t\t\t\t\t\t\t";
        // line 356
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "textarea", array("staffNotes", $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "staffNotes", array(), "any"), array("class" => "Field100pct", "rows" => 6), ), "method"), "1");
        // line 359
        echo "
\t\t\t\t\t\t";
        // line 360
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endRow", array(), "any"), "1");
        echo "
\t\t\t\t\t";
        // line 361
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endForm", array(), "any"), "1");
        echo "
\t\t\t\t</div>
\t\t\t\t<div class=\"orderFormColumnsEnd\"></div>
\t\t\t</div>
\t\t</div>

\t\t";
        // line 367
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "startButtonRow", array(), "any"), "1");
        echo "
\t\t\t<button class=\"orderMachineBackButton\" disabled=\"disabled\" accesskey=\"b\">&lt; ";
        // line 368
        echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Back", array(), "any"), "b"));
        echo "</button>
\t\t\t<button class=\"orderMachineNextButton\" accesskey=\"n\">";
        // line 369
        echo twig_safe_filter($this->getEnvironment()->getExtension('interspire')->accessKeyFilter($this->getAttribute((isset($context['lang']) ? $context['lang'] : null), "Next", array(), "any"), "n"));
        echo " &gt;</button>
\t\t\t";
        // line 370
        echo getLang("Or");
        echo "\t\t\t<a href=\"#\" class=\"orderMachineCancelButton\">";
        // line 371
        echo getLang("Cancel");
        echo "</a>
\t\t";
        // line 372
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formBuilder']) ? $context['formBuilder'] : null), "endButtonRow", array(), "any"), "1");
        echo "
\t</form>
</div>
<script type=\"text/javascript\" src=\"../javascript/jquery/plugins/jquery.form.js?";
        // line 375
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\"></script>
<script type=\"text/javascript\" src=\"../javascript/product.functions.js?";
        // line 376
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\"></script>
<script type=\"text/javascript\" src=\"../javascript/jquery/plugins/autocomplete/jquery.autocomplete.js?";
        // line 377
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\" charset=\"utf-8\"></script>
<script type=\"text/javascript\" src=\"../javascript/jquery/plugins/disabled/jquery.disabled.js?";
        // line 378
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\" charset=\"utf-8\"></script>
<script type=\"text/javascript\" src=\"../javascript/formfield.js?";
        // line 379
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\" charset=\"utf-8\"></script>
<script type=\"text/javascript\" src=\"../javascript/fsm.js?";
        // line 380
        echo twig_escape_filter($this->env, (isset($context['JSCacheToken']) ? $context['JSCacheToken'] : null), "1");
        echo "\" charset=\"utf-8\"></script>
<script src=\"script/order.form.fsm.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script src=\"script/order.form.js\" type=\"text/javascript\" charset=\"utf-8\"></script>
<script type=\"text/javascript\" charset=\"utf-8\">//<![CDATA[
\t";
        // line 384
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['util']) ? $context['util'] : null), "jslang", array(array(0 => "ChooseVariationBeforeAdding", 1 => "EnterProductRequiredFields", 2 => "ChooseValidProductFieldFile", 3 => "AddingProductToOrder", 4 => "UpdatingProductInOrder", 5 => "OrderCustomerSearchNone", 6 => "CustomerPasswordConfirmError", 7 => "CustomerEmailInvalid", 8 => "ConfirmRemoveProductFromOrder", 9 => "InvalidPaymentModule", 10 => "NoShippingMethodsAreAvailable_1", 11 => "NoShippingMethodsAreAvailable_2", 12 => "PleaseAddOneOrMoreItems", 13 => "ConfirmCancelMessage", 14 => "AddEditOrderConfirmPageNavigation", 15 => "ViewOrderHistory", 16 => "TypeACustomerNameEmailEtc", 17 => "PleaseSearchForACustomer", 18 => "UseThisAddress", 19 => "TypeAProductNameSkuEtc", 20 => "ChooseOneItemForShippingDestination", 21 => "AllocateProducts", 22 => "Cancel", 23 => "SaveChanges", 24 => "ConfirmDeleteShippingDestination", 25 => "QuoteItemSearchNone", 26 => "EditDeletedOrderSaveNotice"), ), "method"), "1");
        // line 412
        echo "

\t";
        // line 414
        if ((isset($context['allowGiftCertificates']) ? $context['allowGiftCertificates'] : null)) {
            echo "\t\tlang[\"EnterACoupon\"] = \"";
            // line 415
            echo Interspire_Template_Extension::jsFilter(getLang("PleaseEnterACouponOrGiftCert"), "'");
            echo "\";
\t";
        } else {
            // line 416
            echo "\t\tlang[\"EnterACoupon\"] = \"";
            // line 417
            echo Interspire_Template_Extension::jsFilter(getLang("PleaseEnterACoupon"), "'");
            echo "\";
\t";
        }
        // line 418
        echo "
\t";
        // line 420
        echo twig_safe_filter((isset($context['formFieldJavascript']) ? $context['formFieldJavascript'] : null));
        echo "

\torderCustomFormFieldsAccountFormId = ";
        // line 422
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formFieldTypes']) ? $context['formFieldTypes'] : null), "accountFormFields", array(), "any"), "1");
        echo "
\torderCustomFormFieldsBillingFormId = ";
        // line 423
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formFieldTypes']) ? $context['formFieldTypes'] : null), "billingFormFields", array(), "any"), "1");
        echo ";
\torderCustomFormFieldsShippingFormId = ";
        // line 424
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['formFieldTypes']) ? $context['formFieldTypes'] : null), "shippingFormFields", array(), "any"), "1");
        echo ";

\t";
        // line 426
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "orderId", array(), "any")) {
            echo "\t\tOrder_Form.orderId = ";
            // line 427
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "orderId", array(), "any"), "1");
            echo ";
\t";
        }
        // line 428
        echo "
\t\$(function(){
\t\t";
        // line 431
        if ($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "isDigital", array(), "any")) {
            echo "\t\t\tOrder_Form.setIsDigital(true);
\t\t";
        } else {
            // line 433
            echo "\t\t\tOrder_Form.setIsDigital(false);
\t\t";
        }
        // line 435
        echo "
\t\t";
        // line 437
        if ($this->getAttribute((isset($context['order']) ? $context['order'] : null), "deleted", array(), "any")) {
            echo "\t\t\tOrder_Form.setIsDeleted(true);
\t\t";
        }
        // line 439
        echo "
\t\tOrder_Form.updateBillingEmailAddress(\"";
        // line 441
        echo $this->getEnvironment()->getExtension('interspire')->jsFilter($this->getAttribute($this->getAttribute((isset($context['quote']) ? $context['quote'] : null), "getBillingAddress", array(), "any"), "getEmail", array(), "any"));
        echo "\");
\t});
//]]></script>
";
    }
    public function getquoteItemGridItem($item = null, $config = null, $options = null)
    {
        $context = array(
            "item" => $item,
            "config" => $config,
            "options" => $options,
        );

        // line 52
        $context['interactive'] = twig_default_filter($this->getAttribute((isset($context['options']) ? $context['options'] : null), "interactive", array(), "any"), true);
        echo "<tr class=\"itemRow\" id=\"itemId_";
        // line 53
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "id", array(), "any"), "1");
        echo "\">
\t<td class=\"quoteItemImage\">
\t\t";
        // line 55
        if ($this->getAttribute((isset($context['item']) ? $context['item'] : null), "thumbnail", array(), "any")) {
            echo "\t\t\t<img src=\"";
            // line 56
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "thumbnail", array(), "any"), "1");
            echo "\" alt=\"\" />
\t\t";
        } else {
            // line 57
            echo "\t\t\t&nbsp;
\t\t";
        }
        // line 59
        echo "\t</td>
\t<td>
\t\t<div class=\"quoteItemName\">";
        // line 62
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "name", array(), "any"), "1");
        echo "</div>
\t\t";
        // line 63
        if ($this->getAttribute((isset($context['item']) ? $context['item'] : null), "sku", array(), "any")) {
            echo "\t\t\t<div class=\"quoteItemSku\">";
            // line 64
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "sku", array(), "any"), "1");
            echo "</div>
\t\t";
        }
        // line 65
        echo "\t\t<div class=\"quoteItemConfiguration\">
\t\t\t";
        // line 67
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_iterator_to_array($this->getAttribute((isset($context['item']) ? $context['item'] : null), "variationOptions", array(), "any"));
        $countable = is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable);
        $length = $countable ? count($context['_seq']) : null;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if ($countable) {
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context['name'] => $context['value']) {
            echo "\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t<div class=\"name\">";
            // line 69
            echo twig_escape_filter($this->env, (isset($context['name']) ? $context['name'] : null), "1");
            echo ":</div>
\t\t\t\t\t<div class=\"value\">";
            // line 70
            echo twig_escape_filter($this->env, (isset($context['value']) ? $context['value'] : null), "1");
            echo "</div>
\t\t\t\t</div>
\t\t\t";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if ($countable) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['name'], $context['value'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 72
        echo "\t\t\t";
        // line 73
        $context['_parent'] = (array) $context;
        $context['_seq'] = twig_iterator_to_array($this->getAttribute((isset($context['item']) ? $context['item'] : null), "configuration", array(), "any"));
        $countable = is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable);
        $length = $countable ? count($context['_seq']) : null;
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if ($countable) {
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context['_key'] => $context['field']) {
            echo "\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t";
            // line 75
            if ($this->getAttribute((isset($context['field']) ? $context['field'] : null), "value", array(), "any")) {
                echo "\t\t\t\t\t\t<div class=\"name\">";
                // line 76
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context['field']) ? $context['field'] : null), "name", array(), "any"), "1");
                echo ":</div>
\t\t\t\t\t\t<div class=\"value\">
\t\t\t\t\t\t\t";
                // line 78
                if ($this->getAttribute((isset($context['field']) ? $context['field'] : null), "type", array(), "any") == "file") {
                    echo "\t\t\t\t\t\t\t\t";
                    // line 79
                    echo twig_escape_filter($this->env, $this->getAttribute((isset($context['field']) ? $context['field'] : null), "fileOriginalName", array(), "any"), "1");
                    echo "
\t\t\t\t\t\t\t";
                } elseif ($this->getAttribute((isset($context['field']) ? $context['field'] : null), "type", array(), "any") == "checkbox") {
                    // line 80
                    echo "\t\t\t\t\t\t\t\t";
                    // line 81
                    if ($this->getAttribute((isset($context['field']) ? $context['field'] : null), "value", array(), "any") == 1) {
                        echo getLang("xYes");
                    } else {
                        echo getLang("xNo");
                    }
                    echo "\t\t\t\t\t\t\t";
                } else {
                    // line 82
                    echo "\t\t\t\t\t\t\t\t";
                    // line 83
                    echo twig_escape_filter($this->env, $this->getAttribute((isset($context['field']) ? $context['field'] : null), "value", array(), "any"), "1");
                    echo "
\t\t\t\t\t\t\t";
                }
                // line 84
                echo "\t\t\t\t\t\t</div>
\t\t\t\t\t";
            }
            // line 86
            echo "\t\t\t\t</div>
\t\t\t";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if ($countable) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['field'], $context['_parent'], $context['loop']);
        $context = array_merge($_parent, array_intersect_key($context, $_parent));
        // line 88
        echo "\t\t\t";
        // line 89
        if ($this->getAttribute((isset($context['item']) ? $context['item'] : null), "eventName", array(), "any")) {
            echo "\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t<div class=\"name\">";
            // line 91
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "eventName", array(), "any"), "1");
            echo ":</div>
\t\t\t\t\t<div class=\"value\">";
            // line 92
            echo $this->getEnvironment()->getExtension('interspire')->dateFormat(twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "eventDate", array(true, ), "method"), "1"));
            echo "</div>
\t\t\t\t</div>
\t\t\t";
        }
        // line 94
        echo "\t\t\t";
        // line 95
        if ($this->getAttribute((isset($context['item']) ? $context['item'] : null), "giftWrapping", array(), "any")) {
            echo "\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t<div class=\"name\">";
            // line 97
            echo getLang("GiftWrapping");
            echo ":</div>
\t\t\t\t\t<div class=\"value\">";
            // line 98
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "giftWrapping", array(), "any"), "wrapname", array(), "any"), "1");
            echo " (";
            echo formatPrice(twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "giftWrapping", array(), "any"), "wrapprice", array(), "any"), "1"));
            echo ")</div>
\t\t\t\t</div>
\t\t\t\t";
            // line 100
            if ($this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "giftWrapping", array(), "any"), "wrapmessage", array(), "any")) {
                echo "\t\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t\t<div class=\"name\">";
                // line 102
                echo getLang("GiftMessage");
                echo ":</div>
\t\t\t\t\t\t<div class=\"value\">";
                // line 103
                echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "giftWrapping", array(), "any"), "wrapmessage", array(), "any"), "1");
                echo "</div>
\t\t\t\t\t</div>
\t\t\t\t";
            }
            // line 105
            echo "\t\t\t";
        }
        // line 106
        echo "\t\t\t";
        // line 107
        if ($this->getAttribute((isset($context['item']) ? $context['item'] : null), "isPreOrder", array(), "any")) {
            echo "\t\t\t\t<div class=\"quoteItemConfigurationRow\">
\t\t\t\t\t<div class=\"name\">";
            // line 109
            echo getLang("PreOrder");
            echo ":</div>
\t\t\t\t\t<div class=\"value\">";
            // line 110
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "getPreOrderMessage", array(), "any"), "1");
            echo "</div>
\t\t\t\t</div>
\t\t\t";
        }
        // line 112
        echo "\t\t</div>
\t</td>
\t<td class=\"quoteItemQuantity\">
\t\t";
        // line 116
        if (((isset($context['interactive']) ? $context['interactive'] : null)) && ((!$this->getAttribute((isset($context['item']) ? $context['item'] : null), "isGiftCertificate", array(), "any")))) {
            echo "\t\t\t<input type=\"text\" name=\"quantity\" value=\"";
            // line 117
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "quantity", array(), "any"), "1");
            echo "\" class=\"Field50\" id=\"qty\" />
\t\t";
        } else {
            // line 118
            echo "\t\t\t";
            // line 119
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "quantity", array(), "any"), "1");
            echo "
\t\t";
        }
        // line 120
        echo "\t</td>
\t<td class=\"quoteItemPrice\">
\t\t";
        // line 123
        if (((isset($context['interactive']) ? $context['interactive'] : null)) && ((!$this->getAttribute((isset($context['item']) ? $context['item'] : null), "isGiftCertificate", array(), "any")))) {
            echo "\t\t\t";
            // line 124
            if ($this->getAttribute((isset($context['config']) ? $context['config'] : null), "CurrencyLocation", array(), "any") == "left") {
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context['config']) ? $context['config'] : null), "CurrencyToken", array(), "any"), "1");
            }
            echo "\t\t\t<input type=\"text\" name=\"price\" value=\"";
            // line 125
            echo formatPrice(twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "price", array($this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "quote", array(), "any"), "doesStoreCartDisplayIncludeTax", array(), "any"), ), "method"), "1"), false, false);
            echo "\" class=\"Field50\" />
\t\t\t";
            // line 126
            if ($this->getAttribute((isset($context['config']) ? $context['config'] : null), "CurrencyLocation", array(), "any") == "right") {
                echo twig_escape_filter($this->env, $this->getAttribute((isset($context['config']) ? $context['config'] : null), "CurrencyToken", array(), "any"), "1");
            }
            echo "\t\t";
        } else {
            // line 127
            echo "\t\t\t";
            // line 128
            echo formatPrice(twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "price", array($this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "quote", array(), "any"), "doesStoreCartDisplayIncludeTax", array(), "any"), ), "method"), "1"));
            echo "
\t\t";
        }
        // line 129
        echo "\t</td>
\t<td class=\"quoteItemTotal\"><span>";
        // line 131
        echo formatPrice(twig_escape_filter($this->env, $this->getAttribute((isset($context['item']) ? $context['item'] : null), "total", array($this->getAttribute($this->getAttribute((isset($context['item']) ? $context['item'] : null), "quote", array(), "any"), "doesStoreCartDisplayIncludeTax", array(), "any"), ), "method"), "1"));
        echo "</span></td>
\t";
        // line 132
        if ((isset($context['interactive']) ? $context['interactive'] : null)) {
            echo "\t\t<td class=\"quoteItemAction\">
\t\t\t";
            // line 134
            if ((!$this->getAttribute((isset($context['item']) ? $context['item'] : null), "isGiftCertificate", array(), "any"))) {
                echo "\t\t\t\t<a href=\"#\" class=\"customizeItemLink\">";
                // line 135
                echo getLang("Customize");
                echo "</a>
\t\t\t\t<a href=\"#\" class=\"copyItemLink\">";
                // line 136
                echo getLang("Copy");
                echo "</a>
\t\t\t";
            } else {
                // line 137
                echo "\t\t\t\t<span class=\"Disabled\">";
                // line 138
                echo getLang("Customize");
                echo "</span>
\t\t\t\t<span class=\"Disabled\">";
                // line 139
                echo getLang("Copy");
                echo "</span>
\t\t\t";
            }
            // line 140
            echo "\t\t\t<a href=\"#\" class=\"deleteItemLink\">";
            // line 141
            echo getLang("Delete");
            echo "</a>
\t\t</td>
\t";
        }
        // line 143
        echo "</tr>
";
    }
示例#18
0
        if (inStock($featuredVariant)) {
            ?>
							<button class="uk-margin-small-top uk-button uk-width-1-1 uk-button-primary" type="submit"><?php 
            echo l::get('buy');
            ?>
 <?php 
            echo formatPrice($featuredPrice);
            ?>
</button>
						<?php 
        } else {
            ?>
							<button class="uk-margin-small-top uk-button uk-width-1-1" disabled><?php 
            echo l::get('out-of-stock');
            ?>
 <?php 
            echo formatPrice($featuredPrice);
            ?>
</button>
						<?php 
        }
        ?>
		            </form>
			  	</div>
		  </li>
	  <?php 
    }
    ?>
	</ul>
<?php 
}
示例#19
0
</h1>

                <?php 
if (count($variants)) {
    ?>
                    <?php 
    foreach ($variants as $variant) {
        ?>

                    <div class="product__price">
                        <?php 
        if ($saleprice = salePrice($variant)) {
            echo '<ins class="price--sale">' . formatPrice($saleprice) . '</ins> ';
            echo '<del class="price--crossed">' . formatPrice($variant->price()->value) . '</del>';
        } else {
            echo formatPrice($variant->price()->value);
        }
        ?>
                    </div>

                    <div class="product__options">
                        <form method="post" action="<?php 
        echo url('shop/cart');
        ?>
">

                            <!-- Hidden fields -->
			            	<input type="hidden" name="action" value="add">
			            	<input type="hidden" name="uri" value="<?php 
        echo $page->uri();
        ?>
示例#20
0
 $smarty->assign("T_CAN_ADD_PAYMENT", $canAddPayment);
 $result = eF_getTableData("payments", "*", "users_LOGIN='******'login'] . "'", "timestamp desc");
 $payments = array();
 foreach ($result as $value) {
     $payments[$value['id']] = $value;
 }
 $smarty->assign("T_USER_PAYMENTS", sizeof($payments));
 $smarty->assign("T_USER_TRANSACTIONS_NUM", sizeof($trans));
 if (isset($_GET['ajax']) && $canAddPayment && isset($_GET['balance'])) {
     try {
         if (is_numeric($_GET['balance']) && $_GET['balance'] > 0 && ($_GET['balance'] <= $currentUser->user['balance'] || $currentUser->user['user_type'] == 'administrator')) {
             $editedUser->user['balance'] += $_GET['balance'];
             $response = array('status' => 1, 'user_balance' => _BALANCE . ': ' . formatPrice($editedUser->user['balance']));
             if ($currentUser->user['user_type'] != 'administrator') {
                 $currentUser->user['balance'] -= $_GET['balance'];
                 $response['supervisor_balance'] = _CURRENTBALANCEINYOURACCOUNT . ': ' . formatPrice($currentUser->user['balance']);
             }
             $editedUser->persist();
             $currentUser->persist();
             echo json_encode($response);
         } else {
             throw new Exception(_YOUCANTADDTHISBALANCE);
         }
     } catch (Exception $e) {
         handleAjaxExceptions($e);
     }
     exit;
 }
 $smarty->assign("T_PAYMENT_METHODS", payments::$methods);
 $tableName = 'paymentsTable';
 $dataSource = $payments;
示例#21
0
/**
 * Generate and calculate a formatted price for a product. This function will
 * take in a product and a price, apply tax where necessary, convert it to
 * the displayed currency, format it, and if there's a retail price for the
 * product, show it struck out.
 *
 * Options passed as $options include:
 * - currencyConvert (true) - Convert the price in to the active currency
 * - strikeRetail (true) - If there is an RRP, strike it out & show before the product
 * - displayInclusive (false) - Set to true if the returned price should include tax
 * - includesTax (null) - Set to true if $price already includes tax
 * - localeFormat (true) - Perform any locale formatting (formatPrice)
 *
 * @param array $product Array containing the product to format the price for.
 * @param double $price Price of the product to be formatted.
 * @param array $options Array of options for formatting the price.
 */
function formatProductPrice($product, $price, array $options = array())
{
	$defaultOptions = array(
		'currencyConvert' => true,
		'strikeRetail' => true,
		'displayInclusive' => false,
		'includesTax' => null,
		'localeFormat' => true
	);
	$options = array_merge($defaultOptions, $options);

	$actualPrice = calculateFinalProductPrice($product, $price, $options);

	// Apply taxes to the price
	$actualPrice = getClass('ISC_TAX')->getPrice(
		$actualPrice,
		$product['tax_class_id'],
		$options['displayInclusive']
	);

	// Convert to the current currency
	if($options['currencyConvert']) {
		$actualPrice = convertPriceToCurrency($actualPrice);
	}

	$output = '';

	if(!$options['localeFormat']) {
		return $actualPrice;
	}

	if($product['prodretailprice'] > 0 && $options['strikeRetail'] && $product['prodretailprice'] > $actualPrice ) {
		$rrp = calculateFinalProductPrice($product, $product['prodretailprice']);
		$rrp = getClass('ISC_TAX')->getPrice(
			$rrp,
			$product['tax_class_id'],
			$options['displayInclusive']
		);
		$rrp = convertPriceToCurrency($rrp);

		$output .= '<strike class="RetailPriceValue">'.formatPrice($rrp).'</strike> ';
	}

	if($product['prodsaleprice'] > 0 && $product['prodsaleprice'] < $product['prodprice']) {
		$output .= '<span class="SalePrice">'.formatPrice($actualPrice).'</span>';
	}
	else {
		$output .= formatPrice($actualPrice);
	}

	return $output;
}
示例#22
0
                    $minVariant = $variant;
                    $minPrice = $variant->price()->value;
                    $minSalePrice = salePrice($variant);
                }
            }
            $count++;
        }
        ?>

                    <div class="price  product-item__price">
    					<?php 
        if ($minSalePrice) {
            $priceFormatted = '<ins class="price--sale">' . formatPrice($minSalePrice) . '</ins>';
            $priceFormatted .= ' <del class="price--crossed">' . formatPrice($minPrice) . '</del>';
        } else {
            $priceFormatted = formatPrice($minPrice);
        }
        if ($count) {
            $priceFormatted = $priceFormatted;
        }
        echo $priceFormatted;
        ?>
                    </div>

                </div>
            </li>

        <?php 
    }
    ?>
示例#23
0
					<span class="radio-checkbox">
						<input type="radio" aria-label="Select type of delivery." <?php 
    echo $selected_delivery === $delivery ? 'checked' : '';
    ?>
 />
					</span>
					<h4 class="list-group-item-heading"><?php 
    echo $delivery->val('delivery_type_name');
    ?>
</h4>
						
					<?php 
    if ($delivery->val('delivery_type_min_order_cost') > 0) {
        ?>
								<p class="list-group-item-text"><?php 
        echo t('Spend at least %s to use this type of delivery.', formatPrice($delivery->val('delivery_type_min_order_cost')));
        ?>
</p>
							<?php 
    }
    ?>
					
				</a>
			<?php 
}
?>
</div>

<input type="hidden" name="delivery_type_id" id="delivery_type_id" value="<?php 
echo $selected_delivery->val('delivery_type_id');
?>
示例#24
0
					<span class="radio-checkbox">
						<input type="radio" aria-label="Select payment type." <?php 
    echo $selected_payment === $payment ? 'checked' : '';
    ?>
  />
					</span>
					<h4 class="list-group-item-heading"><?php 
    echo $payment->val('payment_type_name');
    ?>
</h4>
					
					<?php 
    if ($payment->val('payment_type_min_order_cost') > 0) {
        ?>
								<p class="list-group-item-text"><?php 
        echo t('Minimum shopping value %s.', formatPrice($payment->val('payment_type_min_order_cost')));
        ?>
</p>
							<?php 
    }
    ?>
				</a>
			<?php 
}
?>
</div>

<input type="hidden" name="payment_type_id" id="payment_type_id" value="<?php 
echo $selected_payment->val('payment_type_id');
?>
" />
示例#25
0
// Page URI sent via POST
$p = page(get('uri'));
// Initialize the PDF
$pdf = new FPDF('P', 'in', 'Letter');
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 12);
// Build the content
$pdf->Cell(0, 0.3, site()->title(), 0, 2);
// Site title
$pdf->Cell(0, 0.3, $p->txn_id()->value, 0, 2);
// Invoice #
$pdf->Cell(0, 0.3, date('F j, Y H:i', $p->txn_date()->value), 0, 2);
// Date of order
$pdf->Ln(0.3);
// Line break
$pdf->Cell(0, 0.3, l::get('bill-to') . ': ' . $p->payer_id()->value . '   ' . $p->payer_email()->value, 0, 2);
// Payer id and email
$pdf->Ln(0.3);
// Line break
// List products
$products = explode('<br />', $p->products()->kirbytext());
foreach ($products as $product) {
    $pdf->Cell(0, 0.3, trim(trim($product, '<p>'), '</p>'), 0, 2);
}
$pdf->Ln(0.3);
// Line break
// Order price summary
$pdf->Cell(0, 0.5, l::get('subtotal') . ': ' . formatPrice($p->subtotal()->value) . '     ' . l::get('shipping') . ': ' . formatPrice($p->shipping()->value) . '     ' . l::get('tax') . ': ' . formatPrice($p->tax()->value), 0, 2);
$pdf->Cell(0, 0.5, l::get('tax') . ': ' . formatPrice($p->subtotal()->value + $p->shipping()->value + $p->tax()->value), 0, 2);
// Write the PDF
$pdf->Output($p->txn_id()->value . '.pdf', 'D');
示例#26
0
				<div style="max-width: <?php 
        echo $thumb->width();
        ?>
px;" class="uk-margin-small-top">
					<h3 class="uk-margin-remove" property="name"><?php 
        echo $product->title()->html();
        ?>
</h3>

		    		<?php 
        $variants = $product->variants()->yaml();
        foreach ($variants as $key => $variant) {
            $pricelist[] = $variant['price'];
        }
        // Add all prices to the pricelist
        $priceFormatted = formatPrice(min($pricelist));
        // Find the lowest price and format it
        if (count($variants) > 1) {
            $priceFormatted = 'From ' . $priceFormatted;
        }
        // If there are multiple prices, add "From" to the label"
        $pricelist = [];
        // Clear the pricelist
        ?>
					<p property="offers" typeof="Offer">
						<span class="uk-button uk-button-primary"><?php 
        echo $priceFormatted;
        ?>
</span>
					</p>
示例#27
0
    /**
     * Convert course to HTML list
     *
     * This function converts the course to an HTML list
     * with the lessons it contains.
     * <br/>Example:
     * <code>
     * $course -> toHTML();
     * </code>
     *
     * @param array $userInfo User information to customize data for
     * @param $options Specific display options
     * @return string The HTML code of the course list
     * @since 3.5.0
     * @access public
     * @todo convert to smarty template
     */
    public function toHTML($lessons = false, $options = array(), $checkLessons = array(), $meets_depends_on_criteria = true)
    {
        !isset($options['courses_link']) ? $options['courses_link'] = false : null;
        !isset($options['lessons_link']) ? $options['lessons_link'] = false : null;
        /*	if (isset($options['collapse']) && $options['collapse'] == 2) {
        			$display 			= '';
        			$display_lessons 	= 'style = "display:none"';
        			$imageString = 'down';
        		} elseif (isset($options['collapse']) && $options['collapse'] == 1) {
        			$display 			= 'style = "display:none"';
        			$display_lessons 	= 'style = "display:none"';
        			$classString = ' class = "visible" ';
        			$imageString = 'up';
        		} else {
        			$display 			= '';
        			$display_lessons 	= '';
        			$classString = ' class = "visible" ';
        			$imageString = 'up';
        		}
        	*/
        $display = '';
        $display_lessons = '';
        $classString = ' class = "visible" ';
        $imageString = 'up';
        $roles = EfrontLessonUser::getLessonsRoles();
        $roleNames = EfrontLessonUser::getLessonsRoles(true);
        if ($this->course['user_type']) {
            $roleBasicType = $roles[$this->course['user_type']];
            //The basic type of the user's role in the course
        } else {
            $roleBasicType = null;
        }
        $courseLessons = $this->getCourseLessons();
        if ($lessons) {
            foreach ($courseLessons as $key => $value) {
                $courseLessons[$key]->lesson = array_merge($lessons[$key]->lesson, $courseLessons[$key]->lesson);
            }
        }
        if ($roleBasicType == 'student') {
            // fixed to apply checkRules to sub-student user types
            if (empty($checkLessons)) {
                $checkLessons = $courseLessons;
            } else {
                foreach ($courseLessons as $key => $value) {
                    if (isset($checkLessons[$key])) {
                        $checkLessons[$key]->lesson['start_date'] = $value->lesson['start_date'];
                        $checkLessons[$key]->lesson['end_date'] = $value->lesson['end_date'];
                        $checkLessons[$key]->lesson['start_period'] = $value->lesson['start_period'];
                        $checkLessons[$key]->lesson['end_period'] = $value->lesson['end_period'];
                        $temp[$key] = $checkLessons[$key];
                        //bring them in the correct order
                    }
                }
                $checkLessons = $temp;
            }
            $eligible = $this->checkRules($this->course['users_LOGIN'], $checkLessons);
        } else {
            if (sizeof($courseLessons) > 0) {
                $eligible = array_combine(array_keys($courseLessons), array_fill(0, sizeof($courseLessons), 1));
                //All lessons set to true
            } else {
                $eligible = array();
            }
        }
        //$eligible = array_combine(array_keys($this -> getLessons()), array_fill(0, sizeof($this -> getLessons()), 1));    //All lessons set to true
        foreach ($eligible as $lessonId => $value) {
            $eligible[$lessonId] = $courseLessons[$lessonId];
            $eligible[$lessonId]->eligible = $value;
        }
        $courseString = '
                        <table class = "coursesTable" >
                            <tr class = "lessonsList"  >

                            	<td>
                                    <img id = "course_img' . $this->course['id'] . '" src = "images/32x32/courses.png">';
        if (!isset($this->course['from_timestamp']) || $this->course['from_timestamp']) {
            if ($options['courses_link'] && $options['courses_link'] === true) {
                $coursesLink = basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_info';
            } else {
                if ($options['courses_link']) {
                    $coursesLink = str_replace("#user_type#", $roleBasicType, $options['courses_link']) . $this->course['id'];
                } elseif ($options['tooltip']) {
                    $coursesLink = 'javascript:void(0)';
                } else {
                    $coursesLink = '';
                }
            }
            if (EfrontUser::isOptionVisible('tooltip')) {
                if ($options['tooltip']) {
                    $courseString .= '
										<a href = "' . $coursesLink . '" class = "info" url = "ask_information.php?courses_ID=' . $this->course['id'] . '" >
											<span class = "listName">' . $this->course['name'] . '</span>
										</a>';
                } else {
                    $options['courses_link'] ? $courseString .= '<a href = "' . $coursesLink . '">' . $this->course['name'] . '</a>' : ($courseString .= $this->course['name']);
                }
            } else {
                $courseString .= $this->course['name'];
            }
        } else {
            $courseString .= '<a href = "javascript:void(0)" class = "inactiveLink" title = "' . _CONFIRMATIONPEDINGFROMADMIN . '">' . $this->course['name'] . '</a>';
        }
        if ($this->course['different_role']) {
            $courseString .= '<span class = "courseRole">&nbsp;(' . $roleNames[$this->course['user_type']] . ')</span>';
        }
        if ($this->course['module_restriction_message']) {
            $courseString .= '<span style = "vertical-align:middle">&nbsp;(' . $this->course['module_restriction_message'] . ')</span>';
            if ($roleBasicType == 'student') {
                foreach ($eligible as $lessonId => $value) {
                    $eligible[$lessonId]->eligible = false;
                }
            }
        } else {
            if ($this->course['start_date'] > time()) {
                $courseString .= '<span style = "vertical-align:middle">&nbsp;(' . _COURSESTARTSAT . ' ' . formatTimestamp($this->course['start_date'], 'time_nosec') . ')</span>';
                if ($roleBasicType == 'student') {
                    foreach ($eligible as $lessonId => $value) {
                        $eligible[$lessonId]->eligible = false;
                    }
                }
            } elseif (!is_null($this->course['remaining']) && $roleBasicType == 'student') {
                if ($this->course['remaining'] > 0) {
                    $courseString .= '<span style = "vertical-align:middle">&nbsp;(' . eF_convertIntervalToTime($this->course['remaining'], true) . ' ' . mb_strtolower(_REMAINING) . ')</span>';
                } else {
                    $courseString .= '<span style = "vertical-align:middle">&nbsp;(' . _ACCESSEXPIRED . ')</span>';
                    foreach ($eligible as $lessonId => $value) {
                        $eligible[$lessonId]->eligible = false;
                    }
                }
            }
        }
        if (!$meets_depends_on_criteria && $this->course['depends_on'] && $roleBasicType == 'student') {
            foreach ($eligible as $lessonId => $value) {
                $eligible[$lessonId]->eligible = false;
            }
        }
        $courseOptions = array();
        if ($roleBasicType == 'professor') {
            if (!isset($GLOBALS['currentUser']->coreAccess['course_settings']) || $GLOBALS['currentUser']->coreAccess['course_settings'] != 'hidden') {
                $autocompleteImage = '16x16/certificate.png';
                if (G_VERSIONTYPE == 'community') {
                    #cpp#ifdef COMMUNITY
                    $autocompleteImage = '16x16/autocomplete.png';
                }
                #cpp#endif
                $courseOptions['information'] = '<img src = "images/16x16/information.png" title = "' . _COURSEINFORMATION . '" alt = "' . _COURSEINFORMATION . '" class = "ajaxHandle" onclick = "location = \'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_info\'" />&nbsp;';
                $courseOptions['completion'] = '<img src = "images/' . $autocompleteImage . '" title = "' . _COMPLETION . '" alt = "' . _COMPLETION . '" class = "ajaxHandle" onclick = "location = \'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_certificates\'" />&nbsp;';
                $courseOptions['rules'] = '<img src = "images/16x16/rules.png" title = "' . _COURSERULES . '" alt = "' . _COURSERULES . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_rules\'" />&nbsp;';
                $courseOptions['order'] = '<img src = "images/16x16/order.png" title = "' . _COURSEORDER . '" alt = "' . _COURSEORDER . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_order\'" />&nbsp;';
                $courseOptions['schedule'] = '<img src = "images/16x16/calendar.png" title = "' . _COURSESCHEDULE . '" alt = "' . _COURSESCHEDULE . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=course_scheduling\'" />&nbsp;';
                if (!isset($GLOBALS['currentUser']->coreAccess['course_settings']) || $GLOBALS['currentUser']->coreAccess['course_settings'] == 'change') {
                    $courseOptions['export'] = '<img src = "images/16x16/export.png" title = "' . _EXPORTCOURSE . '" alt = "' . _EXPORTCOURSE . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=export_course\'" />&nbsp;';
                    $courseOptions['import'] = '<img src = "images/16x16/import.png" title = "' . _IMPORTCOURSE . '" alt = "' . _IMPORTCOURSE . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=import_course\'" />&nbsp;';
                }
                foreach ($GLOBALS['currentUser']->getModules() as $module) {
                    if ($moduleTabPage = $module->getTabPageSmartyTpl('course_settings')) {
                        $courseOptions[$moduleTabPage['tab_page']] = '<img src = "' . $moduleTabPage['image'] . '" title = "' . $moduleTabPage['title'] . '" alt = "' . $moduleTabPage['title'] . '" class = "ajaxHandle" onclick = "location=\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&op=' . $moduleTabPage['tab_page'] . '\'"/>&nbsp;';
                    }
                }
                $courseString .= '<span style = "margin-left:30px">(' . _COURSEACTIONS . ': ' . implode('', $courseOptions) . ')</span>';
            }
        } else {
            if ($this->course['completed']) {
                $courseOptions['completed'] = '<img src = "images/16x16/success.png" title = "' . _COURSECOMPLETED . ': ' . formatTimestamp($this->course['to_timestamp'], 'time') . '" alt = "' . _COURSECOMPLETED . ': ' . formatTimestamp($this->course['to_timestamp'], 'time') . '">&nbsp;';
            }
            if ($this->course['issued_certificate']) {
                $dateTable = unserialize($this->course['issued_certificate']);
                $certificateExportMethod = $this->options['certificate_export_method'];
                if (G_VERSIONTYPE != 'community') {
                    #cpp#ifndef COMMUNITY
                    if ($this->course['certificate_expiration'] != "" && $this->course['certificate_expiration'] != 0) {
                        //$dateFormat = eF_dateFormat();
                        if (eF_checkParameter($dateTable['date'], 'timestamp')) {
                            //new way that issued date saves
                            //$expirationTimestamp = $this -> course['certificate_expiration'] + $dateTable['date'];
                            $expirationArray = convertTimeToDays($this->course['certificate_expiration']);
                            $expirationTimestamp = getCertificateExpirationTimestamp($dateTable['date'], $expirationArray);
                        } else {
                            //old way..works only for english
                            $expirationTimestamp = $this->course['certificate_expiration'] + strtotime($dateTable['date']);
                        }
                        $dateExpire = formatTimestamp($expirationTimestamp);
                        $tooltipCourseString = "<strong>" . _CERTIFICATEISSUEDON . ":</strong>&nbsp;" . formatTimestamp($dateTable['date']) . "<br /><strong>" . ($expirationTimestamp > time() ? _CERTIFICATEEXPIRESON : _CERTIFICATEEXPIREDON) . ":</strong>&nbsp;" . $dateExpire . "<br /><strong>" . _RESETCOURSEAFTEREXPIRATION . ":</strong>&nbsp;" . ($this->course['reset'] == 1 ? _YES : _NO);
                        if ($expirationTimestamp > time()) {
                            $courseOptions['certificate'] = '<img class = "ajaxHandle info" src = "images/16x16/certificate.png" title = "' . _COURSECERTIFICATE . '" alt = "' . _COURSECERTIFICATE . '" onclick = "window.open(\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&export=' . $certificateExportMethod . '&user='******'users_LOGIN'] . '\')" onmouseover = "new Tip(this, $(\'certificate_details_\'+' . $this->course['id'] . '));"><span id = "certificate_details_' . $this->course['id'] . '" style = "display:none">' . $tooltipCourseString . '</span>&nbsp;';
                        } else {
                            $courseOptions['certificate'] = '<img class = "ajaxHandle info" src = "images/16x16/certificate.png" title = "' . _COURSECERTIFICATE . '" alt = "' . _COURSECERTIFICATE . '" onmouseover = "new Tip(this, $(\'certificate_details_\'+' . $this->course['id'] . '));" /><span id = "certificate_details_' . $this->course['id'] . '" style = "display:none">' . $tooltipCourseString . '</span>&nbsp;';
                        }
                        //$courseString .= "<a class = 'info' href = 'javascript:void(0)'>"._DETAILS."<span class = 'tooltipSpan'>".$tooltipCourseString."</span></a>";
                    } else {
                        $courseOptions['certificate'] = '<img class = "ajaxHandle info" src = "images/16x16/certificate.png" title = "' . _COURSECERTIFICATE . '" alt = "' . _COURSECERTIFICATE . '" onclick = "window.open(\'' . basename($_SERVER['PHP_SELF']) . '?ctg=lessons&course=' . $this->course['id'] . '&export=' . $certificateExportMethod . '&user='******'users_LOGIN'] . '\')"/>&nbsp;';
                    }
                }
                #cpp#endif
            }
            $courseString .= '<span style = "margin-left:30px">' . implode('', $courseOptions) . '</span>';
        }
        $courseString .= '
                                </td><td>';
        if (isset($options['buy_link']) && $options['buy_link'] && sizeof($this->getInstances()) == 0 && !$this->course['has_course'] && !$this->course['reached_max_users'] && $_SESSION['s_type'] != 'administrator') {
            $this->course['price'] ? $priceString = formatPrice($this->course['price'], array($this->options['recurring'], $this->options['recurring_duration']), true) : ($priceString = false);
            $courseString .= '
                    					<span class = "buyLesson">
                                        	<span onclick = "addToCart(this, \'' . $this->course['id'] . '\', \'course\')">' . $priceString . '</span>
                    						<img class = "ajaxHandle" src = "images/16x16/shopping_basket_add.png" alt = "' . _BUY . '" title = "' . _BUY . '" onclick = "addToCart(this, \'' . $this->course['id'] . '\', \'course\')">
                                        </span>';
        }
        $courseString .= '
                                </td></tr>';
        if (sizeof($eligible) > 0) {
            //changed from subtree_course to subcoursetree because of #1332
            $courseString .= '
                            <tr id = "subcoursetree' . $this->course['id'] . '" name = "default_visible" ' . $display_lessons . '>
                                <td colspan = "2">
                                	<table>';
            foreach ($eligible as $lessonId => $lesson) {
                //Changed because of #4492 where lesson was completed but course was not and $lesson was unset in material in process
                $roleBasicType = $roles[$lesson->lesson['user_type']] ? $roles[$lesson->lesson['user_type']] : $roles[$this->course['user_type']];
                $courseString .= '<tr class = "directionEntry">';
                if (isset($lesson->lesson['active_in_lesson']) && !$lesson->lesson['active_in_lesson']) {
                    $courseString .= '<td style = "padding-bottom:2px"></td><td><a href = "javascript:void(0)" class = "inactiveLink" title = "' . _CONFIRMATIONPEDINGFROMADMIN . '">' . $lesson->lesson['name'] . '</a></td>';
                } else {
                    if (!$lesson->eligible) {
                        if ($lesson->lesson['completed']) {
                            if ($lesson->options['show_percentage'] != 0) {
                                $courseString .= '
							<td class = "lessonProgress">
                                <span class = "progressNumber completedLessonProgress" style = "width:50px;">&nbsp;</span>
                                <span class = "progressBar completedLessonProgress" style = "width:50px;text-align:center"><img src = "images/16x16/success.png" alt = "' . _LESSONCOMPLETE . '" title = "' . _LESSONCOMPLETE . '" /></span>
                                &nbsp;&nbsp;
                            </td>';
                            } else {
                                $courseString .= '
							<td class = "lessonProgress">
                            </td>';
                            }
                        } else {
                            if ($lesson->options['show_percentage'] != 0) {
                                $courseString .= '
							<td class = "lessonProgress">
                                <span class = "progressNumber incompletedLessonProgress" style = "width:50px;">' . $lesson->lesson['overall_progress']['percentage'] . '%</span>
                                <span class = "progressBar incompletedLessonProgress" style = "width:' . $lesson->lesson['overall_progress']['percentage'] / 2 . 'px;">&nbsp;</span>
                                &nbsp;&nbsp;
                            </td>';
                            } else {
                                $courseString .= '
							<td class = "lessonProgress">
                            </td>';
                            }
                        }
                        if (EfrontUser::isOptionVisible('tooltip')) {
                            $courseString .= '
							<td>
                            	<a href = "javascript:void(0)" title = "" class = "inactiveLink info" url = "ask_information.php?lessons_ID=' . $lesson->lesson['id'] . '&from_course=' . $this->course['id'] . '">
                            		' . $lesson->lesson['name'] . '
                            	</a>
                            <td>';
                        } else {
                            $courseString .= '
							<td>
                            	<a href = "javascript:void(0)" title = "" class = "inactiveLink">
                            		' . $lesson->lesson['name'] . '
                            	</a>
                            <td>';
                        }
                    } else {
                        if ($lesson->lesson['user_type'] && $roles[$lesson->lesson['user_type']] == 'student' && $lesson->lesson['completed']) {
                            //Show the progress bar
                            if ($lesson->options['show_percentage'] != 0) {
                                $courseString .= '
							<td class = "lessonProgress">
                                <span class = "progressNumber completedLessonProgress" style = "width:50px;">&nbsp;</span>
                                <span class = "progressBar completedLessonProgress" style = "width:50px;text-align:center"><img src = "images/16x16/success.png" alt = "' . _LESSONCOMPLETE . '" title = "' . _LESSONCOMPLETE . '" style = "vertical-align:middle" /></span>
                                &nbsp;&nbsp;
                            </td>';
                            } else {
                                $courseString .= '
							<td class = "lessonProgress">
                            </td>';
                            }
                        } elseif ($lesson->lesson['user_type'] && $roles[$lesson->lesson['user_type']] == 'student') {
                            if ($lesson->options['show_percentage'] != 0) {
                                $courseString .= '
							<td class = "lessonProgress">
                                <span class = "progressNumber incompletedLessonProgress" style = "width:50px;">' . $lesson->lesson['overall_progress']['percentage'] . '%</span>
                                <span class = "progressBar incompletedLessonProgress" style = "width:' . $lesson->lesson['overall_progress']['percentage'] / 2 . 'px;">&nbsp;</span>
                                &nbsp;&nbsp;
                            </td>';
                            } else {
                                $courseString .= '
							<td class = "lessonProgress">
                            </td>';
                            }
                        } else {
                            $courseString .= '
							<td></td>';
                        }
                        if (EfrontUser::isOptionVisible('tooltip')) {
                            $courseString .= '
                    		<td>
                    			' . ($options['lessons_link'] ? '<a href = "' . str_replace("#user_type#", $roleBasicType, $options['lessons_link']) . $lesson->lesson['id'] . '&from_course=' . $this->course['id'] . '" class = "info" url = "ask_information.php?lessons_ID=' . $lesson->lesson['id'] . '&from_course=' . $this->course['id'] . '">' . $lesson->lesson['name'] . '</a>' : $lesson->lesson['name']) . '
                                </td>';
                        } else {
                            $courseString .= '
                    		<td>
                    			' . ($options['lessons_link'] ? '<a href = "' . str_replace("#user_type#", $roleBasicType, $options['lessons_link']) . $lesson->lesson['id'] . '&from_course=' . $this->course['id'] . '" >' . $lesson->lesson['name'] . '</a>' : $lesson->lesson['name']) . '
                                </td>';
                        }
                    }
                }
                $courseString .= '';
            }
            $courseString .= '
								</tr>
                            </table>
                        </td></tr>';
        }
        $courseString .= '
                        </table>';
        return $courseString;
    }
示例#28
0
                    <?php 
            foreach ($shipping_rates as $rate) {
                ?>
                        <!-- Value needs both rate and title so we can pass the shipping method name through to the order log -->
                        <option value="<?php 
                echo $rate['title'];
                ?>
::<?php 
                echo sprintf('%0.2f', $rate['rate']);
                ?>
">
                            <?php 
                echo $rate['title'];
                ?>
 (<?php 
                echo formatPrice($rate['rate']);
                ?>
)
                        </option>
                    <?php 
            }
            ?>
                <?php 
        } else {
            ?>
                    <!-- If no shipping rates are set, show free shipping -->
                    <option value="<?php 
            echo l::get('free-shipping');
            ?>
::0.00"><?php 
            echo l::get('free-shipping');
示例#29
0
</span>
                    </li>
                    <?php 
    }
    ?>

                </ul>

                <div class="cart__subtotal">
                    <div class="subtotal__title"><?php 
    echo l::get('total');
    ?>
</div>
                    <div class="subtotal__cost">
                        <?php 
    echo formatPrice($cart->getAmount() + $tax + $shipping['rate'] - $discountAmount);
    ?>
                    </div>
                </div>

                <!-- Paypal form -->
                <form method="post" action="<?php 
    echo url('shop/cart/process');
    ?>
">

                    <?php 
    if (page('shop')->paypal_action() != 'live') {
        ?>
                        <div class="message  message--warning">
                            <?php 
示例#30
0
/**
 *	Email the invoice from an order to a customer
 *
 * @param int The ID of the order to email the invoice for.
 * @param int The optional ID of the order status. Will default to the already stored status ID of the order
 */
function EmailInvoiceToCustomer($orderId, $newStatusId=null)
{
	// Load the details for this order
	$order_row = GetOrder($orderId, true);
	if($order_row === false) {
		return false;
	}

	// All prices in the emailed invoices will be shown in the default currency of the store
	$defaultCurrency = GetDefaultCurrency();

	$GLOBALS['OrderNumber'] = $orderId;

	if (isId($newStatusId)) {
		$order_status = $newStatusId;
	} else {
		$order_status = $order_row['ordstatus'];
	}

	$order_payment_module = $order_row['orderpaymentmodule'];

	if($order_row['ordcustid'] > 0) {
		$GLOBALS['ViewOrderStatusMsg'] = GetLang('ASummaryIsShownBelow')." <a href='".$GLOBALS['ShopPath']."/orderstatus.php'>".GetLang('ClickHere')."</a>.";
	} else {
		$GLOBALS['ViewOrderStatusMsg'] = "";
	}

	$emailTemplate = FetchEmailTemplateParser();

	if ($order_row['shipping_address_count'] > 1) {
		// multiple shipping addresses
		$GLOBALS['ShippingAddress'] = GetLang('OrderWillBeShippedToMultipleAddresses');
	} else if ($order_row['shipping_address_count'] == 0) {
		// no shipping addresses (digital order)
		$GLOBALS['ShippingAddress'] = GetLang('ShippingImmediateDownload');
	} else {
		// single shipping address
		$address = $GLOBALS['ISC_CLASS_DB']->FetchRow("
			SELECT
				oa.*
			FROM
				`[|PREFIX|]order_addresses` oa
			WHERE
				oa.order_id = " . (int)$order_row['orderid'] . "
		");

		$GLOBALS['ShipFullName'] = isc_html_escape($address['first_name'].' '.$address['last_name']);

		$GLOBALS['ShipCompany'] = '';
		if($address['company']) {
			$GLOBALS['ShipCompany'] = '<br />'.isc_html_escape($address['company']);
		}

		$GLOBALS['ShipAddressLines'] = isc_html_escape($address['address_1']);

		if ($address['address_2'] != "") {
			$GLOBALS['ShipAddressLines'] .= '<br />' . isc_html_escape($address['address_2']);
		}

		$GLOBALS['ShipSuburb'] = isc_html_escape($address['city']);
		$GLOBALS['ShipState'] = isc_html_escape($address['state']);
		$GLOBALS['ShipZip'] = isc_html_escape($address['zip']);
		$GLOBALS['ShipCountry'] = isc_html_escape($address['country']);
		$GLOBALS['ShipPhone'] = isc_html_escape($address['phone']);

		// show shipping email, if any
		if(!$address['email']) {
			$GLOBALS['HideShippingEmail'] = 'display: none';
		} else {
			$GLOBALS['ShippingEmail'] = $address['email'];
		}

		$GLOBALS['ShippingAddress'] = $emailTemplate->GetSnippet("AddressLabel");
	}

	// Format the billing address
	$GLOBALS['ShipFullName'] = isc_html_escape($order_row['ordbillfirstname'].' '.$order_row['ordbilllastname']);

	$GLOBALS['ShipCompany'] = '';
	if($order_row['ordbillcompany']) {
		$GLOBALS['ShipCompany'] = '<br />'.isc_html_escape($order_row['ordbillcompany']);
	}

	$GLOBALS['ShipAddressLines'] = isc_html_escape($order_row['ordbillstreet1']);

	if ($order_row['ordbillstreet2'] != "") {
		$GLOBALS['ShipAddressLines'] .= '<br />' . isc_html_escape($order_row['ordbillstreet2']);
	}

	$GLOBALS['ShipSuburb'] = isc_html_escape($order_row['ordbillsuburb']);
	$GLOBALS['ShipState'] = isc_html_escape($order_row['ordbillstate']);
	$GLOBALS['ShipZip'] = isc_html_escape($order_row['ordbillzip']);
	$GLOBALS['ShipCountry'] = isc_html_escape($order_row['ordbillcountry']);
	$GLOBALS['ShipPhone'] = isc_html_escape($order_row['ordbillphone']);

	// show billing email, if any
	if(!$order_row['ordbillemail']) {
		$GLOBALS['HideBillingEmail'] = 'display: none';
	} else {
		$GLOBALS['BillingEmail'] = $order_row['ordbillemail'];
	}

	$GLOBALS['BillingAddress'] = $emailTemplate->GetSnippet("AddressLabel");

	// Format the shipping provider's details
	$shippingCostColumn = 'cost_ex_tax';
	$itemPriceColumn = 'price_ex_tax';
	$itemTotalColumn = 'total_ex_tax';
	$subTotalColumn = 'subtotal_ex_tax';

	if(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {
		$shippingCostColumn = 'cost_inc_tax';
		$itemPriceColumn = 'price_inc_tax';
		$itemTotalColumn = 'total_inc_tax';
		$subTotalColumn = 'subtotal_inc_tax';
	}

	$GLOBALS['TotalCost'] = FormatPrice($order_row['total_inc_tax'], false, true, false, $defaultCurrency, true);

	$email = $order_row['ordbillemail'];
	if(!$order_row['ordbillemail']) {
		// Get the customer's email address
		$query = sprintf("select custconemail from [|PREFIX|]customers where customerid='%d'", $GLOBALS['ISC_CLASS_DB']->Quote($order_row['ordcustid']));
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$email = $row['custconemail'];
		}
	}

	if(!$email) {
		return false;
	}

	$prodHasSKU = false;
	$WrapCost = 0;
	$fieldArray = GetOrderProductFieldsData($orderId);

	// We need to loop throuh all the prodcts to see if any of them have an SKU
	foreach($order_row['products'] as $product_row) {
		if (trim($product_row['ordprodsku']) !== '') {
			$prodHasSKU = true;
		}
	}

	// OK, now set the proper columns for the product list
	if ($prodHasSKU) {
		$GLOBALS['CartItemColumns'] = $emailTemplate->GetSnippet("InvoiceProductColumns");
	} else {
		$GLOBALS['CartItemColumns'] = $emailTemplate->GetSnippet("InvoiceProductColumnsNoSKU");
	}

	$GLOBALS['SNIPPETS']['CartItems'] = '';
	$previousAddressId = null;
	foreach($order_row['products'] as $product_row) {
		if ($order_row['shipping_address_count'] > 1 && $product_row['order_address_id'] != $previousAddressId) {
			if ($product_row['order_address_id']) {
				$addressLine = array_filter(array(
					$product_row['address_1'],
					$product_row['address_2'],
					$product_row['city'],
					$product_row['state'],
					$product_row['zip'],
					$product_row['country'],
				));
				$addressLine = GetLang('ItemsShippedTo') . ' ' . Store_String::rightTruncate(implode(', ', $addressLine), 70);
			} else {
				$addressLine = GetLang('ItemsShippedToDigital');
			}

			$GLOBALS['AddressLine'] = $addressLine;
			$GLOBALS['SNIPPETS']['CartItems'] .= $emailTemplate->GetSnippet("InvoiceProductShipRow");
			$previousAddressId = $product_row['order_address_id'];
		}

		$pOptions = '';
		if($product_row['ordprodoptions'] != '') {
			$options = @unserialize($product_row['ordprodoptions']);
			if(!empty($options)) {
				$pOptions = "<br /><small>(";
				$comma = '';
				foreach($options as $name => $value) {
					$pOptions .= $comma.isc_html_escape($name).": ".isc_html_escape($value);
					$comma = ', ';
				}
				$pOptions .= ")</small>";
			}
		}
		$GLOBALS['ProductOptions'] = $pOptions;
		$GLOBALS['EventDate'] = '';
		if ($product_row['ordprodeventdate']) {
			$GLOBALS['EventDate'] = '<br /><span style="padding-left : 10px; padding-bottom:10px; font-size:11px; font-style:italic">('.$product_row['ordprodeventname'] . ': ' . isc_date('dS M Y', $product_row['ordprodeventdate']) . ')</span>';
		}
		$GLOBALS['ProductPrice'] = FormatPrice($product_row[$itemPriceColumn], false, true, false, $defaultCurrency, true);
		$GLOBALS['ProductTotal'] = FormatPrice($product_row[$itemTotalColumn], false, true, false, $defaultCurrency, true);
		$GLOBALS['ProductQuantity'] = $product_row['ordprodqty'];

		$GLOBALS['ProductName'] = isc_html_escape($product_row['ordprodname']);

		$GLOBALS['ProductSku'] = ' ';
		if ($prodHasSKU && trim($product_row['ordprodsku']) !== '') {
			$GLOBALS['ProductSku'] = isc_html_escape($product_row['ordprodsku']);
		}

		// If this is a digital download and the order is complete, append a download link to the name of the product
		if($product_row['ordprodtype'] == 'digital' && OrderIsComplete($order_status)) {
			$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');
			$downloadEncrypted = $GLOBALS['ISC_CLASS_ACCOUNT']->EncryptDownloadKey($product_row['orderprodid'], $product_row['ordprodid'], $orderId, $order_row['ordtoken']);
			$downloadLink = $GLOBALS['ShopPathSSL'].'/account.php?action=download_item&amp;data=' . $downloadEncrypted;
			$GLOBALS['ProductName'] .= ' (<a href="'.$downloadLink.'">'.GetLang('DownloadLink').'</a>)';
		}

		$GLOBALS['CartProductFields'] = '';
		if(isset($fieldArray[$product_row['orderprodid']])) {
			$GLOBALS['CartProductFields'] = LoadEmailOrderProductFields($fieldArray[$product_row['orderprodid']]);
		}

		if(isset($product_row['ordprodwrapcost'])) {
			$WrapCost += $product_row['ordprodwrapcost'];
		}

		$GLOBALS['ExpectedReleaseDate'] = '';

		if ($product_row['prodpreorder']) {
			if ($product_row['prodreleasedate']) {
				$message = $product_row['prodpreordermessage'];
				if (!$message) {
					$message = GetConfig('DefaultPreOrderMessage');
				}
				$GLOBALS['ExpectedReleaseDate'] = '(' . str_replace('%%DATE%%', isc_date(GetConfig('DisplayDateFormat'), $product_row['prodreleasedate']), $message) . ')';
			} else {
				$GLOBALS['ExpectedReleaseDate'] = '(' . GetLang('PreOrderProduct') . ')';
			}
		}

		if ($prodHasSKU) {
			$GLOBALS['SNIPPETS']['CartItems'] .= $emailTemplate->GetSnippet("InvoiceCartItem");
		} else {
			$GLOBALS['SNIPPETS']['CartItems'] .= $emailTemplate->GetSnippet("InvoiceCartItemNoSKU");
		}
	}

	$totalRows = getOrderTotalRows($order_row);
	$GLOBALS['SNIPPETS']['TotalRows'] = '';
	foreach($totalRows as $row) {
		$emailTemplate->assign('label', isc_html_escape($row['label']));
		$emailTemplate->assign('value', formatPrice($row['value'], false, true, false, $defaultCurrency, true));
		$GLOBALS['SNIPPETS']['TotalRows'] .= $emailTemplate->getSnippet('InvoiceTotalRow');
	}

	// Set the shipping method
	if ($order_row['ordisdigital']) {
		$GLOBALS['ShippingMethod'] = GetLang('ImmediateDownload');
	} else {
		$GLOBALS['ShippingMethod'] = sprintf(GetLang('FreeShippingFromX'), $GLOBALS['StoreName']);
	}

	// What's the status of the order? If it's awaiting payment (7) then show the awaiting payment notice
	if ($order_status == 7) {
		// Get the awaiting payment snippet, for offline payment providers also show the "how to pay for your order" message"
		$checkout_provider = null;
		GetModuleById('checkout', $checkout_provider, $order_payment_module);
		if (is_object($checkout_provider) && $checkout_provider->getpaymenttype() == PAYMENT_PROVIDER_OFFLINE && method_exists($checkout_provider, 'GetOfflinePaymentMessage')) {
			$paymentData = array(
				'orders' => array($order_row['orderid'] => $order_row)
			);
			$checkout_provider->SetOrderData($paymentData);
			$GLOBALS['PaymentGatewayAmount'] = CurrencyConvertFormatPrice($order_row['total_inc_tax'], $order_row['ordcurrencyid'], $order_row['ordcurrencyexchangerate'], true);
			$GLOBALS['PaymentMessage'] = $checkout_provider->GetOfflinePaymentMessage();
			$GLOBALS['PendingPaymentDetails'] = $emailTemplate->GetSnippet("InvoicePendingPaymentDetails");
			$GLOBALS['PendingPaymentNotice'] = $emailTemplate->GetSnippet("InvoicePendingPaymentNotice");
		}
	}

	$GLOBALS['OrderCommentBlock'] = '';
	if($order_row['ordcustmessage'] != '') {
		$GLOBALS['OrderComments'] = isc_html_escape($order_row['ordcustmessage']);
		$GLOBALS['OrderCommentBlock'] = $emailTemplate->GetSnippet("InvoiceOrderComment");
	}

	$emailTemplate->SetTemplate("invoice_email");
	$message = $emailTemplate->ParseTemplate(true);

	// Create a new email API object to send the email
	$store_name = GetConfig('StoreName');

	$obj_email = GetEmailClass();
	$obj_email->From(GetConfig('OrderEmail'), $store_name);
	$obj_email->Set("Subject", sprintf(GetLang('YourOrderFrom'), $store_name));
	$obj_email->AddBody("html", $message);
	$obj_email->AddRecipient($email, "", "h");
	$email_result = $obj_email->Send();

	$forwardEmails = array();
	if($order_row['ordvendorid'] > 0) {
		$query = "
			SELECT vendororderemail
			FROM [|PREFIX|]vendors
			WHERE vendorid='".(int)$order_row['ordvendorid']."'
		";
		$vendorOrderEmails = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
		$forwardEmails = array_merge($forwardEmails, explode(',', $vendorOrderEmails));
	}

	// If there are any additional recipients (forward invoices to addresses), send them as well
	if(GetConfig('ForwardInvoiceEmails')) {
		$forwardEmails = array_merge($forwardEmails, explode(',', GetConfig('ForwardInvoiceEmails')));
	}

	$forwardEmails = array_unique($forwardEmails);
	foreach($forwardEmails as $address) {
		if(!trim($address)) {
			continue;
		}
		$emailClass = GetEmailClass();
		$emailClass->Set('CharSet', GetConfig('CharacterSet'));
		$emailClass->From(GetConfig('OrderEmail'), $store_name);
		$emailClass->Set("Subject", "Fwd: ".sprintf(GetLang('YourOrderFrom'), $store_name)." (#".$order_row['orderid'].")");
		$emailClass->AddBody("html", $message);
		$emailClass->AddRecipient($address, "", "h");
		$status = $emailClass->Send();
	}

	// If the email was sent ok, show a confirmation message
	if ($email_result['success']) {
		return true;
	}
	else {
		// Email error
		return false;
	}
}