Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes addto.phtml #3002

Merged
merged 7 commits into from
Feb 1, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,31 @@
?>

<?php $_product = $this->getProduct(); ?>
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->getAddUrlWithCustomParams($_product, [], false); ?>
<?php $_params = $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])); ?>
<?php $_wishlistSubmitUrl = $this->helper('wishlist')->isAllow() ? $this->helper('wishlist')->getAddUrlWithCustomParams($_product, [], false) : '' ?>
<?php $_compareUrl = $this->helper('catalog/product_compare')->getAddUrlCustom($_product, false); ?>

<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<li>
<a href="<?php echo $_wishlistSubmitUrl ?>"
onclick="productAddToCartForm.submitLight(this, this.href); return false;"
class="link-wishlist">
<?php echo $this->__('Add to Wishlist') ?>
</a>
</li>
<?php endif ?>
<?php
$_compareUrl = $this->helper('catalog/product_compare')->getAddUrlCustom($_product, false);
?>
<?php if($_compareUrl) : ?>
<li>
<span class="separator">|</span>
<a href="#"
class="link-compare"
onclick="customFormSubmit('<?php echo $_compareUrl ?>', '<?php echo $_params ?>', 'post')">
<?php echo $this->__('Add to Compare') ?>
</a>
</li>
<?php endif ?>

</ul>
<?php if($_wishlistSubmitUrl || $_compareUrl): ?>
<ul class="add-to-links">
fballiano marked this conversation as resolved.
Show resolved Hide resolved
<?php if ($_wishlistSubmitUrl) : ?>
<li>
<a href="<?php echo $_wishlistSubmitUrl ?>"
onclick="productAddToCartForm.submitLight(this, this.href); return false;"
class="link-wishlist">
<?php echo $this->__('Add to Wishlist') ?>
</a>
</li>
<?php endif ?>
<?php if($_compareUrl) : ?>
<?php $_params = $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])) ?>
<li>
<?php if ($_wishlistSubmitUrl): ?><span class="separator">|</span><?php endif ?>
<a href="#"
class="link-compare"
onclick="customFormSubmit('<?php echo $_compareUrl ?>', '<?php echo $_params ?>', 'post')">
<?php echo $this->__('Add to Compare') ?>
</a>
</li>
<?php endif ?>

fballiano marked this conversation as resolved.
Show resolved Hide resolved
</ul>
<?php endif ?>
fballiano marked this conversation as resolved.
Show resolved Hide resolved