How can I add "Quantity" to a VirtueMart "Browse" page?
My VirtueMart shop.browse
page has the typical columns of SKU, Name, Price, and "Update" (which contains the Add to Cart button). I would like to add a Quantity column between Price and Update so that a buyer can choose a quantity prior to pressing the "Add to Cart" button.
Though I don't know HOW to do this, I think I know WHERE to do it:
/public_html/components/com_virtuemart/themes/default/templates/browse/includes/browse_listtable.tpl.php
Lines 67-72 of that file tell the program how to build the table, but what I DON'T know how to do is modify the code source to tell it to include quantity as an element for the table. Here's the code:
// Loop through each row and build the table
foreach($data as $key => $value) {
$table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', '开发者_高级运维td', true );
$i = $i == 1 ? 2 : 1;
}
Which include file is actually being called in this foreach
loop, and what code would I add to reference quantity data?
You should not modify your core code. If you just need to put quantity box inside your browse template use variable $form_addtocart It will give you quantity box and add to cart button. All variables for browse page and for flypage template you can find here: http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html
If this is not what you are trying to get, please be more specific, or show your web page.
精彩评论