How render product wishlist link functionality in custom template (phtml) in magento 2
How to display wishlist link (with functionality) in custom phtml file using template file in magento 2
magento2 custom phtml wishlist
add a comment |
How to display wishlist link (with functionality) in custom phtml file using template file in magento 2
magento2 custom phtml wishlist
add a comment |
How to display wishlist link (with functionality) in custom phtml file using template file in magento 2
magento2 custom phtml wishlist
How to display wishlist link (with functionality) in custom phtml file using template file in magento 2
magento2 custom phtml wishlist
magento2 custom phtml wishlist
edited 15 mins ago
Sanjay Gohil
472214
472214
asked Oct 24 '16 at 9:18
shankar bossshankar boss
59431230
59431230
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
__('Add to Wish List') . '</span></a>
Refer the below file and related block for more details
vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml
Make sure your custom module should use
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"wishlist": {
"component": "Magento_Wishlist/js/view/wishlist"
}
}
}
}
}
</script>
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f142299%2fhow-render-product-wishlist-link-functionality-in-custom-template-phtml-in-mag%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
__('Add to Wish List') . '</span></a>
Refer the below file and related block for more details
vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml
Make sure your custom module should use
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"wishlist": {
"component": "Magento_Wishlist/js/view/wishlist"
}
}
}
}
}
</script>
add a comment |
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
__('Add to Wish List') . '</span></a>
Refer the below file and related block for more details
vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml
Make sure your custom module should use
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"wishlist": {
"component": "Magento_Wishlist/js/view/wishlist"
}
}
}
}
}
</script>
add a comment |
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
__('Add to Wish List') . '</span></a>
Refer the below file and related block for more details
vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml
Make sure your custom module should use
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"wishlist": {
"component": "Magento_Wishlist/js/view/wishlist"
}
}
}
}
}
</script>
You can try something like the following code:
<a href="#" data-post='<?php echo $this->helper('MagentoWishlistHelperData')->getAddParams($_product) ?>' class="action towishlist" data-action="add-to-wishlist"><span>' .
__('Add to Wish List') . '</span></a>
Refer the below file and related block for more details
vendormagentomodule-catalogviewfrontendtemplatesproductlisting.phtml
Make sure your custom module should use
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"wishlist": {
"component": "Magento_Wishlist/js/view/wishlist"
}
}
}
}
}
</script>
edited 13 mins ago
ABHISHEK TRIPATHI
2,0081727
2,0081727
answered Oct 24 '16 at 9:53
Krishna ijjadaKrishna ijjada
5,85742356
5,85742356
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f142299%2fhow-render-product-wishlist-link-functionality-in-custom-template-phtml-in-mag%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown