Jump to content
thirty bees forum

How to make a checkbox ticked by default?


cprats

Recommended Posts

I have an auction module for tb, but there is an optional function I want to make as default: bidders can submit a regular bid, and the price is set to their maximum offer, or they can submit an automatic bid, and their maximum offer is kept secret and other bidders bid against that. To send the bid as automatic, they must select a checkbox. I would like to make this box ticked by default, so first option will be to send automatic bids instead of regular.

 

Below there is the code of a file called AdminAuctionDetailController.php, which is the one that controls this option. Could anyone please tell me what should I touch to make this change?

Thank-you.

 

 

class AdminAuctionDetailController extends ModuleAdminController
{
    public function __construct()
    {
        $idLang = Configuration::get('PS_LANG_DEFAULT');
        $idProduct = Tools::getValue('id_product');
        $this->bootstrap = true;
        $this->context = Context::getContext();
        
        $this->table = 'auction_details';
        $this->className = 'AuctionDetail';
        $this->identifier  = 'id_auction';

        $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = a.`id_product`)';
        $this->_select = 'CONCAT(pl.`name`," (", pl.`id_product`, ")" ) as `product_name`';
        $this->_where = 'AND pl.`id_lang` = '.(int)$idLang.' AND a.`deleted` = 0';
        // $this->_where .= ' AND (a.`auction_status` = 2 OR a.`auction_status` = 3)';
        if (isset($idProduct) && $idProduct) {
            $this->_where .= ' AND a.`id_product` = '.(int)$idProduct;
        }
        $this->addRowAction('view');
        $this->addRowAction('delete');
        $this->bulk_actions = array(
            'delete' => array(
                'text' => $this->l('Delete selected'),
                'confirm' => $this->l('Delete selected items?'),
                'icon' => 'icon-trash'
            )
        );

        $optionsBuyItNowStatus = array(0 => 'No', 1 => 'Yes');
        $optionsAuctionStatus = array(1 => 'Running', 2 => 'Completed', 3 => 'Stopped');
        $this->fields_list = array(
           'id_auction' => array(
                'title' => $this->l('ID'),
                'align' => 'center',
                'class' => 'fixed-width-xs'
            ),
            'product_name' => array(
                'title' => $this->l('Product Name (ID)'),
                'align' => 'center',
                'havingFilter' => true
            ),
            'starting_price' => array(
                'title' => $this->l('Starting Price'),
                'align' => 'center',
                'type' => 'price'
            ),
            'bid_price' => array(
                'title' => $this->l('Current Bid'),
                'align' => 'center',
                'type' => 'price',
                'search' => false,
            ),
            'automatic_bid_price' => array(
                'title' => $this->l('Automatic Bid'),
                'align' => 'center',
                'search' => false,
                'type' => 'price'
            ),
            'start_bid_time' => array(
                'title' => $this->l('Start Time'),
                'align' => 'center',
                'type' => 'datetime',
            ),
            'end_bid_time' => array(
                'title' => $this->l('End Time'),
                'align' => 'center',
                'type' => 'datetime',
            ),
            'increment_status' => array(
                'title' => $this->l('Increment Status'),
                'align' => 'center',
                'type' => 'select',
                'list' => $optionsBuyItNowStatus,
                'callback' => 'callIncrementStatus',
                'filter_key' => 'a!increment_status',
            ),
            'automatic_bid_status' => array(
                'title' => $this->l('Automatic Bid Status'),
                'align' => 'center',
                'type' => 'select',
                'list' => $optionsBuyItNowStatus,
                'callback' => 'callAutomaticBidStatus',
                'filter_key' => 'a!automatic_bid_status',
            ),
            'buyitnow_status' => array(
                'title' => $this->l('Buy Now Status'),
                'align' => 'center',
                'type' => 'select',
                'list' => $optionsBuyItNowStatus,
                'callback' => 'callBuyitnowStatus',
                'filter_key' => 'a!buyitnow_status',
            ),
            'auction_status' => array(
                'title' => $this->l('Status'),
                'align' => 'center',
                'type' => 'select',
                'list' => $optionsAuctionStatus,
                'callback' => 'callAuctionStatus',
                'filter_key' => 'a!auction_status',
            ),
        );
        
