-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Safari 7.1.2
A couple of years ago I developed a theatre ticketing linked to Hikashop to sell tickets for our society's performances and everything worked well. People could click on the seat they wanted and the ticket would be added to the basket. If they changed their mind, they could click on the seat again and the ticket would be removed from the basket. This was achieved through a javascript module which essentially called hikashopModifyQuantity (see below), passing it either +1 or -1 as required.
I have now upgraded to the latest version of Hikashop and this no longer seems to work. It adds the seat just as before - but clicking on the seat again no longer removes it. It appears that hikashopModifyQuantity no longer accepts negative amounts. Is that right? And, if so, is there another way to achieve what I need to do?
Many thanks!
Jonathan
// function toggles seat image and alters quantity in basket
function toggleSeat(seatID,productID,category)
{
var x=document.getElementById(seatID).innerHTML;
var product; // final product ID (corresponding to adult or concession)
var y;
var field = new jmt_field;
if (x.search("seat-category") > 0) {
y=getRadioCheckedValue("ticket_type_form","ticket_type");
if (y == "Concession") {
document.getElementById(seatID).innerHTML="<img src=\"http://myco.org.uk/seat-chosen-concession.gif\" title="+seatID+">";
product = productID + 2;
}
else {
document.getElementById(seatID).innerHTML="<img src=\"http://myco.org.uk/seat-chosen.gif\" title="+seatID+">";
product = productID + 1;
}
field.value = 1;
}
else {
if (x.search("concession") > 0) {
product = productID + 2;
}
else {
product = productID + 1;
}
document.getElementById(seatID).innerHTML="<img src=\"http://myco.org.uk/seat-category"+category+".gif\" title="+seatID+">";
field.value = 0;
}
if (hikashopCheckChangeForm('item','hikashop_product_form'))
{
return hikashopModifyQuantity(product,field,1,0,'cart');
}
else {
return false;
}
}