adding "add to cart" to category view

GK User
Wed Mar 14, 2012 11:28 pm
http://aleksandrshevchenko.org/store - "Popular Items" have the add to cart funtion.

however, "10 ЛУЧШИХ ТОВАРОВ" and "РЕКОМЕНДУЕМЫЕ ТОВАРЫ" and category view (http://aleksandrshevchenko.org/store/categories/sermons) - there is no add to cart function without having to enter into the product details.

I looked for the code for over 45 min and can't find it. I understand that "popular items" is NSP GK4 - but i really love that functionality and think it should be part of the gavick esport template for all items in VM.

What would be the code that find/replace/add into the /templates/gk_esport/html/com_virtuemart/category/default.php for the category view to add this funtion (i don't know the file i'd edit for the VM popular/latest/recommended)


I found this in file /modules/mod_news_pro_gk4/tmpl/layout.parts.php
Code: Select all
if($config['vm_add_to_cart'] == 1) {
           
            $code = '';
            $code .= '<form method="post" class="product" action="index.php">';
            $code .= '<div class="addtocart-bar">';
            $code .= '<span class="quantity-box" style="display: none">
         <input type="text" class="quantity-input" name="quantity[]" value="1" />
         </span>';
           
            $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
         $button_cls = '';
            $stockhandle = VmConfig::get('stockhandle','none');
           
            $code .= '<span class="addtocart-button">
            <input type="submit" name="addtocart" class="addtocart-button" value="'.$button_lbl.'" title="'.$button_lbl.'" /></span>';


i tried adding it to /templates/gk_esport/html/com_virtuemart/category/default.php - but it's not working. :(

add button.jpg
User avatar
Expert Boarder

GK User
Thu Mar 15, 2012 11:47 am
ok.. i was able to follow this post: http://forum.virtuemart.net/index.php?topic=90961.30

and it helped me do it for category view..

what file do i edit for the recommended/top10 items.

these have the add to cart function already: http://aleksandrshevchenko.org/store/categories/sermons

but i want this page to have it as well. http://aleksandrshevchenko.org/store
User avatar
Expert Boarder

GK User
Thu Mar 15, 2012 12:05 pm
ffministry wrote:ok.. i was able to follow this post: http://forum.virtuemart.net/index.php?topic=90961.30

and it helped me do it for category view..

what file do i edit for the recommended/top10 items.

these have the add to cart function already: http://aleksandrshevchenko.org/store/categories/sermons

but i want this page to have it as well. http://aleksandrshevchenko.org/store


seems like this doesn't work all the way. I think the solution i need to do is after adding the button.. try to apply the same class as you guys have for NSP GK4 = .nspVmStore input.addtocart-button

how can i add that class into this page http://aleksandrshevchenko.org/store/categories/sermons instead of the buttons there right now.

that button also does bring up a popup like your + button in NSP GK4. i hope adding that class will fix that.
User avatar
Expert Boarder

GK User
Tue Mar 20, 2012 12:15 pm
i added that class into the php file and it solved the issue.
User avatar
Expert Boarder


cron