release 0.267: front layout/basket fixes and product redirect hardening
This commit is contained in:
@@ -7,6 +7,22 @@
|
||||
unset( $price );
|
||||
unset( $price_new );
|
||||
$product = \shop\Product::getFromCache( (int)$position['product-id'], $this -> lang_id );
|
||||
|
||||
$permutation = null;
|
||||
if ( isset( $position['parent_id'] ) and (int)$position['parent_id'] and isset( $position['product-id'] ) )
|
||||
$permutation = \shop\Product::get_product_permutation_hash( (int)$position['product-id'] );
|
||||
|
||||
if ( !$permutation and isset( $position['attributes'] ) and is_array( $position['attributes'] ) and count( $position['attributes'] ) )
|
||||
$permutation = implode( '|', $position['attributes'] );
|
||||
|
||||
$quantity_options = \shop\Product::get_product_permutation_quantity_options(
|
||||
(int)( $position['parent_id'] ? $position['parent_id'] : $position['product-id'] ),
|
||||
$permutation
|
||||
);
|
||||
|
||||
$max_quantity = (int)$quantity_options['quantity'];
|
||||
if ( !$max_quantity and (int)$quantity_options['stock_0_buy'] )
|
||||
$max_quantity = 999;
|
||||
?>
|
||||
<div class="basket-product">
|
||||
<div class="image">
|
||||
@@ -72,7 +88,7 @@
|
||||
<a href="#" class="btn btn-default btn-minus" product-hash="<?= $position_hash; ?>">
|
||||
<i class="fa fa-minus"></i>
|
||||
</a>
|
||||
<input type="text" name="quantity" id="quantity" class="int-format form-control" min="1" max="<?= \shop\Product::get_product_quantity( (int)$position['product-id'] ); ?>" value="<?= $position['quantity']; ?>" product-hash="<?= $position_hash; ?>">
|
||||
<input type="text" name="quantity" id="quantity" class="int-format form-control" min="1" max="<?= $max_quantity; ?>" value="<?= $position['quantity']; ?>" product-hash="<?= $position_hash; ?>">
|
||||
<a href="#" class="btn btn-default btn-plus" product-hash="<?= $position_hash; ?>">
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
@@ -111,4 +127,4 @@
|
||||
<div class="alert alert-danger">Brak produktów w koszyku</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user