Hi,
So I have the add to cart button in the category view... (not sure how) But the problem i have is that the "add to cart" button is allowing people to check out without selecting variables that are in the child products.
For example, the add to cart in category view is allowing people to add a tshirt to the cart without selecting the size and color.....
How do i fix this?
Thanks
alyssa
This code is in my templates/com_virtuemart/default.php settings....
// Add the button
$button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
$button_cls = ''; //$button_cls = 'addtocart_button';
if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) {
$button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY');
$button_cls = 'notify-button';
} ?>
I am thinking here is where i need to add code to check for child products and variations.... Help please!!!
I need to make sure that when, for example, someone adds a tshirt to the cart it asks for size and color. which i added via child products.
the url is www.roguegunfighter.com it is a live site and i really need to get this fixed up!! THanks so much in advance for the help!
That sticked thread about addtocart-in-category couldn't help you?
I read many threads and responses on the add to cart. But am unable to fix it.
I would greatly appreciate the helo on how to ensure child products are pulled for the add to cart in category view.
thank you very much!
Alyssa
This is working if you have done what madking's solution suggested, not if you have used files from somewher in the thread!
These are the steps:
1 Create a folder rootOfYourSite/templates/yourTemplate/html/com_virtuemart/category
Copy into this:-
2 default.php from com_virtuemart/views/category/tmpl
3 default_addtocart.php from components/com/virtuemart/views/productdetails/tmpl
4 Rename default_addtocart.php to something sensible e.g. addtocartCategory.php works for me
5 In the new file addtocartCategory.php replace $this->product with $product
6 Now go to the copied default.php (the browse view for a category) and add the new add to cart template (button etc.) in the position you want
Do this somewhere between
// Show Products and <!-- end of product -->
Using the code
Code: [Select]
<?php include 'addtocartCategory.php'; ?>
The category add to cart should then perform the same as the product add to cart.
Hutson!!!
Thank you so very much for taking the time to help me!
It didn't do exactly what i was expecting but it works just great.
Thank you again!!!
I appreciate the non-judgey help
Alyssa
So i did the add... And now in category view it has a product details button instead of add to cart....
Which is fine.. However, since i did the change clicking the "add to cart" button in the browse view taken 2-3 seconds or longer for the item to show up in the cart...
Any thought on why this is?
Joomla 2.5.new one and virtuemart 2.0.22d
Thanks so much
Alyssa
Do you have a link I can look at?
thank you!!