Search the Community
Showing results for tags 'read only'.
-
Shopping Cart: How to set a listed product Quantity to read only
gearup posted a topic in HTML/XHTML
Hi, I am adding a product by default to each order so it will always appear in the shopping cart. What I am trying to achieve is for this product the Quantity remains set at 1 (eg read only). I have added some php to the cart body htm file and I now get 2 columns for quantity, one read only and the other is editable (I know this is an error but...). I know the ID for this product (39) but seem unable to get the conditional code to detect the ID and just set that specific one to read only. can someone please tell me what is wrong here? Here is the htm code, original, <tr><td class="mod_bakery_cart_td_thumb_f"><a href="{LINK}"><img src="{THUMB_URL}" alt="{NAME}" width="{THUMB_WIDTH}" height="{THUMB_HEIGHT}" border="0" /></a></td><td class="mod_bakery_cart_td_sku_f">{SKU}</td><td class="mod_bakery_cart_td_name_f"><span class="mod_bakery_cart_item_f">{NAME}</span><br />{ATTRIBUTE}</td><td class="mod_bakery_cart_td_quantity_f"><input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a></td><td class="mod_bakery_cart_td_price_f">{PRICE}</td><td class="mod_bakery_cart_td_shipping_f" style="display: {DISPLAY_SHIPPING}">{SHIPPING}</td><td class="mod_bakery_cart_td_sum_f">{TOTAL}</td></tr> and now changed by me, <tr><td class="mod_bakery_cart_td_thumb_f"><a href="{LINK}"><img src="{THUMB_URL}" alt="{NAME}" width="{THUMB_WIDTH}" height="{THUMB_HEIGHT}" border="0" /></a></td><td class="mod_bakery_cart_td_sku_f">{SKU}</td><td class="mod_bakery_cart_td_name_f"><span class="mod_bakery_cart_item_f">{NAME}</span><br />{ATTRIBUTE}</td><td class="mod_bakery_cart_td_quantity_f" id="{ITEM_ID}" $id-xx = id> <?php if $id-xx == 39): ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" readonly="readonly" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <?php else: ?> <input type="text" name="quantity[{ITEM_ID}][{ATTRIBUTES}]" value="{QUANTITY}" id="id_{ITEM_ID}_{ATTRIBUTES}" style="text-align: right" size="4" /> <a href="#" onclick="javascript: mod_bakery_delete_item_f('{ITEM_ID}_{ATTRIBUTES}');"> <img src="{WB_URL}/modules/bakery/images/delete.gif" alt="{TEXT_DELETE}" title="{TEXT_DELETE}" /></a> <?php endif; ?></td><td class="mod_bakery_cart_td_price_f">{PRICE}</td><td class="mod_bakery_cart_td_shipping_f" style="display: {DISPLAY_SHIPPING}">{SHIPPING}</td><td class="mod_bakery_cart_td_sum_f">{TOTAL}</td></tr> I think my problem is with passing a value into the php section but someone else may have a better idea. Regards,