        parent::__construct();
    }

    public function initToolbar()
    {
        parent::initToolbar();
        unset($this->toolbar_btn['new']);
        $idProduct = Tools::getValue('id_product');
        if (!empty($idProduct)) {
            $this->page_header_toolbar_btn['back_to_product'] = array(
                'href' => $this->context->link->getAdminLink(
                    'AdminProducts'
                ).'&key_tab=ModuleWkproductauction&updateproduct&id_product='.(int)$idProduct,
                'desc' => $this->l('Back To Product Page'),
                'imgclass' => 'back',
            );
        }
    }

    public function callIncrementStatus($value)
    {
        return ($value == 1 ? $this->l('YES') : $this->l('NO'));
    }

    public function callAutomaticBidStatus($value)
    {
        return ($value == 1 ? $this->l('YES') : $this->l('NO'));
    }

    public function callBuyitnowStatus($value)
    {
        return ($value == 1 ? $this->l('YES') : $this->l('NO'));
    }

    public function callAuctionStatus($value)
    {
        if ($value == 1) {
            return $this->l('Running');
        } elseif ($value == 2) {
            return $this->l('Completed');
        } elseif ($value == 3) {
            return $this->l('Stopped');
        }
    }

    public function getList($idLang, $orderBy = null, $orderWay = null, $start = 0, $limit = null, $idLangShop = false)
    {
        parent::getList($idLang, $orderBy, $orderWay, $start, $limit, $idLangShop);

        if (!($obj = $this->loadObject(true))) {
            return;
        }
        if (!$obj->id) {
            $nbItems = count($this->_list);
            for ($i = 0; $i < $nbItems; ++$i) {
                $item = &$this->_list[$i];
                $idAuction = $item['id_auction'];
                $automaticBidStatus = $item['automatic_bid_status'];
                if ($automaticBidStatus) {
                    for ($autoVal=0; $autoVal<=1; $autoVal++) {
                        $query = $this->generateQueryData($idAuction, $autoVal);
                        $listQuery = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
                        if ($autoVal == 0) {
                            if ($listQuery['bid_price']) {
                                $item['bid_price'] = $listQuery['bid_price'];
                            } else {
                                $item['bid_price'] = null;
                            }
                        } elseif ($autoVal == 1) {
                            if ($listQuery['automatic_bid_price']) {
                                $item['automatic_bid_price'] = $listQuery['automatic_bid_price'];
                            } else {
                                $item['automatic_bid_price'] = null;
                            }
                        }
                    }
                } else {
                    $autoVal = 0;
                    $query = $this->generateQueryData($idAuction, $autoVal);
                    $listQuery = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
                    $item['bid_price'] = $listQuery['bid_price'];
                    $item['automatic_bid_price'] = null;
                }
                
                unset($query);
            }
        }
    }

    public function generateQueryData($idAuction, $autoVal)
    {
        $query = new DbQuery();
        $query->select('bd.`bid_price` as `bid_price`, bd.`automatic_bid_price` as `automatic_bid_price`');
        $query->from('auction_details', 'a');
        $query->join('LEFT JOIN `'._DB_PREFIX_.'auction_bid_details` bd ON (bd.`id_auction` = a.`id_auction`)');
        $query->where(
            'a.id_auction ='.(int)$idAuction.' AND bd.`automatic_status` = '.(int)$autoVal.
            ' AND bd.`bid_status` = 1'
        );
        return $query;
    }


    public function renderList()
    {
        return parent::renderList();
    }

    public function renderView()
    {
        $this->context->smarty->assign(
            array(
                'currency_unit' => $this->context->currency->sign,
                'incrementconfig_row' => AuctionIncrementConfig::totalIncrementRow(), // Set Increment row value
                'decimal_point' => Configuration::get('PS_PRICE_DISPLAY_PRECISION'),
                'wk_winner_mail_enable' => Configuration::get('WK_AUCTION_WINNER_MAIL_ENABLE')
            )
        );
        $objAuctionDetail = new AuctionDetail(Tools::getValue('id_auction'));
        $idAuction = Tools::getValue('id_auction');

        $this->context->smarty->assign((array)$objAuctionDetail);
        $this->context->smarty->assign(
            array(
                'starting_price' => Tools::displayPrice($objAuctionDetail->starting_price),
                'buyitnow_price' => Tools::displayPrice($objAuctionDetail->buyitnow_price),
                'winner_bid_price' => Tools::displayPrice($objAuctionDetail->winner_bid_price),
            )
        );
        $objAuctionProduct = new AuctionDetail();
        $productName = $objAuctionProduct->getProductname($objAuctionDetail->id_product);
        
        $objAuctionIncrement = new AuctionIncrementDetails();
        $auctionIncrementDetail = $objAuctionIncrement->getAuctionIncrementDetails($idAuction);
        if ($auctionIncrementDetail) {
            $this->context->smarty->assign('auction_increment_arr', $auctionIncrementDetail);
        }
        
        $objAuctionBidDetails = new AuctionBidDetails();
        $auctionAllBid = $objAuctionBidDetails->getAuctionAllBid($idAuction);
        if ($auctionAllBid) {
            foreach ($auctionAllBid as $key => $auctionBid) {
                $auctionAllBid[$key]['bid_price'] = Tools::displayPrice($auctionBid['bid_price']);
                $auctionAllBid[$key]['automatic_bid_price'] = Tools::displayPrice(
                    $auctionBid['automatic_bid_price']
                );
            }
        }
        $this->context->smarty->assign(
            array(
                'auctionallbid' => $auctionAllBid,
                'productname' => $productName
            )
        );
        $winnerCustomerId = $objAuctionDetail->winner_customerid;
        $winnerCustomerDetails = $objAuctionBidDetails->getCustomerById($winnerCustomerId);
        if ($winnerCustomerDetails) {
            $this->context->smarty->assign('winner_customer_arr', $winnerCustomerDetails);
        } else {
            $this->context->smarty->assign('winner_customer_arr', 0);
        }

        //Display product orders purchase through Buy it now
        $objAucOrder = new AuctionProductOrders();
        $auctionOrdersDetails = $objAucOrder->getBuyNowOrdersByAuctionId($idAuction);
        if ($auctionOrdersDetails) {
            $this->context->smarty->assign('auction_orders_details', $auctionOrdersDetails);
        }
        return parent::renderView();
    }

    public function ajaxProcessSendMailToWinnerCustomer()
    {
        if (Tools::getValue('mail_sending_button')) {
            if (Configuration::get('WK_AUCTION_WINNER_MAIL_ENABLE')) {
                $idAuction = Tools::getValue('id_auction');
                
                $link = new Link();
                $objAuction = new AuctionDetail();
                $auctionDetails = $objAuction->getAuctionDetails($idAuction);
                $idProduct = $auctionDetails['id_product'];
                $productName = $objAuction->getProductname($idProduct);
    
                $objProduct = new Product($idProduct, false, $this->context->language->id);
                $productLink = $link->getProductLink($objProduct);
    
                $winnerCustomerId = $auctionDetails['winner_customerid'];
                
                $objCustomerInfo = new AuctionBidDetails();
                $customerInfo = $objCustomerInfo->getCustomerById($winnerCustomerId);
                $customerFname = $customerInfo['firstname'];
                $customerLname = $customerInfo['lastname'];
                $customerEmail = $customerInfo['email'];
    
                // $objGenConfg = new AuctionGeneralConfig();
                // $generalConfigDetails = $objGenConfg->getGeneralConfigValue();
                $winningMsg = '';
                $winningMsg= Configuration::get('WK_AUCTION_WINNING_MESSAGE', $this->context->language->id);
                if ($customerEmail && Configuration::get('WK_AUCTION_WINNER_MAIL_ENABLE')) {
                    $paramsCustomer = array(
                    '{cust_firstname}'=>$customerFname,
                    '{cust_lastname}'=>$customerLname,
                    '{email}'=>$customerEmail,
                    '{product_name}'=>$productName,
                    '{product_link}'=>$productLink,
                    '{id_auction}'=>$idAuction,
                    '{winning_msg}'=>$winningMsg
                    );
    
                    $this->mailVoucherToCustomer($paramsCustomer);
    
                    $objAuctionDetailMail = new AuctionDetail($idAuction);
                    $objAuctionDetailMail->mail_sent = 1;
                    $objAuctionDetailMail->update();
                }
            }
            die('1');
        }
    }


    public function ajaxProcessCancelOrder()
    {
        //Cancel order for winner
        if (Tools::getValue('cancel_order_button')) {
            $idAuction = Tools::getValue('id_auction');
            
            $objAuction = new AuctionDetail();
            $auctionDetails = $objAuction->getAuctionDetails($idAuction);
            $idProduct = $auctionDetails['id_product'];

            $customerId = $auctionDetails['winner_customerid'];
            $objProduct = new Product($idProduct, false, $this->context->language->id);
            $productLink = $this->context->link->getProductLink($objProduct);
            $productName = $objAuction->getProductname($idProduct);
            $objCustomerInfo = new AuctionBidDetails();
            $customerInfo = $objCustomerInfo->getCustomerById($customerId);
            $customerFname = $customerInfo['firstname'];
            $customerLname = $customerInfo['lastname'];
            $customerEmail = $customerInfo['email'];

            if ($customerEmail) {
                $paramsCustomer = array(
                '{cust_firstname}'=>$customerFname,
                '{cust_lastname}'=>$customerLname,
                '{email}'=>$customerEmail,
                '{product_name}'=>$productName,
                '{product_link}'=>$productLink,
                '{id_auction}'=>$idAuction,
                );

                $this->cancelOrderMailToCustomer($paramsCustomer);
            }
            $objAuction->updateWinnerTimeLeft($idAuction); // Update winner time left
            $objAuction->deleteSpecificPrice($customerId, $idProduct);  //Delete Specific price
    
            $objProduct = new Product($idProduct);
            if (Configuration::get('Wk_AUCTION_CONTINUE_SELL')) {
                $objProduct->available_for_order = 1;
                $objProduct->show_price = 1;
            } else {
                $objProduct->available_for_order = 0;
                $objProduct->show_price = 0;
            }
            $objProduct->save();
            die('1');
        }
    }


     /**
     * [mailVoucherToCustomer -> Send Mail to Winner]
     * @param  [type] $params [description]
     * @return [type]         [description]
     */
    public function cancelOrderMailToCustomer($params)
    {
        Mail::Send(
            (int)$this->context->language->id,
            'cancelordermail', //Specify the template file name
            Mail::l('Cancel Order Notification'),
            $params,
            $params['{email}'],
            null,
            null,
            null,
            null,
            null,
            _PS_MODULE_DIR_.'wkproductauction/mails/',
            false,
            null,
            null
        );
    }

     /**
     * [mailVoucherToCustomer -> Send Mail to Winner]
     * @param  [type] $params [description]
     * @return [type]         [description]
     */
    public function mailVoucherToCustomer($params)
    {
        Mail::Send(
            (int)$this->context->language->id,
            'winnerconfirmationmail', //Specify the template file name
            Mail::l('Bid Win Notification'),
            $params,
            $params['{email}'],
            null,
            null,
            null,
            null,
            null,
            _PS_MODULE_DIR_.'wkproductauction/mails/',
            false,
            null,
            null
        );
    }

    public function setMedia()
    {
        parent::setMedia();
        
        $this->addCSS(_MODULE_DIR_.'wkproductauction/views/css/create_auction.css');
        $this->addJS(_MODULE_DIR_.'wkproductauction/views/js/create_auction.js');
    }
}

 

