Subversion Repositories wpShopGermany4

Rev

Rev 7974 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
    
    /**
     * Template für das hinzufügen eines Produktes wenn das Produkt ausgewählt wurde
     */
             
    /** @var wpsg_product $oProduct */
    $oProduct = $this->view['oProduct'];

    /** @var wpsg_order_product $oOrderProduct */
    $oOrderProduct = $this->view['oOrderProduct'];
        
?>

<style>
    
    .wpsg_product_add { position:relative; min-height:150px; }
    .wpsg_product_add .image { position:absolute; left:0px; top:10px; }
    
</style>

<strong><?php echo $oProduct->getProductName(); ?></strong>

<div class="wpsg_product_add">

    <input type="hidden" name="product_id" value="<?php echo $oProduct->id; ?>" />
    
    <?php if ($oOrderProduct !== false) { ?>
    <input type="hidden" name="order_product_id" value="<?php echo $oOrderProduct->id; ?>" />
    <?php } ?>
    
    <?php

        $attachment_id = $GLOBALS['wpsg_sc']->imagehandler->getAttachmentID($oProduct->id);
        
    ?>
    
    <?php if (wpsg_isSizedInt($attachment_id)) { ?>
    <div class="image"><?php echo wp_get_attachment_image($attachment_id, [100, 100]); ?></div>
    <?php } ?>
    
    <?php echo wpsg_drawForm_Input('add_price', __('Produktpreis', 'wpsg').' '.(($this->getBackendTaxView() === WPSG_BRUTTO)?'(BRUTTO)':'(NETTO'), (($oOrderProduct !== false)?$oOrderProduct->getPrice($this->getBackendTaxView()):$oProduct->getPrice($this->getBackendTaxView()))); ?>
    <?php echo wpsg_drawForm_Input('add_amount', __('Menge', 'wpsg'), (($oOrderProduct !== false)?$oOrderProduct->getCount():'1')); ?>
    
    <?php if ($this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', [$oProduct->id])) { $arVariants = $this->callMod('wpsg_mod_productvariants', 'getVariants', [$oProduct->id, true, true, true]); ?> 
        
        <?php if (wpsg_isSizedArray($arVariants)) { ?>
                
            <br />
            
            <?php foreach ($arVariants as $var_id => $var_data) { 
                
                    $arVariSelect = [];
                    foreach ($var_data['arVariation'] as $vari_id => $vari_data) $arVariSelect[$vari_id] = $vari_data['name'];
                
                ?>
            
                <?php echo wpsg_drawForm_Select('wpsg_vp['.$var_id.']', $var_data['name'], $arVariSelect,''); ?>
                
            <?php } ?>
        
        <?php } ?>
        
    <?php } ?> 
    
    <script>

        jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', false);
        
    </script>

</div>