是否可以为 AddThis 插件提供自定义 url?

发布于 2024-12-13 05:09:04 字数 121 浏览 5 评论 0原文

我有 magento 愿望清单,我想分享它,AddThis 插件会很好,因为你可以与所有社交应用程序分享它。但在 Magento 中,愿望清单 url 与共享愿望清单地址不同,因此是否可以共享与当前 url 用户不同的 url?

I have magento wishlist and I want to share it and AddThis plugin would be good, because you can share it with all social apps. But in Magento wishlist url is different to shared wishlist address, so is it possible to share different url than current url user is?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

御守 2024-12-20 05:09:04

我自己设法做到了,这是代码:

<?php
// app/design/frontend/base/default/template/wishlist/view.phtml (override this in your template)

$wishlist = $this->_getWishlist();
$shareWishListUrl = Mage::getUrl('*/shared/index', array('code' => $wishlist->getSharingCode()));
$shareAttributes = "addthis:url='$shareWishListUrl' addthis:title=" . $this->__('My Wishlist') . " addthis:description='' ";
?>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " style="float: left;">
<div class="text-align: left !important;"><?php echo $this->__('Share My Wishlist'); ?>:</div>
<a class="addthis_button_preferred_1" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_2" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_3" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_4" <?php echo $shareAttributes; ?>></a>
<a href="http://www.addthis.com/bookmark.php" class="addthis_button_compact" <?php echo $shareAttributes; ?>></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
<!-- AddThis Button END -->

I managed to do it myself, here is code:

<?php
// app/design/frontend/base/default/template/wishlist/view.phtml (override this in your template)

$wishlist = $this->_getWishlist();
$shareWishListUrl = Mage::getUrl('*/shared/index', array('code' => $wishlist->getSharingCode()));
$shareAttributes = "addthis:url='$shareWishListUrl' addthis:title=" . $this->__('My Wishlist') . " addthis:description='' ";
?>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " style="float: left;">
<div class="text-align: left !important;"><?php echo $this->__('Share My Wishlist'); ?>:</div>
<a class="addthis_button_preferred_1" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_2" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_3" <?php echo $shareAttributes; ?>></a>
<a class="addthis_button_preferred_4" <?php echo $shareAttributes; ?>></a>
<a href="http://www.addthis.com/bookmark.php" class="addthis_button_compact" <?php echo $shareAttributes; ?>></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
<!-- AddThis Button END -->
知你几分 2024-12-20 05:09:04

对于最新的 addthis 代码,请使用 data-url 和 data-title。请参阅此处了解更多信息。

For the latest addthis code, use data-url and data-title. See here for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文