- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2015 12:35 AM
Hi All,
I am unable to hide HTML text using catalog client script. I want only Order Now button in the form.
I wrote catalog client script and able to hide everything, but not Order this Item text which doesn't have Id in view source(HTML).
function onLoad()
{
sc_delivery_time_label_cell.hide();
sc_delivery_time_cell.hide();
sc_cart_item_list.hide();
price_subtotal_span.hide();
price_subtotal_label_span.hide();
price_label_span.hide();
price_span.hide();
quantity_label_span.hide();
quantity.hide();
oi_add_to_cart_button.hide();
}
Someone Plz let me know how to hide this Order this Item text in the form using catalog client script???
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2015 07:39 AM
Hi Mallikarjuna,
A couple of observations:
a) you may want to remove the .hide() lines since these could be causing errors and so then stopping the execution of the script
b) try adding the script in an onChange catalog client script. I tried it in Fuji and it works (it removes the Order This Item label)
function onChange(control, oldValue, newValue, isLoading) {
gel('qty').firstElementChild.childNodes[0].style.display = 'none';
//Type appropriate comment here, and begin script below
}
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2015 07:52 AM
its working fine now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2015 03:01 AM
Even I am implementing the same. I want to hide the 'Order this item' label. I am able to do with the scriptgel('qty').firstElementChild.childNodes[0].style.display = 'none';.
But it ll be for a particular catalog item if i write a onLoad script on catalog item. How to make it work for all the catalog item ??
Please help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2016 11:51 AM
HI All,
The code, "gel('qty').firstElementChild.childNodes[0].style.display = 'none';." works fine. But I dont understand this line of code, Can anybody help me understand about this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2016 03:29 AM
Hi Ganapati, sure.
I'll explain how i wrote this code within a couple of minutes and then everything else will make sense...
To write this particular line of code i just went an did an Inspect Element browser function over the element I will like to modify. The browser will then show me the internal structure of that element and the html that surrounds it. I did went ahead and identified the first identifiable element (element with an ID on it) from which i could start to crawl up to the point where I can reach the label. Once I have reach the given label element, i can then modify it's display property to none.
A couple of comments about this approach:
a) it was a very quick example intended to demonstrate how it can be done.
b) it's not the most elegant solution and very sensitive to be broken in a future SNOW release since it's depending on internal elements of the SNOW page that could change on any release without notice.
I hope this helps!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2017 02:47 AM
hi
onChange script is not working for me :can you give clear idea about this????