How to clone button add to cart to deferent place without no quantity. And change only string language.
I create file.
button_add_to_cart_item_custom.php
Code: Select all
<?php
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
?>
<div class="<?php echo $d['s']['c']['pull-right'] ?> <?php echo $d['s']['c']['form-group'] ?> ph-item-add-to-cart-box">
<input type="hidden" name="id" value="<?php echo (int)$d['id']; ?>">
<input type="hidden" name="catid" value="<?php echo (int)$d['catid']; ?>">
<input type="hidden" name="task" value="checkout.add">
<input type="hidden" name="tmpl" value="component" />
<input type="hidden" name="option" value="com_phocacart" />
<input type="hidden" name="return" value="<?php echo $d['return']; ?>" />
<div class="<?php echo $d['s']['c']['form-group'] ?> ph-form-quantity phProductAddToCart<?php echo $d['typeview']. (int)$d['id'] .' '.$d['class_btn']; ?>">
</div>
<div class="<?php echo $d['s']['c']['form-group'] ?> ph-form-button"><?php
if ($d['addtocart'] == 1) {
?><button type="submit" class="<?php echo $d['s']['c']['btn.btn-primary'] ?> ph-btn phProductAddToCart<?php echo $d['typeview'] . (int)$d['id'] .' '.$d['class_btn']; ?>"><span class="<?php echo $d['s']['i']['shopping-cart'] ?>"></span> <?php echo JText::_('Kupit'); ?></button><?php
} else if ($d['addtocart'] == 4) {
?><button type="submit" class="<?php echo $d['s']['c']['btn.btn-primary'] ?> ph-btn phProductAddToCart<?php echo $d['typeview']. (int)$d['id'] .' '.$d['class_btn']; ?>" title="<?php echo JText::_('Kupit'); ?>"><span class="<?php echo $d['s']['i']['shopping-cart'] ?>"></span></button><?php
} ?>
<?php /* <input type="submit" value="submit" name="submit" role="button" /> */ ?>
</div>
<div class="ph-cb"></div>
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</div>
I add to templates/as002027free/html/com_phocacart/item/default.php
281 line.
Code: Select all
echo JLayoutHelper::render('button_add_to_cart_custom', $d, JPATH_SITE.'/templates/as002027free/html/layouts/com_phocacart/');
Event if i add
Code: Select all
echo $layoutA->render($d);
Is this some kind of protection against adding a second button?