File: /var/www/vhosts/creativefellows.nl/okaycolor.creativefellows.nl/views/product.php
<?php
/*
* Header
*/
require_once __DIR__ . '/inc/header.inc.php';
echo '<div class="grid-container product-information" id="order-product">';
echo '<div class="grid-x grid-padding-x">';
/*
* Left Column
*/
echo '<div class="cell small-12 medium-8">';
/*
* Product Text & Image
*/
require_once __DIR__ . '/inc/product_details.php';
/*
* Ordering
*/
echo '<div class="select-product-properties" data-product="'. $product->getUrl() .'" data-name="'. $product->getName() .'">';
echo '<div class="grid-x grid-padding-x">';
/*
* Line
*/
echo '<div class="cell small-12"><hr></div>';
/*
* Left
*/
echo '<div class="cell small-12">';
echo '<h2>'. $product->getOrderLead() .'</h2>';
/*
* Product property steps
*/
foreach($product->getProductGroups() as $group)
{
echo '<div class="product-property-select">';
echo '<h4>'. $group->getName() .'</h4>';
echo '<div class="grid-x grid-padding-x">';
// left options
echo '<div class="cell small-11">';
echo '<div
data-equalizer
class="grid-x grid-padding-x align-top options-row"
id="'. $group->getIdName() .'"
data-id="'. $group->getId() .'"
data-group-name="'. $group->getPostName() .'"
data-update-target="'. $group->getUpdateTarget() .'"
data-insert-custom="'. $group->insertCustomElement() .'"
'. $group->customSizeAttributes() .'>';
$sub_options_array = [];
$options_hidden = [];
foreach($group->getOptions() as $i => $option)
{
// columnname
$columnname = $option->getPostName();
// sub items
$sub_option_row = [];
if( $option->isSelectable() )
{
// show property option
$item = $option->getHtml($group, null, $columnname);
if($i >= 4) $options_hidden[] = $item;
else echo $item;
// suboption for material weights
if( $option->hasOptions() ){
foreach($option->getOptions() as $sub_option)
{
// only show sub options which can be selected
if( $sub_option->isSelectable() ) $sub_option_row[] = $sub_option->getHtml( $group, "gewicht",$columnname,$i);
}
$sub_options_array[] = $sub_option_row;
}
}
}
// hidden other options
echo '<div class="cell small-12 hide property-options-hidden">';
echo '<div class="grid-x grid-padding-x">';
echo implode("",$options_hidden);
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
// right toggle
echo '<div class="cell small-1 text-right">';
if($group->optionCount() > 4)
{
echo '<a class="toggle-element" data-target="other-options-'. $group->getIdName() .'"><i class="fal fa-angle-right fa-2x"></i></a>';
}
echo '</div>';
echo '</div>';
// material weight sub-options
if(!empty($sub_options_array))
{
echo '<div class="grid-x grid-padding-x options-row" id="weight" data-update-target="'. $group->getUpdateTarget() .'" data-insert-custom="'. $group->insertCustomElement() .'">';
echo '<div class="cell small-12"><h4>Gewicht</h4></div>';
echo '<div class="cell small-11">';
echo '<div class="grid-x grid-padding-x">';
foreach($sub_options_array as $i => $row)
{
foreach($row as $x => $weight){
//if($x < 4)
echo $weight;
}
}
echo '</div>';
echo '</div>';
// right toggle
//echo '<div class="cell small-1 text-right">';
// if($i > 4)
// {
// echo '<a class="toggle-element" data-target="other-options-'. $group->getIdName() .'"><i class="fal fa-angle-right fa-2x"></i></a>';
// }
//echo '</div>';
echo '</div>';
}
echo '</div>';
}
// product options
echo '<input type="hidden" name="product_options" id="product_options" value="'. $product->productionOptions() .'">';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
/*
* Preview sidebar
*/
echo '<div class="cell small-12 medium-4 product-sidebar">';
require_once __DIR__ . '/inc/sidebar.product.php';
echo '</div>';
echo '</div>';
echo '</div>';
/*
* Product Outro Text
*/
echo '<div class="grid-container">';
echo '<div class="grid-x grid-padding-x">';
echo '<div class="cell small-12">';
echo '<br /><h4 class="h2">Productinformatie</h4>';
echo $product->getTextFull();
echo '</div>';
echo '</div>';
echo '</div>';
/*
* Footer
*/
require_once __DIR__ . '/inc/footer.inc.php';
//require_once __DIR__ . '/inc/debug.inc.php';
//d( $product);//->getPropertyGroups() );
?>