-
AuthorPosts
-
Carlo B. Dalle Molle Friend
Carlo B. Dalle Molle
- Join date:
- September 2014
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 2
March 11, 2013 at 12:48 pm #185721Hi,
how I can to insert the add to cart button in the category layout view, in the featured product and best sales?
thanks
RegardsCarlo B. Dalle Molle FriendCarlo B. Dalle Molle
- Join date:
- September 2014
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 2
March 12, 2013 at 1:21 pm #486193Hi,
thank you for your support.
1. in the featured product and best sales –> dont’ work.
2. In the category view –> work correctlyI’ve another question for you…how I can to use the vintas cart style for the add to cart button?
phong nam Friendphong nam
- Join date:
- May 2015
- Posts:
- 3779
- Downloads:
- 1
- Uploads:
- 587
- Thanks:
- 499
- Thanked:
- 974 times in 888 posts
March 13, 2013 at 9:32 am #486312Hi templaeit,
I’m sorry for making this issue more complex. It’s easer than I thought. So, I’d like to rewrite the guide for you to add “Add to cart” button as you attached.
1. Add to cart button in the featured product and best sales.
You just need to access this VirtueMart Products modules in vm-product position (like our demo) which are Featured Products & Best Sales, and Set Yes to “Show Add-To-Cart Link?”. You can see my attached image for results.2. In the category view. (You need a little bit customization.)
On your server, open templatesja_vintashtmlcom_virtuemartcategory default.php. Then paste below codes:[PHP] <form method=”post” class=”product” action=”index.php” id=”addtocartproduct<?php echo $product->virtuemart_product_id ?>”>
<div class=”addtocart-bar”><?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 ?>” />
</form>[/PHP]AFTER codes:
[PHP]<p>
<?php // Product Details Button
echo JHTML::link($product->link, JText::_(‘COM_VIRTUEMART_PRODUCT_DETAILS’), array(‘title’ => $product->product_name,’class’ => ‘product-details’));
?>
</p>[/PHP]Then Save. Clean T3 Cache. Lets see my attached image with Add to cart button on Category view
Don’t forget to inform me your result.
Regards,
—
LeoMarch 26, 2013 at 3:53 pm #487915Hi,
I am trying to use it but i do not understand where to place the code.
In fact i only want the button in the category view, so i deduce that only step 2 is needed !1.- on the templatesja_vintashtmlcom_virtuemartcategorydefault.php file there is already code, so where exactly i paste the first part of the code.
2.- Where exactly i paste the “AFTER codes”??
thanks in advance,
Albertphong nam Friendphong nam
- Join date:
- May 2015
- Posts:
- 3779
- Downloads:
- 1
- Uploads:
- 587
- Thanks:
- 499
- Thanked:
- 974 times in 888 posts
March 27, 2013 at 2:09 am #487940Hi amoreno,
🙂 In step 2. <blockquote>on the templatesja_vintashtmlcom_virtuemartcategory default.php </blockquote>
Firstly, You need to find where is <blockquote> <p>
<?php // Product Details Button
echo JHTML::link($product->link, JText::_(‘COM_VIRTUEMART_PRODUCT_DETAILS’), array(‘title’ => $product->product_name,’class’ => ‘product-details’));
?>
</p></blockquote> >> at line 298.
Then you copy & paste the above codes after this code.>> Then Save.
Regards,
—
LeoCarlo B. Dalle Molle FriendCarlo B. Dalle Molle
- Join date:
- September 2014
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 5
- Thanks:
- 2
March 27, 2013 at 7:55 am #487965Hi,
now it work fine, thank you for your support.AuthorPostsViewing 6 posts - 1 through 6 (of 6 total)This topic contains 6 replies, has 3 voices, and was last updated by Carlo B. Dalle Molle 11 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
add to cart button in category layout view, in the featured product and best sales
Viewing 6 posts - 1 through 6 (of 6 total)