Php Magento添加到愿望列表按钮不工作
我需要使愿望列表链接成为一个按钮,因此我将addTo.phtml中的代码从Php Magento添加到愿望列表按钮不工作,php,html,internet-explorer,magento,button,Php,Html,Internet Explorer,Magento,Button,我需要使愿望列表链接成为一个按钮,因此我将addTo.phtml中的代码从 <li><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?&g
<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>
<button type="button" class="button fabriqButton2"><a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;"><span><span><?php echo __('Add to Wishlist');?></span></span></a></button>
出于某种原因,这在Chrome和Firefox中有效,但在IE中不起作用。
有人知道如何将其作为按钮使用吗?尽量避免在
标记内使用
标记。而是将所有内容移动到单击按钮的位置,并移除
标记
<button type="button" class="button fabriqButton2" onclick="productAddToCartForm.submitLight(this, '<?php echo $_wishlistSubmitUrl ?>');"><span><span><?php echo __('Add to Wishlist');?></span></span></button>
啊,谢谢你的回复:)我想这是无效的。但是我不知道如何把所有的东西都移动到一按按钮。我如何将“href”属性也发送到那里呢?我编辑了上面的帖子,href属性只是在JavaScript崩溃的情况下作为备用,我去掉了它,只将productAddToCartForm.submitLight()
放在那里。@Weszzz7更正,它实际上说的是productAddToCartForm.submitLight(这个,这个.href)
因此我将旧的href属性替换为this.href
。试试代码,看看它是否有效;-)非常感谢你,如果不删除按钮,我就想不出来:)Ej Rick,你知道下面的修复方法吗?
<button type="button" class="button backLink fabriqButton" onclick="setLocation('<?php echo $this->escapeUrl($this->getBackUrl()) ?>');"><span><span><?php echo __('Back');?></span></span></button>