Author Topic: "Add to cart" included in the product details  (Read 1400 times)

Hungphieu

  • Beginner
  • *
  • Posts: 12
  • A beginner
"Add to cart" included in the product details
« on: February 01, 2018, 05:53:08 am »
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)

Code: [Select]
<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
Code: [Select]
<?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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28464
  • Always on vacation
    • Jenkin Hill Internet
Re: "Add to cart" included in the product details
« Reply #1 on: February 01, 2018, 11:29:43 am »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VirtueMart 4.0.12 10777  J 3.10.11 PHP 7.4.30