News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

"Add to cart" included in the product details

Started by Hungphieu, February 01, 2018, 05:53:08 AM

Previous topic - Next topic

Hungphieu

Hi
Can anyone help me how to add a button "Add to cart" included in the product details?

I copied this code (.../templates/t3_bs3_blank/html/com_virtuemart/productdetails/default_addtocart.php)

<span class="addtocart_button2">
                <?php if ($this->product->orderable) { ?>
                    <button type="submit" value="<?php echo $button_lbl ?>" title="<?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO');?>" class="addtocart-button cart-click"><?php echo JText::_('COM_VIRTUEMART_CART_ADD_TO'); ?><span>&nbsp;</span></button>
                    <?php }else { ?>
                    <span title="<?php echo JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT');?>" class="addtocart-button addtocart-button-disabled cart-click"><?php echo JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT'); ?></span>
                    <?php ?>
                </span>



and pasted below this code
<?php  if ($this->product->product_desc) { ?>
        <h2> <?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'); ?></h2>
        <div>
        <?php echo '<div class="desc">' .$this->product->product_desc.'</div>'?>
         <?php
 if (!empty($this->product->customfieldsSorted['tags'])) {
$this->position 'tags';
echo '<div class="tags">' .$this->loadTemplate('tags').'</div>';
 }
// Product custom ?>



But not working.
I'm using Joomla 3.4.0 Virtuemart 3.0.6.4
Thank all !

jenkinhill

You should update your seriously old Joomla & VirtueMart versions before trying to make template overrides.  https://forum.virtuemart.net/index.php?topic=118683.0
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum