Code: Select all
<?php echo $text_stock; ?> <?php echo $stock; ?>
Thank you in advance
Code: Select all
<?php echo $text_stock; ?> <?php echo $stock; ?>
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
<modification>
<id>Qty on Category</id>
<version>1.0.1</version>
<vqmver>2.3.0</vqmver>
<author></author>
<file name="catalog/view/theme/*/template/product/category.tpl">
<operation>
<search position="replace"><![CDATA[<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>]]></search>
<add><![CDATA[<div class="image"><a href="<?php echo $product['href']; ?>" id="location-<?php echo $product['product_id']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>]]></add>
</operation>
<operation>
<search position="before"><![CDATA[<div class="button-group">]]></search>
<add><![CDATA[<input type="text" name="quantity" value="<?php echo $product['minimum']; ?>" size="2" id="input-quantity-<?php echo $product['product_id']; ?>" class="form-control-qty" />]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>]]></search>
<add><![CDATA[<button type="button" onclick="addToCart('<?php echo $product['product_id']; ?>')"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>]]></add>
</operation>
<operation>
<search position="before"><![CDATA[<?php echo $footer; ?>]]></search>
<add><![CDATA[
<style>
.form-control-qty {
width: 50px;
height: 5%;
padding: 10px 0px 12px 0px;
border: medium none;
display: inline-block;
float: left;
background-color: #EEE;
color: #888;
line-height: 38px;
font-weight: bold;
text-align: center;
}
</style>
<script type="text/javascript">
function addToCart(product_id){
var product_id = product_id;
var qty = $('#input-quantity-'+product_id).val();
var location = $('#location-'+product_id).attr('href');
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id='+product_id+'&quantity='+qty,
dataType: 'json',
beforeSend: function() {
$('#button-cart').button('loading');
},
complete: function() {
$('#button-cart').button('reset');
},
success: function(json) {
$('.alert, .text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
window.location = location;
}
if (json['error']['recurring']) {
window.location = location;
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.breadcrumb').after('<div class="alert alert-success">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>');
$('#cart > button').html('<i class="fa fa-shopping-cart"></i> ' + json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
</script>
]]></add>
</operation>
</file>
</modification>
See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
No problem at all, take your time, I also sent you a PM with some other suggestions to modify the module according your needs, i.e. to display the Availability on other pages/modules aside the Category page, like Manufacturers, Search, and Specials pages, as well on Bestsellers, Featured, Latest, and Specials modules
See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
<search position="before"><![CDATA[<div class="button-group">]]></search>
<add><![CDATA[
<input data-toggle="tooltip" title="Products in Stock" type="text" name="quantity" value="<?php echo $product['quantity']; ?>" size="2" class="form-control-qty" />
]]></add>
Code: Select all
<search position="before"><![CDATA[<p class="price">]]></search>
<add><![CDATA[
<p><input data-toggle="tooltip" title="Products in Stock" type="text" name="quantity" value="<?php echo $product['quantity']; ?>" size="2" class="form-control-qty" /> Products in Stock</p>
]]></add>
</operation>
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
<div class="qty-box"><p class="figure"><input data-toggle="tooltip" title="Products in Stock" ............ </p></div>
Code: Select all
<div class="caption text-center qty-box"><input data-toggle="tooltip" title="Products in Stock" ............ </div>
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
width: 25%;
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Users browsing this forum: No registered users and 66 guests