Link to comment
Share on other sites

6 minutes ago, wakabayashi said:

The checkbox is probably inside a tpl file from the module. So we need to see this code...

I think it's here:

<div class="row">
	<div class="col-lg-6">
		<div class="panel row">
			<div class="panel-heading">
				{l s='Auction Detail' mod='wkproductauction'}
			</div>

			<div name="auction_creation_form" id="auction_creation_form">
				<div class="form-wrapper">
					<div class="row" style="position: relative;">
						<label class="control-label col-lg-4 text-right">
							{l s='Auction ID' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>
						<label class="col-lg-7 control-label">
							{if isset($id_auction)}
								{$id_auction|escape:'htmlall':'UTF-8'}
							{/if}
						</label>
					</div>
					<div class="row" style="position: relative;">
						<label class="control-label col-lg-4 text-right">
							{l s='Product Name' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>
						<label class="col-lg-7 control-label">
							{if isset($productname)}
								{$productname|escape:'htmlall':'UTF-8'} ({$id_product|escape:'htmlall':'UTF-8'})
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Starting Price' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>
						<label class="col-lg-7 control-label ">
							{if isset($starting_price)}
								{$starting_price|escape:'htmlall':'UTF-8'}
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Start Bid Time' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>				
						<label class="col-lg-7 control-label">
							{if isset($start_bid_time)}
								{$start_bid_time|escape:'htmlall':'UTF-8'}
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='End Bid Time' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>		
						<label class="col-lg-7 control-label ">
							{if isset($end_bid_time)}
								{$end_bid_time|escape:'htmlall':'UTF-8'}
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Enable Increment Option' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>					
						<label class="col-lg-7 control-label ">
							{if isset($increment_status)}
								{if $increment_status == 1}
									{l s='YES' mod='wkproductauction'}
								{else}
									{l s='No' mod='wkproductauction'}								
								{/if}
							{/if}
						</label>
					</div>
					{if isset($increment_status) && $increment_status}
						<div class="row" id="increment_data">
							<div class="row">
								<label class="col-lg-3 col-lg-offset-1 control-label  text-center">
									{l s='Start Bid Price' mod='wkproductauction'}
								</label>
								<label class="col-lg-3 text-center control-label">
									{l s='End Bid Price' mod='wkproductauction'}									
								</label>
								<label class="col-lg-3 text-center control-label">
									{l s='Increment Price' mod='wkproductauction'}						
								</label>
							</div>
							{foreach $auction_increment_arr as $key => $increment_row}
                                <div class="row">
                                    <div class="col-lg-3 col-lg-offset-1 text-center">
                                        <label class="control-label">
                                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($increment_row['start_price']|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                                        </label>
                                    </div>
                                    <div class="col-lg-3 text-center">
                                        <label class="control-label">
                                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($increment_row['end_price']|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                                        </label>
                                    </div>
                                    <div class="col-lg-3 text-center">
                                        <label class="control-label">
                                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($increment_row['increment']|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                                        </label>
                                    </div>
                                </div>								
                            {/foreach}
						</div>
					{/if}
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Enable Automatic Bid' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>					
						<label class="col-lg-7 control-label ">
							{if isset($automatic_bid_status)}
								{if $automatic_bid_status == 1}
									{l s='YES' mod='wkproductauction'}
								{else}
									{l s='No' mod='wkproductauction'}								
								{/if}
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Enable Buy It Now' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>					
						<label class="col-lg-7 control-label ">
							{if isset($buyitnow_status)}
								{if $buyitnow_status == 1}
									{l s='YES' mod='wkproductauction'}
								{else}
									{l s='No' mod='wkproductauction'}								
								{/if}
							{/if}
						</label>
					</div>
					<div id="buyitnow_data" class="row" {if isset($buyitnow_status) && $buyitnow_status == 0}style="display:none;{/if}">
						<label class="control-label col-lg-4 text-right">
							{l s='Buy It Now Price' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>					
						<label class="col-lg-7 control-label ">
							{if isset($buyitnow_price)}
								{$buyitnow_price|escape:'htmlall':'UTF-8'}
							{/if}
						</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-4 text-right">
							{l s='Auction Status' mod='wkproductauction'}
						</label>
						<label class="col-lg-1 text-center">-</label>					
						<label class="col-lg-7 control-label ">
							{if isset($auction_status)}
								{if $auction_status == 1}
									{l s='Running' mod='wkproductauction'}
								{else if $auction_status == 2}
									{l s='Completed' mod='wkproductauction'}
								{else}
									{l s='Stopped' mod='wkproductauction'}
								{/if}
							{/if}
						</label>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="winner_details" class="col-lg-6">
		{if $auction_status == 2}
			<div class="panel">
				<div class="panel-heading">
					{l s='WINNER DETAILS' mod='wkproductauction'}
				</div>
				{if $winner_customer_arr != 0}
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Winner Name' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">{$winner_customer_arr['firstname']|escape:'htmlall':'UTF-8'} {$winner_customer_arr['lastname']|escape:'htmlall':'UTF-8'}</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Email Id' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">{$winner_customer_arr['email']|escape:'htmlall':'UTF-8'}</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Winning Price' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">{$winner_bid_price|escape:'htmlall':'UTF-8'}</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Won By Automatic Bid' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">{if $win_byautomatic}{l s='YES' mod='wkproductauction'}{else}{l s='NO' mod='wkproductauction'}{/if}</label>
					</div>
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Purchase Status' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">{if $purchase_status == '1'}{l s='YES' mod='wkproductauction'}{else}{l s='NO' mod='wkproductauction'}{/if}</label>
					</div>
					{if $winner_timeleft && $wk_winner_mail_enable}
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Mail Sent' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">
							{if $mail_sent}
								<span class="mybutton label label-success"><i class="icon-check"></i> {l s='Mail already sent' mod='wkproductauction'}</span>
								<div name="mail_sending" id="mail_sending">
									<button type="submit" name="mail_sending_button" class="mybutton label label-danger">
										<i class="icon-remove"></i> <span>{l s='Resend Mail' mod='wkproductauction'}</span>
									</button>
								</div>
							{else}
								<div name="mail_sending" id="mail_sending">
									<button type="submit" name="mail_sending_button" class="mybutton label label-danger">
										<i class="icon-remove"></i> <span>{l s='Send Mail' mod='wkproductauction'}</span>
									</button>
								</div>						
							{/if}
						</label>
					</div>
					{/if}
					{if $purchase_status != '1'}
					<div class="row">
						<label class="control-label col-lg-5 text-right">{l s='Cancel Order for Winner' mod='wkproductauction'}</label>
						<label class="control-label col-lg-1 text-center">-</label>
						<label class="control-label col-lg-6">
							{if $winner_timeleft}
								<div name="mail_sending" id="mail_sending">
									<button type="submit" name="cancel_order_button" class="mybutton label label-danger">
										<i class="icon-remove"></i> {l s='Cancel Order' mod='wkproductauction'}
									</button>
								</div>						
							{else}
								<span class="mybutton label label-success"><i class="icon-check"></i> {l s='Order has been cancelled for winner' mod='wkproductauction'}</span>
							{/if}
						</label>
					</div>
					{/if}
				{else}
					<div class="row">
						<label class="control-label col-lg-12 text-center">{l s='There is No Winner.' mod='wkproductauction'}</label>
					</div>
				{/if}
			</div>
		{/if}

		{if isset($buyitnow_status) && $buyitnow_status == 1}
			<div class="panel">
				<div class="panel-heading">
					{l s='Purchase Through Buy It Now' mod='wkproductauction'}
				</div>
				<div class="table-responsive-row clearfix">
					<table class="table auction_bid_details">
						<tr>
							<th class="center">{l s='Order Id' mod='wkproductauction'}</th>
							<th class="center">{l s='Customer Name' mod='wkproductauction'}</th>
							<th class="center">{l s='Quantity' mod='wkproductauction'}</th>
						</tr>
						<tbody>
						{if isset($auction_orders_details)}
							{foreach $auction_orders_details as $auction_orders}						
							<tr>
							<td class="center">{$auction_orders.id_order|escape:'htmlall':'UTF-8'}</td>
							<td class="center">{$auction_orders.firstname|escape:'htmlall':'UTF-8'} {$auction_orders.lastname|escape:'htmlall':'UTF-8'}</td>
							<td class="center">{$auction_orders.quantity|escape:'htmlall':'UTF-8'}</td>
							</tr>
							{/foreach}
						{else}
							<tr>
							<td colspan="3"><p class="text-muted text-center">{l s='No Order' mod='wkproductauction'}</p></td>
							</tr>						
						{/if}
						</tbody>
					</table>
				</div>
			</div>
		{/if}
	</div>
</div>

{if isset($id_auction) && isset($auctionallbid) && $auctionallbid}
	<div class="panel row">
		<div class="panel-heading">
			{l s='BID DETAILS' mod='wkproductauction'}
		</div>
		{if ($auctionallbid)}
			<div class="table-responsive-row clearfix">
				<table class="table auction_bid_details">
					<thead>
					<tr class="nodrag nodrop">
						<th class=" center"><span class="title_box">{l s='Customer ID' mod='wkproductauction'}</span></th>
						<th class=" center"><span class="title_box">{l s='Normal Bid' mod='wkproductauction'}</span></th>
						<th class=" center"><span class="title_box">{l s='Automatic Bid' mod='wkproductauction'}</span></th>
						<th class=" center"><span class="title_box">{l s='Automatic Bid Status' mod='wkproductauction'}</span></th>
						<th class=" center"><span class="title_box">{l s='Bid Status' mod='wkproductauction'}</span></th>
					</tr>
					</thead>
					<tbody>
					{foreach $auctionallbid as $auctionbid}
					<tr class=" odd">							
						<td class="pointer center">{$auctionbid['id_customer']|escape:'htmlall':'UTF-8'}</td>
						<td class="pointer center">
							{if $auctionbid['bid_price'] != '₹ 0'}
								{$auctionbid['bid_price']|escape:'htmlall':'UTF-8'}
							{else}
								-
							{/if}
						</td>
						<td class="pointer center">
							{if $auctionbid['automatic_bid_price'] != '₹ 0'}
								{$auctionbid['automatic_bid_price']|escape:'htmlall':'UTF-8'}
							{else}
								-
							{/if}
						</td>

						{if $auction_status == 1}
							{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
								<td class="pointer center">-</td>
								<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
								<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
								<td class="pointer center">-</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
								<td class="pointer center">-</td>
							{else}
								<td class="pointer center">-</td>
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							{/if}
						{else if $auction_status == 2}
							{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
								<td class="pointer center">-</td>
								<td class="pointer center">
									{if $win_byautomatic == 0}
										{if $auctionbid['bid_price'] == $winner_bid_price}
											<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$winner_bid_price|escape:'htmlall':'UTF-8'}</span>
										{/if}
									{else}
										<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
									{/if}
								</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
								<td class="pointer center" style="color:green;">
									{if $auctionbid['automatic_bid_price'] >= $winner_bid_price}
										<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$winner_bid_price|escape:'htmlall':'UTF-8'}</span>
									{else}
										<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
									{/if}
								</td>
								<td class="pointer center">-</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
								<td class="pointer center">-</td>
							{else}
								<td class="pointer center">-</td>
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							{/if}
						{/if}
					</tr>
					{/foreach}
					</tbody>
				</table>
			</div>
		{/if}
	</div>
{/if}
{strip}
	{addJsDef ajaxurl_product = $link->getAdminlink('AdminAuctionDetail')}
{/strip}

 

Link to comment
Share on other sites

This is the portion of the previous code with the checkbox:

{else if $auction_status == 2}
							{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
								<td class="pointer center">-</td>
								<td class="pointer center">
									{if $win_byautomatic == 0}
										{if $auctionbid['bid_price'] == $winner_bid_price}
											<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$winner_bid_price|escape:'htmlall':'UTF-8'}</span>
										{/if}
									{else}
										<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
									{/if}
								</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
								<td class="pointer center" style="color:green;">
									{if $auctionbid['automatic_bid_price'] >= $winner_bid_price}
										<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$winner_bid_price|escape:'htmlall':'UTF-8'}</span>
									{else}
										<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
									{/if}
								</td>
								<td class="pointer center">-</td>
							{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
								<td class="pointer center">-</td>
							{else}
								<td class="pointer center">-</td>
								<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							{/if}
						{/if}

 

Link to comment
Share on other sites

There is also this other TPL file:

<div class="col-lg-6 padding-15">
    <div class="panel row">
        <div class="panel-heading">
            {l s='Auction Detail' mod='wkproductauction'}
        </div>
        <div name="auction_detail_view" id="auction_detail_view">
            <div class="form-wrapper">
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Auction ID' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>
                    <label class="col-lg-7 control-label">
                        {if isset($previousDetail.id_auction)}
                            {$previousDetail.id_auction|escape:'htmlall':'UTF-8'}
                        {else}
                            {$id_auction|escape:'htmlall':'UTF-8'}                        
                        {/if}
                    </label>
                </div>
                <div class="row" style="position: relative;">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Product Name' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>
                    <label class="col-lg-7 control-label">
                        {if isset($productname)}
                            {$productname|escape:'htmlall':'UTF-8'} ({$id_product|escape:'htmlall':'UTF-8'})
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Starting Price' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.starting_price)}
                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($previousDetail.starting_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                        {else}
                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($starting_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Start Bid Time' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>				
                    <label class="col-lg-7 control-label">
                        {if isset($previousDetail.start_bid_time)}
                            {$previousDetail.start_bid_time|escape:'htmlall':'UTF-8'}
                        {else}
                            {$start_bid_time|escape:'htmlall':'UTF-8'}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='End Bid Time' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>		
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.end_bid_time)}
                            {$previousDetail.end_bid_time|escape:'htmlall':'UTF-8'}
                        {else}
                            {$end_bid_time|escape:'htmlall':'UTF-8'}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Enable Increment Option' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>					
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.increment_status)}
                            {if $previousDetail.increment_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}
                        {else}
                            {if $increment_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Enable Automatic Bid' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>					
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.automatic_bid_status)}
                            {if $previousDetail.automatic_bid_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}
                        {else}
                            {if $automatic_bid_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Enable Buy It Now' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>					
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.buyitnow_status)}
                            {if $previousDetail.buyitnow_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}
                        {else}
                            {if $buyitnow_status == 1}
                                {l s='YES' mod='wkproductauction'}
                            {else}
                                {l s='No' mod='wkproductauction'}								
                            {/if}      
                        {/if}
                    </label>
                </div>
                <div id="buyitnow_data_view" class="row" style="display:none;">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Buy It Now Price' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>					
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.buyitnow_price)}
                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($previousDetail.buyitnow_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                        {else}
                            {$currency_unit|escape:'htmlall':'UTF-8'} {round($buyitnow_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
                        {/if}
                    </label>
                </div>
                <div class="row">
                    <label class="control-label col-lg-4 text-right">
                        {l s='Auction Status' mod='wkproductauction'}
                    </label>
                    <label class="col-lg-1 text-center control-label">-</label>					
                    <label class="col-lg-7 control-label ">
                        {if isset($previousDetail.auction_status)}
                            {if $previousDetail.auction_status == 1}
                                {l s='Running' mod='wkproductauction'}
                            {else if $previousDetail.auction_status == 2}
                                {l s='Completed' mod='wkproductauction'}
                            {else}
                                {l s='Stopped' mod='wkproductauction'}
                            {/if}
                        {else}
                             {if $auction_status == 1}
                                {l s='Running' mod='wkproductauction'}
                            {else if $auction_status == 2}
                                {l s='Completed' mod='wkproductauction'}
                            {else}
                                {l s='Stopped' mod='wkproductauction'}
                            {/if}     
                        {/if}
                    </label>
                </div>
            </div>
        </div>
    </div>
</div>

 

Link to comment
Share on other sites

Yet another one in /views/templates/hook/product_auction_form.tpl

	<div class="row">
		<div class="alert alert-info clearfix">
		{l s='Auction will not be displayed in product page as the product is no longer in stock' mod='wkproductauction'}
		</div>
	</div>
{/if}
<div class="panel row">
	<div class="panel-heading wk-panel-head">
		<span class="wk-line-height">{l s='MANAGE AUCTION' mod='wkproductauction'}</span>
		{if isset($previous_auction) && isset($auctionCount) && ($auctionCount > 1)}
			<span class="pull-right">
				<a href="{$previous_auction|escape:'htmlall':'UTF-8'|addslashes}" class="btn btn-primary">{l s='Previous Auction' mod='wkproductauction'}</a>
			</span>
		{/if}
	</div>
	<div name="auction_creation_form" id="auction_creation_form">
		<input type="hidden" id="auctionid" name="auctionid" value="{if isset($addNewAuction) && $addNewAuction == 1 && isset($id_auction)}{$id_auction|escape:'htmlall':'UTF-8'}{/if}">
		<input type="hidden" id="prev_auctionid" name="prev_auctionid" value="{if isset($id_auction)}{$id_auction|escape:'htmlall':'UTF-8'}{/if}">
		<input type="hidden" name='status_img_ps_dir' id='status_img_ps_dir' value='{$status_img_ps_dir|escape:'htmlall':'UTF-8'}'>
		<div class="form-wrapper">
			{if (isset($addNewAuction) && $addNewAuction == 1) || ($auction_status != 2 && !isset($id_auction)) }
				<div class="form-group row">
					<label class="control-label col-lg-2 required text-right">
						{l s='Enable Auction' mod='wkproductauction'}
					</label>
					<div class="col-lg-4 ">
						<span class="switch prestashop-switch fixed-width-lg">
							<input type="radio" value="1" {if isset($smarty.post.enable_auction) && $smarty.post.enable_auction == 1}checked="checked"{/if}id="enable_auction_on" name="enable_auction" class="enable_auction">
							<label for="enable_auction_on">{l s='Yes' mod='wkproductauction'}</label>

							<input type="radio" value="0" id="enable_auction_off" name="enable_auction" class="enable_auction" {if isset($smarty.post.enable_auction) && $smarty.post.enable_auction == 1}{else}checked="checked"{/if}>
							<label for="enable_auction_off">{l s='No' mod='wkproductauction'}</label>
							<a class="slide-button btn"></a>
						</span>
					</div>
				</div>
			{else}
				<input type="hidden" value="1" name="enable_auction">
			{/if}
			<div class="wk-auction-body">
				{include file='./_partials/create_auction_form_body.tpl'}
			</div>
		</div>
		<div class="panel-footer wk-panel-footer">
			<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel' mod='wkproductauction'}</a>
			{if isset($id_auction)}
				{if (isset($addNewAuction) && $addNewAuction == 1) || $auction_status != 2}
					<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save' mod='wkproductauction'}</button>
					<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i 	class="process-icon-save"></i> {l s='Save And Stay' mod='wkproductauction'}</button>
				{/if}
			{else}
				<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save' mod='wkproductauction'}</button>
				<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i class="process-icon-save"></i> {l s='Save And Stay' mod='wkproductauction'}</button>
			{/if}
		</div>
	</div>
</div>
<div id="winner_details" class="row">
	{if ($auction_status == 2 || isset($winning_status)) && isset($previous_auction)}
		{include file="$auction_detail_view"}
	{/if}
	{if $auction_status == 2 || isset($winning_status)}
		<div class="panel col-lg-6">
			<div class="panel-heading">
				{l s='WINNER DETAILS' mod='wkproductauction'}
			</div>
			{if $winner_customer_arr != 0}
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Winner Name' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">{$winner_customer_arr['firstname']|escape:'htmlall':'UTF-8'} {$winner_customer_arr['lastname']|escape:'htmlall':'UTF-8'}</label>
				</div>
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Email Id' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">{$winner_customer_arr['email']|escape:'htmlall':'UTF-8'}</label>
				</div>
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Winning Price' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">{$currency_unit|escape:'htmlall':'UTF-8'} {round($winner_bid_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}</label>
				</div>
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Won By Automatic Bid' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">{if $win_byautomatic}{l s='YES' mod='wkproductauction'}{else}{l s='NO' mod='wkproductauction'}{/if}</label>
				</div>
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Purchase Status' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">{if $purchase_status == '1'}{l s='YES' mod='wkproductauction'}{else}{l s='NO' mod='wkproductauction'}{/if}</label>
				</div>
				{if $winner_timeleft && $wk_winner_mail_enable}
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Mail Sent' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">
						{if $mail_sent}
							<span class="mybutton label label-success"><i class="icon-check"></i> <span>{l s='Mail already sent' mod='wkproductauction'}</span></span>
							<div name="mail_sending" id="mail_sending">
								<button type="submit" name="mail_sending_button" class="mybutton label label-danger">
									<i class="icon-remove"></i> <span>{l s='Resend Mail' mod='wkproductauction'}</span>
								</button>
							</div>
						{else}
							<span class="mybutton label label-success wk-auction-winner-mail hidden"><i class="icon-check"></i> <span>{l s='Mail sent' mod='wkproductauction'}</span></span>
							<div name="mail_sending" id="mail_sending">
								<button type="submit" name="mail_sending_button" class="mybutton label label-danger">
									<i class="icon-remove"></i> <span>{l s='Send Mail' mod='wkproductauction'}</span>
								</button>
							</div>						
						{/if}
					</label>
				</div>
				{/if}
				{if $purchase_status != '1'}
				<div class="row">
					<label class="control-label col-lg-5 text-right">{l s='Cancel Order for Winner' mod='wkproductauction'}</label>
					<label class="control-label col-lg-1 text-center">-</label>
					<label class="control-label col-lg-6">
						{if $winner_timeleft}
							<div name="cancel_order_mail" id="cancel_order_mail">
								<button type="submit" name="cancel_order_button" class="mybutton label label-danger">
									<i class="icon-remove"></i> {l s='Cancel Order' mod='wkproductauction'}
								</button>
							</div>						
						{else}
							<span class="mybutton label label-success wk-mail-success"><i class="icon-check"></i> {l s='Order has been cancelled for winner' mod='wkproductauction'}</span>
						{/if}
					</label>
				</div>
				{/if}
			{else}
				<div class="row">
					<label class="control-label col-lg-12 text-center">{l s='There is No Winner.' mod='wkproductauction'}</label>
				</div>
			{/if}
		</div>
	{/if}

	{if isset($buyitnow_status) && $buyitnow_status == 1}
		<div class="panel col-lg-6">
			<div class="panel-heading">
				{l s='Purchase Through Buy It Now' mod='wkproductauction'}
			</div>
			<div class="table-responsive-row clearfix">
				<table class="table auction_bid_details">
					<tr>
						<th class="center">{l s='Order Id' mod='wkproductauction'}</th>
						<th class="center">{l s='Customer Name' mod='wkproductauction'}</th>
						<th class="center">{l s='Quantity' mod='wkproductauction'}</th>
					</tr>
					<tbody>
					{if isset($auction_orders_details)}
						{foreach $auction_orders_details as $auction_orders}						
						<tr>
						<td class="center">{$auction_orders.id_order|escape:'htmlall':'UTF-8'}</td>
						<td class="center">{$auction_orders.firstname|escape:'htmlall':'UTF-8'} {$auction_orders.lastname|escape:'htmlall':'UTF-8'}</td>
						<td class="center">{$auction_orders.quantity|escape:'htmlall':'UTF-8'}</td>
						</tr>
						{/foreach}
					{else}
						<tr>
						<td colspan="3"><p class="text-muted text-center">{l s='No Order' mod='wkproductauction'}</p></td>
						</tr>						
					{/if}
					</tbody>
				</table>
			</div>
		</div>
	{/if}
</div>

{if isset($id_auction) && isset($auctionallbid) && $auctionallbid}
<div class="panel row">
	<div class="panel-heading">
		{l s='BID DETAILS' mod='wkproductauction'}
	</div>
	{if ($auctionallbid)}
		<div class="table-responsive-row clearfix">
			<table class="table auction_bid_details">
				<thead>
				<tr class="nodrag nodrop">
					<th class=" center"><span class="title_box">{l s='Customer ID' mod='wkproductauction'}</span></th>
					<th class=" center"><span class="title_box">{l s='Normal Bid' mod='wkproductauction'}</span></th>
					<th class=" center"><span class="title_box">{l s='Automatic Bid' mod='wkproductauction'}</span></th>
					<th class=" center"><span class="title_box">{l s='Automatic Bid Status' mod='wkproductauction'}</span></th>
					<th class=" center"><span class="title_box">{l s='Bid Status' mod='wkproductauction'}</span></th>
				</tr>
				</thead>
				<tbody>
				{foreach $auctionallbid as $auctionbid}
				<tr class=" odd">							
					<td class="pointer center">{$auctionbid['id_customer']|escape:'htmlall':'UTF-8'}</td>
					<td class="pointer center">
						{if $auctionbid['bid_price'] != 0}
							{$currency_unit|escape:'htmlall':'UTF-8'} {round($auctionbid['bid_price']|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
						{else}
							-
						{/if}
					</td>
					<td class="pointer center">
						{if $auctionbid['automatic_bid_price'] != 0}
							{$currency_unit|escape:'htmlall':'UTF-8'} {round($auctionbid['automatic_bid_price']|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}
						{else}
							-
						{/if}
					</td>

					{if $auction_status == 1}
						{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
							<td class="pointer center">-</td>
							<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
							<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
							<td class="pointer center">-</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							<td class="pointer center">-</td>
						{else}
							<td class="pointer center">-</td>
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
						{/if}
					{else if $auction_status == 2}
						{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
							<td class="pointer center">-</td>
							<td class="pointer center">
								{if $win_byautomatic == 0}
									{if $auctionbid['bid_price'] == $winner_bid_price}
										<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$currency_unit|escape:'htmlall':'UTF-8'} {round($winner_bid_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}</span>
									{/if}
								{else}
									<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
								{/if}
							</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
							<td class="pointer center" style="color:green;">
								{if $auctionbid['automatic_bid_price'] >= $winner_bid_price}
									<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$currency_unit|escape:'htmlall':'UTF-8'} {round($winner_bid_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}</span>
								{else}
									<span style="color:red;">{l s='Lost' mod='wkproductauction'}</span>
								{/if}
							</td>
							<td class="pointer center">-</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							<td class="pointer center">-</td>
						{else}
							<td class="pointer center">-</td>
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
						{/if}
					{/if}
				</tr>
				{/foreach}
				</tbody>
			</table>
		</div>
	{/if}
</div>
{/if}

{strip}
	{addJsDef ajaxurl_product = $link->getAdminlink('AdminAuctionDetail')}
{/strip}
<script>
$(document).ready(function() {
	var auctionId = $('#auctionid').val();
	{if (isset($addNewAuction) && $addNewAuction == 1) || ($auction_status != 2 && !isset($id_auction)) }
		var enableAuction = $('input[name=enable_auction]:checked');
		if (enableAuction.val() == 0)
			$('.wk-auction-body').addClass('hidden');
		else
			$('.wk-auction-body').removeClass('hidden');
	{else}
		$('.wk-auction-body').removeClass('hidden');
	{/if}
	
	var buyitnowvalue = $('input[name=buyitnow_status]:checked').val();
	if (buyitnowvalue == 0)
		$('#buyitnow_data').hide();
	else
		$('#buyitnow_data').show();
	
	var incrementvalue = $('input[name=increment_status]:checked').val();
	if (incrementvalue == 0)
		$('#increment_data').hide();
	else
		$('#increment_data').show();
});
$(document).ready(function () {
	$('.datetimepicker').datetimepicker({
		dateFormat: 'yy-mm-dd',
		timeFormat: 'hh:mm:ss',
		minDate: 0
	});
});
</script>

 

Link to comment
Share on other sites

Portion of the previous code with the checkbox section:

	{if $auction_status == 1}
						{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
							<td class="pointer center">-</td>
							<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 1}
							<td class="pointer center" style="color:green;">{l s='Leading' mod='wkproductauction'}</td>
							<td class="pointer center">-</td>
						{else if $auctionbid['automatic_status'] == 1 && $auctionbid['bid_status'] == 0}
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
							<td class="pointer center">-</td>
						{else}
							<td class="pointer center">-</td>
							<td class="pointer center" style="color:red;">{l s='Lost' mod='wkproductauction'}</td>
						{/if}
					{else if $auction_status == 2}
						{if $auctionbid['automatic_status'] == 0 && $auctionbid['bid_status'] == 1}
							<td class="pointer center">-</td>
							<td class="pointer center">
								{if $win_byautomatic == 0}
									{if $auctionbid['bid_price'] == $winner_bid_price}
										<span style="color:green;">{l s='Winner' mod='wkproductauction'} - {$currency_unit|escape:'htmlall':'UTF-8'} {round($winner_bid_price|escape:'htmlall':'UTF-8',$decimal_point|escape:'htmlall':'UTF-8')}</span>
									{/if}

 

Link to comment
Share on other sites

13 minutes ago, wakabayashi said:

Please search in your tpl files for "check_autobid" and then post the code of the tpl.

I dind't find "check_autobid" but I found this instead: frontend_bid.tpl:

<style>
{if $content_only} 
	.flip-clock-wrapper ul { 
		width: 17px;
		height: 30px;
	}

	.flip-clock-wrapper ul li {
		line-height: 32px;
	}

	.flip-clock-wrapper .inn {
		font-size: 19px !important;
	}

	.flip-clock-divider {
		width: 13px;
	}

	.flip-clock-divider .flip-clock-dot {
		width: 6px; height: 6px;
	}

	.flip-clock-dot.bottom {
		bottom: 15px !important;
	}

	.flip-clock-dot.top {
		top: 38px !important;
	}

	.flip-clock-divider .flip-clock-label {
		right: -35px;
	}

	.flip-clock-divider.seconds .flip-clock-label {
		right: -48px;
	}

	.flip-clock-divider.minutes .flip-clock-label {
		right: -43px;
	}

	.flip-clock-divider .flip-clock-label {
		font-size: 12px;
	}
{/if}
</style>
<div class="auction_detail block">
	<h4>{l s='Available For Bid' mod='wkproductauction'}</h4>	
	<div class="clock auction_clock"></div>
	<div class="wk-error"></div>
	<div class="wk-success"></div>
	<div>
		<input type="hidden" value="{$id_auction|escape:'htmlall':'UTF-8'}" id="id_auction" name="id_auction" />
		<input type="hidden" value="{if isset($last_bid_purchase)}{$last_bid_purchase|escape:'htmlall':'UTF-8'}{/if}" id="last_bid_purchase" name="last_bid_purchase" />
		<input type="hidden" value="{$customer_id|escape:'htmlall':'UTF-8'}" id="customer_id" name="customer_id" />
		<input type="hidden" value="{$current_maximum_bid1|escape:'htmlall':'UTF-8'}" id="minimum_bid_amount_enter" name="minimum_bid_amount_enter" />
		<input type="hidden" value="{$current_maximum_bid1|escape:'htmlall':'UTF-8'}" id="current_maximum_bid1" name="current_maximum_bid1" />
		<input type="hidden" value="{$starting_price1|escape:'htmlall':'UTF-8'}" id="starting_price1" name="starting_price1" />
		{* <input type="hidden" value="{$currency_unit|escape:'htmlall':'UTF-8'}" id="currency_unit" name="currency_unit" /> *}
		<input type="hidden" name="minimum_gap" id="minimum_gap" value="{$minimum_gap|escape:'htmlall':'UTF-8'}" />
		<input type="hidden" name="minimum_auto_gap" id="minimum_auto_gap" value="{$minimum_auto_gap|escape:'htmlall':'UTF-8'}" />
		<input type="hidden" name="automatic_bidprice" id="automatic_bidprice" value="{$current_maximum_autobid|escape:'htmlall':'UTF-8'}" />
		<input type="hidden" name="allow_normalbid" id="allow_normalbid" value="{$allow_normalbid|escape:'htmlall':'UTF-8'}" />

		<div class="row_info" style="border-bottom:1px solid #E4E4E4;">
			<div class="label">{l s='Highest Bid' mod='wkproductauction'}</div>
			<div id="cur_bid" class="label value">
			<span id="highestbid">{$current_maximum_bid_display|escape:'htmlall':'UTF-8'}</span></div>
			<div style="clear:both;"></div>	
		</div>
		{if isset($biddername_status) && $biddername_status == 1}
			<div class="row_info" style="border-bottom:1px solid #E4E4E4;">
				<div class="label">{l s='Bidder Name' mod='wkproductauction'}</div>
				<div class="label value" id="biddername">{$current_biddername|escape:'htmlall':'UTF-8'}</div>
				<div style="clear:both;"></div>
			</div>
		{/if}
		<div class="row_info" style="border-bottom:1px solid #E4E4E4;">
			<div class="label">{l s='Starting Bid Price' mod='wkproductauction'}</div>
			<div class="label value">
			<span id="startprice">{$starting_price_display|escape:'htmlall':'UTF-8'}</span></div>
			<div style="clear:both;"></div>
		</div>
		{if isset($increment_status) && $increment_status == 1}
			<div class="row_info" style="border-bottom:1px solid #E4E4E4;">
				<div class="label">{l s='Next Minimum Bid' mod='wkproductauction'}</div>
				<div class="label value">
					{if $current_maximum_bid1 == 0}
						<span id="next_minimum_bid">{$starting_price_display|escape:'htmlall':'UTF-8'}</span>
					{else}
						<span id="next_minimum_bid">{$next_minimum_bid_display|escape:'htmlall':'UTF-8'}</span>
					{/if}
				</div>
				<div style="clear:both;"></div>
			</div>
		{/if}		
	</div>
	{if isset($automatic_bid_status) && $automatic_bid_status == 1}
		<div style="margin-top:20px;">
			<div class="bid_input" style="width:6%;margin-left:1%;padding-top:3px;">
				<input type="checkbox" name="check_autobid" id="check_autobid">
			</div>
			<div class="bid_input">
				<label for="check_autobid">{l s='Place Bid as Automatic' mod='wkproductauction'}</label>
			</div>
			<div style="clear:both;"></div>
		</div>
		<div class="alert alert-info" id="customer_autobid_div" style="padding:5px;{if $customer_autobid == 0}display:none;{/if}">
			<span class="close delete_automaticbid" title="{l s='Cancel your automatic bid' mod='wkproductauction'}" >&times;</span>
			{l s='Your Automatic Bid : ' mod='wkproductauction'}
			 <span id="customer_autobid">{$customer_autobid_display|escape:'htmlall':'UTF-8'}</span>
		</div>
	{/if}
	<div style="margin-top:15px;">
		<div class="bid_input" style="width: 40%;">
			<input type="text" class="form-control bidtextbox" size="9" name="bid_amount" id="bid_amount" value="" placeholder="{l s='Make your bid now' mod='wkproductauction'}"/>
		</div> 	
		<div class="bid_input" style="margin-left:2%;">
			<div class="submit_bid_btn btn btn-default">
				<button id="insert_new_bid" class="btn btn-info" style="padding:4px 10px;">
					{l s='BID NOW' mod='wkproductauction'}
				</button>
			</div>
		</div> 	
		<div style="clear:both;"></div>
	</div>
</div>

<div id="auction_complete" class="block"><h4>{l s='Auction Closed' mod='wkproductauction'}</h4>
	<span>{l s='Please wait...' mod='wkproductauction'}</span>
</div>

{strip}
	{addJsDef getproduct_pageurl = $link->getPageLink('authentication', true, (int){$language_id|escape:'htmlall':'UTF-8'}, ['back' => {$product_pageurl|escape:'htmlall':'UTF-8'}])}
	{addJsDef path_url = $link->getModulelink('wkproductauction', 'customerbiddetails')}

	{addJsDef time_left_time_stamp1 = $time_left_time_stamp1|escape:'htmlall':'UTF-8'}
	{addJsDef default_lang_iso=$default_lang_iso|escape:'htmlall':'UTF-8'}
	{addJsDef img_ps_dir=$img_ps_dir|escape:'htmlall':'UTF-8'}

	{addJsDefL name=auction_close}{l s='You can not bid because auction is not running' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=not_allow}{l s='You are not allowed for Bidding' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=enter_bid}{l s='Enter Your Bid Amount' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=no_space}{l s='There should be no Space' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=less_than_ten}{l s='Bid Amount must be Less than 10 digits' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=automatic_greater}{l s='Automatic Bid amount must be greater than ' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=automatic_equal}{l s='Automatic Bid amount must be greater than or equal to ' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=must_greater_automatic}{l s='Amount must be greater than Current Highest Automatic Bid' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_equal}{l s='Bid amount must be greater than or equal to ' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=automatic_submit}{l s='Automatic Bid Submitted' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_submit}{l s='Bid Submitted' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=some_error}{l s='Some error occurs please try again' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_amout_decimal_ten}{l s='Bid Amount must be Less than 10 digits before decimal' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_amout_decimal_six}{l s='Bid Amount must be Less than 6 digits after decimal' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_numeric}{l s='Bid Amount should be numeric' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=bid_positive}{l s='Bid Amount must be positive number' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=not_allow_normalbid}{l s='You can not do normal bid because you did automatic bid on this auction' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=confirm_msg}{l s='Are you sure want to delete your automatic bid' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=automaticbid_delete}{l s='Your Automatic Bid has been deleted' js=1 mod='wkproductauction'}{/addJsDefL}
	{addJsDefL name=wk_automatic_auction_placed}{l s='Automatic bidding is placed so the highest bid will get updated according to the automatic bidding' js=1 mod='wkproductauction'}{/addJsDefL}
{/strip}

 

Link to comment
Share on other sites

<input type="checkbox" name="check_autobid" id="check_autobid">

<input type="checkbox" name="check_autobid" id="check_autobid" <?php echo "checked=\"checked\""?>>

The first line of code is in the file. Should be something like the second one to keep it checked by default?

Link to comment
Share on other sites

Yes, it is a cache issue, I've just tried with Chrome and it appears cheched, and with a private window of Firefox, which I usually use, and it appears checked also.

Thank-you very much for your indications!

Link to comment
Share on other sites

1 minute ago, dynambee said:

When I visit your linked page now that checkbox is checked when the page loads.

Thank-you. Yes, it was a browser cache issue. I see it checked too with other browsers or private window.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...