>.<
<input type="text" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="1" class="form-cart" style="display:none;">
<select class="countOrders" value="<?php echo $product['quantity']; ?>" >
<?php for($i=1; $i<=20; $i++):?>
<option value="<?=$i?>" <?=($i == $product['quantity'] ? ' selected="selected"' : '' )?>><?=$i?> шт</option>
<?php endfor;?>
</select>
<span class="input-group-btn">
<button type="button" data-toggle="tooltip" class="btn btn-danger" onclick="cart.remove('<?php echo $product['key']; ?>');"><i class="fa fa-times-circle"></i></button>
</span>
Гдето внизу подключить
<script>
$( document ).ready(function() {
$('.countOrders').on('change', function(e){
$(this).prev().val( $(this).val() );
$('#cart-form2').submit();
})
});
</script>
<input type="text" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="1" class="form-cart" style="display:none;"/>
<select class="countOrders" value="<?php echo $product['quantity']; ?>" onchange="$(this).prev().val( $(this).val()); $('#cart-form2').submit(); " >
<?php for($i=1; $i<=20; $i++):?>
<option value="<?=$i?>" <?=($i == $product['quantity'] ? ' selected="selected"' : '' )?>><?=$i?> шт</option>
<?php endfor;?>
</select>
<span class="input-group-btn">
<button type="button" data-toggle="tooltip" class="btn btn-danger" onclick="cart.remove('<?php echo $product['key']; ?>');"><i class="fa fa-times-circle"></i></button>
</span>
<code>
<?=Yii::t('message.model','NAME_ATTR')?>
public $enableCsrfValidation = false;
public function actions()
{
return [
'social' => [
'class' => 'yii\authclient\AuthAction',
'successCallback' => [$this, 'successCallback'],
],
];
}
/**
* @param $client
*/
public function successCallback($client)
{
$day = 86400;
$client_id = Yii::$app->request->get('authclient');
$attributes = $client->getUserAttributes();
// VK
if($client instanceof VKontakte)
{
$auth_params = $client->getAccessToken()->getParams();
$email = ArrayHelper::getValue($auth_params,'email','');
// Аватарка из VK да ПОБОЛЬШЕ!!!
$vk_data_response = $client->api('users.get','POST',['uids'=> $attributes['id'] , 'fields'=> 'photo_max_orig']);
if($vk_data_response = ArrayHelper::getValue($vk_data_response,'response',false))
{
$vk_data = array_shift($vk_data_response);
Yii::$app->session->setFlash('social_avatar', $vk_data['photo_max_orig']);
}
}
//...
}
curl -s http://getcomposer.org/installer | php
curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer