- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:21 AM
In service portal, when I click on "add to cart" button, it gives me two option. one is "Catalog Home" and another is "View Cart". I want to take off "Catalog Home" button and put another button in there called "Continue shopping" which will redirect user to the sc_cat_item_guide. Can someone please help me with that?
Clear instruction with steps please. I am not familiar with service now.
Thank you!
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:15 AM
Oleg,
I have done this and still it's not mapping to the sc_cat_item_guide. Can you please help me with it?
spModal.open({
message: i18n.getMessage('Items have been added successfully'),
size: 'sm',
backdrop: 'static',
keyboard: false,
noDismiss: true,
buttons: [
{label: i18n.getMessage('Continue Shopping'), cancel:true},
{label: i18n.getMessage('View Cart'), primary:true}
]
}).then(function() {
$location.search("id=sc_cart");
}, function() {
$location.search("id=sc_cat_item_guide");
})
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 05:47 AM
Oleg,
Thank you very much for explaining each step. It worked. Thanks a lot. I need one more help, I need to add "Continue Shopping' button on the same place where "Catalog Home" used to be. And "continue shopping" button will take them back to order guide page. Can you please help me with how to get that job done please?
Thank you,
Rinty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 06:05 AM
If I correctly understand your problem then you can change the callback function
function() {
$location.search("id=sc_cart");
}
to
function (result) {
if (result.label === i18n.getMessage('Continue Shopping')) {
// do something if neeed
} else {
$location.search("id=sc_cart");
}
}
You can add any custom property to the button and test the property too:
buttons: [
{ label: i18n.getMessage('Catalog Home'), cancel: true },
{ label: i18n.getMessage('Catalog Home'), customProperty: "customValue" },
{ label: i18n.getMessage('View Cart'), primary: true }
]
and to use
function (result) {
if (result.customProperty === "customValue") {
// do something if neeed
} else {
$location.search("id=sc_cart");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:15 AM
Oleg,
I have done this and still it's not mapping to the sc_cat_item_guide. Can you please help me with it?
spModal.open({
message: i18n.getMessage('Items have been added successfully'),
size: 'sm',
backdrop: 'static',
keyboard: false,
noDismiss: true,
buttons: [
{label: i18n.getMessage('Continue Shopping'), cancel:true},
{label: i18n.getMessage('View Cart'), primary:true}
]
}).then(function() {
$location.search("id=sc_cart");
}, function() {
$location.search("id=sc_cat_item_guide");
})
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:42 AM
Sorry, but I'm not sure that I understand the problem correctly. Do you want to display 2 buttons or 3 buttons? To which page you want to redirect?
The statement $location.search("id=sc_cat_item_guide"); isn't work because sc_cat_item_guide required sys_id parameter (try something like id=sc_cat_item_guide&sys_id=d0b15e33d7033100a9ad1e173e24d49e). If you want to redirect to some specific catalog item. I though that id=sc_home or id=sc_category&catalog_id=-1 is the page for "Continue shopping".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2019 10:55 AM
Now I am redirecting to Home page. It worked now. Thanks a lot.
Thanks,
Rinty