Jump to content

Recommended Posts

Hi Techies,

 

I am using PS version 1.5.4.1.

 

I need quantity up and quantity down as in shopping cart page. The quantity up and quantity down is available in 1.6 version. But I need in version 1.5.4.1.

 

Here with attached my requirement as image with circled red.

 

Thanks in advance.

 

mdusamaansari

post-737659-0-60183700-1405946154_thumb.png

Link to comment
Share on other sites

Hi

 

In file product.tpl

 

find and delete

 

 

<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity :'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
</p>
 
 
In place of the remote unit, add
 
 
<script type="text/javascript" src="{$js_dir}incrementing.js"></script>
<div class="buyid" id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<input id="uprice" type="hidden" value="{Tools::ps_round($productPrice)}" />
<input type="text" name="qty" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} disabled="disabled" /><input type="button" class="incbtn inc"><input type="button" class="incbtn dec">
</div>
 
 
add this file global.css
 
.buyid {margin:5px 1px;}
 
.buyid input[name=qty]{
    border: 1px solid #D2D1CD;
    color: #BEBEBA;
    font-size: 12px;
    font-weight: normal;
    height: 17px;
    width: 28px;
padding:0 2px;
margin:0;
}
 
.incbtn {
border:none;
width:19px;
height:19px;
vertical-align:top;
cursor:pointer;
margin: 0 0 0 1px;
}
.inc {
background:url(../img/up.png) no-repeat 0 0;
}
 
.dec {
background:url(../img/down.png) no-repeat 0 0;
}
 
.inc:hover {background:url(../img/upa.png) no-repeat 0 0;}
.dec:hover{background:url(../img/downa.png) no-repeat 0 0;}
 
Open modules / blockcart / ajax-cart.js find and replace:
 
find:
ajaxCart.add(idProduct, null, false, this);
replace:
 
 
 
var incval = $(this).parent().parent().find('input[name=qty]').val();
ajaxCart.add(idProduct, null, false, this, parseInt(incval));
 
 
 
Copy the files from the archive img
Copy the file "incrementing.js"
 
Edited by TimShoper (see edit history)
Link to comment
Share on other sites

 

Hi

 

In file product.tpl

 

find and delete

 

 

<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity :'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
</p>
 
 
In place of the remote unit, add
 
 
<script type="text/javascript" src="{$js_dir}incrementing.js"></script>
<div class="buyid" id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<input id="uprice" type="hidden" value="{Tools::ps_round($productPrice)}" />
<input type="text" name="qty" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} disabled="disabled" /><input type="button" class="incbtn inc"><input type="button" class="incbtn dec">
</div>
 
 
add this file global.css
 
.buyid {margin:5px 1px;}
 
.buyid input[name=qty]{
    border: 1px solid #D2D1CD;
    color: #BEBEBA;
    font-size: 12px;
    font-weight: normal;
    height: 17px;
    width: 28px;
padding:0 2px;
margin:0;
}
 
.incbtn {
border:none;
width:19px;
height:19px;
vertical-align:top;
cursor:pointer;
margin: 0 0 0 1px;
}
.inc {
background:url(../img/up.png) no-repeat 0 0;
}
 
.dec {
background:url(../img/down.png) no-repeat 0 0;
}
 
.inc:hover {background:url(../img/upa.png) no-repeat 0 0;}
.dec:hover{background:url(../img/downa.png) no-repeat 0 0;}
 
Open modules / blockcart / ajax-cart.js find and replace:
 
find:
ajaxCart.add(idProduct, null, false, this);
replace:
 
 
 
var incval = $(this).parent().parent().find('input[name=qty]').val();
ajaxCart.add(idProduct, null, false, this, parseInt(incval));
 
 
 
Copy the files from the archive img
Copy the file "incrementing.js"
 

 

 

Hi TimShoper,

 

Really am very much thankful for your support. I fount this is very helpful for me.

 

I am using version 1.5.4.1. I found a small issue that, my qty named input field value is not getting updated when I press "plus" or "minus". So the default value is sending to blockcart. 

 

Here is my online link, where you can check it out. http://store.unikmobil.dk/

 

Thanks in advance.

Link to comment
Share on other sites

  • 9 months later...
  • 2 weeks later...

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...