- Posts: 7
- Thank you received: 0
Add-to-cart Button
- Polina Chekmareva
- Topic Author
- Offline
- Fresh Boarder
Less
More
9 years 9 months ago #7685
by Polina Chekmareva
Add-to-cart Button was created by Polina Chekmareva
How to add an "Add-to-cart Button" on the category page?
Please Log in or Create an account to join the conversation.
- Trung Duong
- Offline
- Administrator
Less
More
- Posts: 2284
- Thank you received: 998
Notice: Undefined variable: end_tag_params in /home/omegatheme/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 2321
Notice: Undefined variable: end_tag_params in /home/omegatheme/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 2321
Notice: Undefined variable: end_tag_params in /home/omegatheme/public_html/libraries/kunena/External/Nbbc/src/BBCode.php on line 2321
9 years 9 months ago #7689 by Trung Duong
Replied by Trung Duong on topic Add-to-cart Button
Dear Sir,
Browse to components/com_virtuemart/views/category/tmpl/default.php edit this file and search for:
and add more this code:
Regards
Browse to components/com_virtuemart/views/category/tmpl/default.php edit this file and search for:
Code:
<?php // Product Details Button
echo JHTML::link ($product->link, JText::_ ('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name, 'class' => 'product-details'));?>
and add more this code:
Code:
<?php
// Display the quantity box ?>
<!-- <label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
<span class="quantity-box">
<input type="text" class="quantity-input" name="quantity[]" value="1" />
</span>
<span class="quantity-controls">
<input type="button" class="quantity-controls quantity-plus" />
<input type="button" class="quantity-controls quantity-minus" />
</span>
<?php // Display the quantity box END ?>
<?php // 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';
} ?>
<?php // Display the add to cart button ?>
<span class="addtocart-button">
<input type="submit" name="addtocart" class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
</span>
<div class="clear"></div>
</div>
<?php // Display the add to cart button END ?>
<input type="hidden" class="pname" value="<?php echo $product->product_name ?>">
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="cart" />
<noscript><input type="hidden" name="task" value="add" /></noscript>
<input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>" />
<?php /** @todo Handle the manufacturer view */ ?>
<input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $product->virtuemart_manufacturer_id ?>" />
<input type="hidden" name="virtuemart_category_id[]" value="<?php echo $product->virtuemart_category_id ?>" />
<br>
</form>
Regards
Support email: services(at)omegatheme(dot)com
Follow Us to keep updated!
[img]...[/img]
[img]...[/img]
[img]...[/img]
Please Log in or Create an account to join the conversation.
Time to create page: 0.232 seconds